24.04
|
Command buffer contains a list of commands that is constructed once and later enqueued multiple times. More...
#include <CLCommandBuffer.h>
Public Member Functions | |
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... | |
virtual void | add_kernel (cl_kernel kernel, const cl::NDRange &offset, const cl::NDRange &global, const cl::NDRange &local)=0 |
Add a kernel enqueue command to the command queue. 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... | |
virtual void | finalize ()=0 |
Finalize the command buffer. More... | |
virtual void | update ()=0 |
Update the command buffer with new kernel argument values. More... | |
virtual void | enqueue ()=0 |
Enqueue the command buffer. More... | |
virtual bool | is_finalized () const =0 |
Check if the command buffer has been finalized. More... | |
Static Public Member Functions | |
static std::unique_ptr< CLCommandBuffer > | create (cl_command_queue queue) |
Create a new command buffer targeting the specified command queue. More... | |
Command buffer contains a list of commands that is constructed once and later enqueued multiple times.
To prepare a command buffer:
To execute the command buffer:
Definition at line 52 of file CLCommandBuffer.h.
|
default |
Constructor.
|
virtualdefault |
Destructor.
|
delete |
Disallow copy constructor.
|
delete |
Disallow move constructor.
|
pure virtual |
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. |
Implemented in CLCompatCommandBuffer, and CLMutableCommandBuffer.
|
inline |
Add the mutable argument to the current kernel enqueue command.
This function must be called after CLCommandBuffer::add_kernel but before the command buffer has been finalized.
The pointer must be valid and it must point to the correct value at the time CLCommandBuffer::update is called so that the value of the argument can be applied successfully to the kernel enqueue command.
[in] | arg_idx | The index of the argument in the current kernel program. |
[in] | value | The pointer to the value of the argument. |
Definition at line 106 of file CLCommandBuffer.h.
|
static |
Create a new command buffer targeting the specified command queue.
[in] | queue | The command queue to execute the command buffer. |
Definition at line 36 of file CLCommandBuffer.cpp.
References arm_compute::command_buffer_mutable_dispatch_supported(), CLKernelLibrary::get(), and CLKernelLibrary::get_device().
|
pure virtual |
Enqueue the command buffer.
This function must be called after the command buffer has been finalized.
Implemented in CLCompatCommandBuffer, and CLMutableCommandBuffer.
|
pure virtual |
Finalize the command buffer.
Implemented in CLCompatCommandBuffer, and CLMutableCommandBuffer.
|
pure virtual |
Check if the command buffer has been finalized.
Implemented in CLCompatCommandBuffer, and CLMutableCommandBuffer.
|
delete |
Disallow move assignment.
|
delete |
Disallow copy assignment.
|
pure virtual |
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.
Implemented in CLCompatCommandBuffer, and CLMutableCommandBuffer.