23.08
|
Go to the documentation of this file.
91 _mapping = q.enqueueMapBuffer(_mem, blocking ? CL_TRUE : CL_FALSE, CL_MAP_READ | CL_MAP_WRITE, 0, _size);
98 q.enqueueUnmapMemObject(_mem, _mapping);
102 ICLSVMMemoryRegion::ICLSVMMemoryRegion(cl_mem_flags flags,
size_t size,
size_t alignment)
115 ICLSVMMemoryRegion::~ICLSVMMemoryRegion()
134 void *ICLSVMMemoryRegion::ptr()
147 clEnqueueSVMMap(q.get(), blocking ? CL_TRUE : CL_FALSE, CL_MAP_READ | CL_MAP_WRITE, _ptr, _size, 0,
nullptr,
nullptr);
size_t size() const
Memory region size accessor.
void unmap(cl::CommandQueue &q) final
Enqueue an unmap operation of the allocated buffer on the given queue.
Provides global access to a CL context and command queue.
void unmap(cl::CommandQueue &q) final
Enqueue an unmap operation of the allocated buffer on the given queue.
const cl::Buffer & cl_data() const
Returns the underlying CL buffer.
cl_int clEnqueueSVMMap(cl_command_queue command_queue, cl_bool blocking_map, cl_map_flags flags, void *svm_ptr, size_t size, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
void clSVMFree(cl_context context, void *svm_pointer)
CLBufferMemoryRegion(cl_mem_flags flags, size_t size)
Constructor.
void * map(cl::CommandQueue &q, bool blocking) final
Enqueue a map operation of the allocated buffer on the given queue.
void unmap(cl::CommandQueue &q) final
Enqueue an unmap operation of the allocated buffer on the given queue.
void * map(cl::CommandQueue &q, bool blocking) final
Enqueue a map operation of the allocated buffer on the given queue.
cl_int clFinish(cl_command_queue command_queue)
OpenCL memory region interface.
cl_int clEnqueueSVMUnmap(cl_command_queue command_queue, void *svm_ptr, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
void * clSVMAlloc(cl_context context, cl_svm_mem_flags_arm flags, size_t size, cl_uint alignment)
virtual ~CLBufferMemoryRegion() override
ICLMemoryRegion(size_t size)
Constructor.
Interface to enqueue OpenCL kernels and get/set the OpenCL CommandQueue and ICLTuner.
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
CLCoarseSVMMemoryRegion(cl_mem_flags flags, size_t size, size_t alignment)
Constructor.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
static CLScheduler & get()
Access the scheduler singleton.
OpenCL SVM memory region interface.
void * map(cl::CommandQueue &q, bool blocking) final
Enqueue a map operation of the allocated buffer on the given queue.
Copyright (c) 2017-2023 Arm Limited.
std::unique_ptr< IMemoryRegion > extract_subregion(size_t offset, size_t size) override
Extract a sub-region from the memory.
CLFineSVMMemoryRegion(cl_mem_flags flags, size_t size, size_t alignment)
Constructor.
void * buffer() override
Returns the pointer to the allocated data.
cl::CommandQueue & queue()
Accessor for the associated CL command queue.
void * ptr() final
Host/SVM pointer accessor.