24.04
|
Go to the documentation of this file.
25 #ifndef ACL_SRC_CORE_CL_CLCOMMANDBUFFER_H
26 #define ACL_SRC_CORE_CL_CLCOMMANDBUFFER_H
32 #include <type_traits>
61 static std::unique_ptr<CLCommandBuffer>
create(cl_command_queue queue);
91 add_kernel(cl_kernel kernel,
const cl::NDRange &
offset,
const cl::NDRange &global,
const cl::NDRange &local) = 0;
105 template <typename T, typename = std::enable_if_t<std::is_arithmetic<T>::value || std::is_pointer<T>::value>>
108 add_mutable_argument_generic(arg_idx, value,
sizeof(T));
120 virtual void update() = 0;
139 virtual void add_mutable_argument_generic(cl_uint arg_idx,
const void *value,
size_t size) = 0;
142 enum class State : int32_t
158 State _state{State::Created};
163 #endif // ACL_SRC_CORE_CL_CLCOMMANDBUFFER_H
static std::unique_ptr< CLCommandBuffer > create(cl_command_queue queue)
Create a new command buffer targeting the specified command queue.
virtual void enqueue()=0
Enqueue the command buffer.
CLCommandBuffer & operator=(const CLCommandBuffer &)=delete
Disallow copy assignment.
virtual void update()=0
Update the command buffer with new kernel argument values.
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
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.
Wrapper to configure the Khronos OpenCL C++ header.
virtual ~CLCommandBuffer()
Destructor.
Command buffer contains a list of commands that is constructed once and later enqueued multiple times...
CLCommandBuffer()
Constructor.
virtual bool is_finalized() const =0
Check if the command buffer has been finalized.
void add_mutable_argument(cl_uint arg_idx, const T *value)
Add the mutable argument to the current kernel enqueue command.
Copyright (c) 2017-2024 Arm Limited.
virtual void finalize()=0
Finalize the command buffer.