24 #ifndef __ARM_COMPUTE_CLARRAY_H__ 25 #define __ARM_COMPUTE_CLARRAY_H__ 49 :
ICLArray<T>(max_num_values), _buffer(
cl::Buffer(
CLScheduler::get().context(), CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_WRITE, max_num_values * sizeof(T)))
58 void map(
bool blocking =
true)
82 uint8_t *do_map(cl::CommandQueue &q,
bool blocking)
override 85 return static_cast<uint8_t *
>(q.enqueueMapBuffer(_buffer, blocking ? CL_TRUE : CL_FALSE, CL_MAP_READ | CL_MAP_WRITE, 0, this->
max_num_values() *
sizeof(T)));
87 void do_unmap(cl::CommandQueue &q, uint8_t *mapping)
override 90 q.enqueueUnmapMemObject(_buffer, mapping);
void map(cl::CommandQueue &q, bool blocking=true)
Enqueue a map operation of the allocated buffer on the given queue.
const cl::Buffer & cl_buffer() const override
Interface to be implemented by the child class to return a reference to the OpenCL buffer containing ...
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Interface for OpenCL Array.
static CLScheduler & get()
Access the scheduler singleton.
void map(bool blocking=true)
Enqueue a map operation of the allocated buffer.
size_t max_num_values() const
Maximum number of values which can be stored in this array.
CLArray(size_t max_num_values)
Constructor: initializes an array which can contain up to max_num_points values.
void unmap(cl::CommandQueue &q)
Enqueue an unmap operation of the allocated and mapped buffer on the given queue. ...
CLArray(const CLArray &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...
Provides global access to a CL context and command queue.
const CLArray & operator=(const CLArray &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...
void unmap()
Enqueue an unmap operation of the allocated and mapped buffer.