24.04
|
Command buffer implementaton based on CL mutable dispatch command buffer extension. More...
#include <CLMutableCommandBuffer.h>
Public Member Functions | |
CLMutableCommandBuffer (cl_command_queue queue) | |
Create a new mutable dispatch command buffer targeting the specified command queue. More... | |
virtual | ~CLMutableCommandBuffer () |
Destructor. More... | |
CLMutableCommandBuffer (const CLMutableCommandBuffer &)=delete | |
Disallow copy constructor. More... | |
CLMutableCommandBuffer & | operator= (const CLMutableCommandBuffer &)=delete |
Disallow copy assignment. More... | |
CLMutableCommandBuffer (CLMutableCommandBuffer &&)=delete | |
Disallow move constructor. More... | |
CLMutableCommandBuffer & | operator= (CLMutableCommandBuffer &&)=delete |
Disallow move assignment. More... | |
void | add_kernel (cl_kernel kernel, const cl::NDRange &offset, const cl::NDRange &global, const cl::NDRange &local) override |
Add a kernel enqueue command to the command queue. More... | |
void | finalize () override |
Finalize the command buffer. More... | |
void | update () override |
Update the command buffer with new kernel argument values. More... | |
void | enqueue () override |
Enqueue the command buffer. More... | |
bool | is_finalized () const override |
Check if the command buffer has been finalized. More... | |
Public Member Functions inherited from CLCommandBuffer | |
CLCommandBuffer () | |
Constructor. More... | |
virtual | ~CLCommandBuffer () |
Destructor. More... | |
CLCommandBuffer (const CLCommandBuffer &)=delete | |
Disallow copy constructor. More... | |
CLCommandBuffer & | operator= (const CLCommandBuffer &)=delete |
Disallow copy assignment. More... | |
CLCommandBuffer (CLCommandBuffer &&other)=delete | |
Disallow move constructor. More... | |
CLCommandBuffer & | operator= (CLCommandBuffer &&other)=delete |
Disallow move assignment. More... | |
template<typename T , typename = std::enable_if_t<std::is_arithmetic<T>::value || std::is_pointer<T>::value>> | |
void | add_mutable_argument (cl_uint arg_idx, const T *value) |
Add the mutable argument to the current kernel enqueue command. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from CLCommandBuffer | |
static std::unique_ptr< CLCommandBuffer > | create (cl_command_queue queue) |
Create a new command buffer targeting the specified command queue. More... | |
Command buffer implementaton based on CL mutable dispatch command buffer extension.
Definition at line 36 of file CLMutableCommandBuffer.h.
CLMutableCommandBuffer | ( | cl_command_queue | queue | ) |
Create a new mutable dispatch command buffer targeting the specified command queue.
[in] | queue | The command queue to execute the command buffer. |
Definition at line 35 of file CLMutableCommandBuffer.cpp.
References clCreateCommandBufferKHR(), and arm_compute::handle_cl_error().
|
virtual |
Destructor.
Definition at line 49 of file CLMutableCommandBuffer.cpp.
References ARM_COMPUTE_LOG_ERROR_ACL, clReleaseCommandBufferKHR(), and arm_compute::to_string().
|
delete |
Disallow copy constructor.
|
delete |
Disallow move constructor.
|
overridevirtual |
Add a kernel enqueue command to the command queue.
This function must be called before the command buffer has been finalized.
[in] | kernel | The CL kernel. |
[in] | offset | The global work offset. |
[in] | global | The global work size. |
[in] | local | The local work size. |
Implements CLCommandBuffer.
Definition at line 59 of file CLMutableCommandBuffer.cpp.
References ARM_COMPUTE_ERROR_ON, clCommandNDRangeKernelKHR(), arm_compute::handle_cl_error(), and offset().
|
overridevirtual |
Enqueue the command buffer.
This function must be called after the command buffer has been finalized.
Implements CLCommandBuffer.
Definition at line 137 of file CLMutableCommandBuffer.cpp.
References ARM_COMPUTE_ERROR_ON, clEnqueueCommandBufferKHR(), and arm_compute::handle_cl_error().
|
overridevirtual |
Finalize the command buffer.
Implements CLCommandBuffer.
Definition at line 100 of file CLMutableCommandBuffer.cpp.
References ARM_COMPUTE_ERROR_ON, clFinalizeCommandBufferKHR(), and arm_compute::handle_cl_error().
|
overridevirtual |
Check if the command buffer has been finalized.
Implements CLCommandBuffer.
Definition at line 146 of file CLMutableCommandBuffer.cpp.
|
delete |
Disallow move assignment.
|
delete |
Disallow copy assignment.
|
overridevirtual |
Update the command buffer with new kernel argument values.
This function must be called after the command buffer has been finalized.
All the value pointed by the mutable argument will be applied to the command buffer.
Implements CLCommandBuffer.
Definition at line 128 of file CLMutableCommandBuffer.cpp.
References ARM_COMPUTE_ERROR_ON, clUpdateMutableCommandsKHR(), and arm_compute::handle_cl_error().