|
Blender
V2.93
|
device representing an GPU OpenCL device. an instance of this class represents a single cl_device More...
#include <COM_OpenCLDevice.h>
Inherits blender::compositor::Device.
Public Member Functions | |
| OpenCLDevice (cl_context context, cl_device_id device, cl_program program, cl_int vendorId) | |
| constructor with opencl device More... | |
| OpenCLDevice (OpenCLDevice &&other) noexcept | |
| ~OpenCLDevice () | |
| void | execute (WorkPackage *work) override |
| execute a WorkPackage More... | |
| cl_context | getContext () |
| cl_command_queue | getQueue () |
| cl_mem | COM_clAttachMemoryBufferToKernelParameter (cl_kernel kernel, int parameterIndex, int offsetIndex, std::list< cl_mem > *cleanup, MemoryBuffer **inputMemoryBuffers, SocketReader *reader) |
| cl_mem | COM_clAttachMemoryBufferToKernelParameter (cl_kernel kernel, int parameterIndex, int offsetIndex, std::list< cl_mem > *cleanup, MemoryBuffer **inputMemoryBuffers, ReadBufferOperation *reader) |
| void | COM_clAttachMemoryBufferOffsetToKernelParameter (cl_kernel kernel, int offsetIndex, MemoryBuffer *memoryBuffers) |
| void | COM_clAttachOutputMemoryBufferToKernelParameter (cl_kernel kernel, int parameterIndex, cl_mem clOutputMemoryBuffer) |
| void | COM_clAttachSizeToKernelParameter (cl_kernel kernel, int offsetIndex, NodeOperation *operation) |
| void | COM_clEnqueueRange (cl_kernel kernel, MemoryBuffer *outputMemoryBuffer) |
| void | COM_clEnqueueRange (cl_kernel kernel, MemoryBuffer *outputMemoryBuffer, int offsetIndex, NodeOperation *operation) |
| cl_kernel | COM_clCreateKernel (const char *kernelname, std::list< cl_kernel > *clKernelsToCleanUp) |
Public Member Functions inherited from blender::compositor::Device | |
| Device ()=default | |
| Device (const Device &other)=delete | |
| Device (Device &&other) noexcept=default | |
| Device & | operator= (const Device &other)=delete |
| Device & | operator= (Device &&other)=delete |
| virtual | ~Device () |
| Declaration of the virtual destructor. More... | |
Static Public Member Functions | |
| static const cl_image_format * | determineImageFormat (MemoryBuffer *memoryBuffer) |
| determine an image format More... | |
device representing an GPU OpenCL device. an instance of this class represents a single cl_device
Definition at line 34 of file COM_OpenCLDevice.h.
| blender::compositor::OpenCLDevice::OpenCLDevice | ( | cl_context | context, |
| cl_device_id | device, | ||
| cl_program | program, | ||
| cl_int | vendorId | ||
| ) |
constructor with opencl device
| context | |
| device | |
| program | |
| vendorID |
Definition at line 38 of file COM_OpenCLDevice.cc.
References blender::compositor::context, error(), and blender::compositor::program.
|
noexcept |
Definition at line 53 of file COM_OpenCLDevice.cc.
| blender::compositor::OpenCLDevice::~OpenCLDevice | ( | ) |
Definition at line 63 of file COM_OpenCLDevice.cc.
| void blender::compositor::OpenCLDevice::COM_clAttachMemoryBufferOffsetToKernelParameter | ( | cl_kernel | kernel, |
| int | offsetIndex, | ||
| MemoryBuffer * | memoryBuffers | ||
| ) |
Definition at line 157 of file COM_OpenCLDevice.cc.
References error(), blender::compositor::MemoryBuffer::get_rect(), rcti::xmin, and rcti::ymin.
Referenced by COM_clAttachMemoryBufferToKernelParameter(), blender::compositor::BokehBlurOperation::executeOpenCL(), blender::compositor::DilateDistanceOperation::executeOpenCL(), blender::compositor::ErodeDistanceOperation::executeOpenCL(), blender::compositor::DirectionalBlurOperation::executeOpenCL(), blender::compositor::GaussianXBlurOperation::executeOpenCL(), blender::compositor::GaussianYBlurOperation::executeOpenCL(), and blender::compositor::VariableSizeBokehBlurOperation::executeOpenCL().
| cl_mem blender::compositor::OpenCLDevice::COM_clAttachMemoryBufferToKernelParameter | ( | cl_kernel | kernel, |
| int | parameterIndex, | ||
| int | offsetIndex, | ||
| std::list< cl_mem > * | cleanup, | ||
| MemoryBuffer ** | inputMemoryBuffers, | ||
| ReadBufferOperation * | reader | ||
| ) |
Definition at line 119 of file COM_OpenCLDevice.cc.
References COM_clAttachMemoryBufferOffsetToKernelParameter(), determineImageFormat(), error(), blender::compositor::ReadBufferOperation::getInputMemoryBuffer(), and result.
| cl_mem blender::compositor::OpenCLDevice::COM_clAttachMemoryBufferToKernelParameter | ( | cl_kernel | kernel, |
| int | parameterIndex, | ||
| int | offsetIndex, | ||
| std::list< cl_mem > * | cleanup, | ||
| MemoryBuffer ** | inputMemoryBuffers, | ||
| SocketReader * | reader | ||
| ) |
Definition at line 85 of file COM_OpenCLDevice.cc.
Referenced by blender::compositor::BokehBlurOperation::executeOpenCL(), blender::compositor::DilateDistanceOperation::executeOpenCL(), blender::compositor::ErodeDistanceOperation::executeOpenCL(), blender::compositor::DirectionalBlurOperation::executeOpenCL(), blender::compositor::GaussianXBlurOperation::executeOpenCL(), blender::compositor::GaussianYBlurOperation::executeOpenCL(), and blender::compositor::VariableSizeBokehBlurOperation::executeOpenCL().
| void blender::compositor::OpenCLDevice::COM_clAttachOutputMemoryBufferToKernelParameter | ( | cl_kernel | kernel, |
| int | parameterIndex, | ||
| cl_mem | clOutputMemoryBuffer | ||
| ) |
Definition at line 188 of file COM_OpenCLDevice.cc.
References error().
Referenced by blender::compositor::BokehBlurOperation::executeOpenCL(), blender::compositor::DilateDistanceOperation::executeOpenCL(), blender::compositor::ErodeDistanceOperation::executeOpenCL(), blender::compositor::DirectionalBlurOperation::executeOpenCL(), blender::compositor::GaussianXBlurOperation::executeOpenCL(), blender::compositor::GaussianYBlurOperation::executeOpenCL(), and blender::compositor::VariableSizeBokehBlurOperation::executeOpenCL().
| void blender::compositor::OpenCLDevice::COM_clAttachSizeToKernelParameter | ( | cl_kernel | kernel, |
| int | offsetIndex, | ||
| NodeOperation * | operation | ||
| ) |
Definition at line 173 of file COM_OpenCLDevice.cc.
References error(), blender::compositor::NodeOperation::getHeight(), and blender::compositor::NodeOperation::getWidth().
Referenced by blender::compositor::BokehBlurOperation::executeOpenCL(), blender::compositor::DilateDistanceOperation::executeOpenCL(), blender::compositor::ErodeDistanceOperation::executeOpenCL(), blender::compositor::GaussianXBlurOperation::executeOpenCL(), blender::compositor::GaussianYBlurOperation::executeOpenCL(), and blender::compositor::VariableSizeBokehBlurOperation::executeOpenCL().
| cl_kernel blender::compositor::OpenCLDevice::COM_clCreateKernel | ( | const char * | kernelname, |
| std::list< cl_kernel > * | clKernelsToCleanUp | ||
| ) |
Definition at line 268 of file COM_OpenCLDevice.cc.
References error().
Referenced by blender::compositor::BokehBlurOperation::executeOpenCL(), blender::compositor::DilateDistanceOperation::executeOpenCL(), blender::compositor::ErodeDistanceOperation::executeOpenCL(), blender::compositor::DirectionalBlurOperation::executeOpenCL(), blender::compositor::GaussianXBlurOperation::executeOpenCL(), blender::compositor::GaussianYBlurOperation::executeOpenCL(), and blender::compositor::VariableSizeBokehBlurOperation::executeOpenCL().
| void blender::compositor::OpenCLDevice::COM_clEnqueueRange | ( | cl_kernel | kernel, |
| MemoryBuffer * | outputMemoryBuffer | ||
| ) |
Definition at line 199 of file COM_OpenCLDevice.cc.
References error(), blender::compositor::MemoryBuffer::getHeight(), blender::compositor::MemoryBuffer::getWidth(), and size().
Referenced by blender::compositor::BokehBlurOperation::executeOpenCL(), blender::compositor::DilateDistanceOperation::executeOpenCL(), blender::compositor::ErodeDistanceOperation::executeOpenCL(), blender::compositor::DirectionalBlurOperation::executeOpenCL(), blender::compositor::GaussianXBlurOperation::executeOpenCL(), blender::compositor::GaussianYBlurOperation::executeOpenCL(), and blender::compositor::VariableSizeBokehBlurOperation::executeOpenCL().
| void blender::compositor::OpenCLDevice::COM_clEnqueueRange | ( | cl_kernel | kernel, |
| MemoryBuffer * | outputMemoryBuffer, | ||
| int | offsetIndex, | ||
| NodeOperation * | operation | ||
| ) |
Definition at line 214 of file COM_OpenCLDevice.cc.
References error(), blender::compositor::MemoryBuffer::getHeight(), blender::compositor::MemoryBuffer::getWidth(), height, blender::compositor::NodeOperation::isBraked(), blender::compositor::NVIDIA, size(), and width.
|
static |
determine an image format
| memorybuffer |
Definition at line 100 of file COM_OpenCLDevice.cc.
References BLI_assert, blender::compositor::MemoryBuffer::get_num_channels(), blender::compositor::IMAGE_FORMAT_COLOR, blender::compositor::IMAGE_FORMAT_VALUE, and blender::compositor::IMAGE_FORMAT_VECTOR.
Referenced by COM_clAttachMemoryBufferToKernelParameter(), and blender::compositor::WriteBufferOperation::executeOpenCLRegion().
|
overridevirtual |
execute a WorkPackage
| work | the WorkPackage to execute |
Implements blender::compositor::Device.
Definition at line 70 of file COM_OpenCLDevice.cc.
References blender::compositor::ExecutionGroup::allocateOutputBuffer(), blender::compositor::WorkPackage::chunk_number, blender::compositor::NodeOperation::executeOpenCLRegion(), blender::compositor::WorkPackage::execution_group, blender::compositor::ExecutionGroup::finalizeChunkExecution(), blender::compositor::ExecutionGroup::getInputBuffersOpenCL(), blender::compositor::ExecutionGroup::getOutputOperation(), and blender::compositor::WorkPackage::rect.
|
inline |
Definition at line 87 of file COM_OpenCLDevice.h.
Referenced by blender::compositor::GaussianXBlurOperation::executeOpenCL(), blender::compositor::GaussianYBlurOperation::executeOpenCL(), and blender::compositor::WriteBufferOperation::executeOpenCLRegion().
|
inline |
Definition at line 92 of file COM_OpenCLDevice.h.
Referenced by blender::compositor::WriteBufferOperation::executeOpenCLRegion().