23.08
|
OpenCL buffer memory region implementation. More...
#include <CLMemoryRegion.h>
Public Member Functions | |
CLBufferMemoryRegion (cl_mem_flags flags, size_t size) | |
Constructor. More... | |
CLBufferMemoryRegion (const cl::Buffer &buffer) | |
Constructor. More... | |
virtual | ~CLBufferMemoryRegion () override |
void * | ptr () final |
Host/SVM pointer accessor. More... | |
void * | map (cl::CommandQueue &q, bool blocking) final |
Enqueue a map operation of the allocated buffer on the given queue. More... | |
void | unmap (cl::CommandQueue &q) final |
Enqueue an unmap operation of the allocated buffer on the given queue. More... | |
![]() | |
ICLMemoryRegion (size_t size) | |
Constructor. More... | |
virtual | ~ICLMemoryRegion ()=default |
Default Destructor. More... | |
ICLMemoryRegion (const ICLMemoryRegion &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
ICLMemoryRegion (ICLMemoryRegion &&)=default | |
Default move constructor. More... | |
ICLMemoryRegion & | operator= (const ICLMemoryRegion &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
ICLMemoryRegion & | operator= (ICLMemoryRegion &&)=default |
Default move assignment operator. More... | |
const cl::Buffer & | cl_data () const |
Returns the underlying CL buffer. More... | |
void * | buffer () override |
Returns the pointer to the allocated data. More... | |
const void * | buffer () const override |
Returns the pointer to the allocated data. More... | |
std::unique_ptr< IMemoryRegion > | extract_subregion (size_t offset, size_t size) override |
Extract a sub-region from the memory. More... | |
![]() | |
IMemoryRegion (size_t size) | |
Default constructor. More... | |
virtual | ~IMemoryRegion ()=default |
Virtual Destructor. More... | |
size_t | size () const |
Memory region size accessor. More... | |
void | set_size (size_t size) |
Sets size of region. More... | |
OpenCL buffer memory region implementation.
Definition at line 94 of file CLMemoryRegion.h.
CLBufferMemoryRegion | ( | cl_mem_flags | flags, |
size_t | size | ||
) |
Constructor.
[in] | flags | Memory flags |
[in] | size | Region size |
Definition at line 60 of file CLMemoryRegion.cpp.
References arm_compute::test::validation::context, and CLScheduler::get().
CLBufferMemoryRegion | ( | const cl::Buffer & | buffer | ) |
Constructor.
[in] | buffer | Buffer to be used as a memory region |
Definition at line 69 of file CLMemoryRegion.cpp.
References ICLMemoryRegion::buffer().
|
overridevirtual |
Definition at line 75 of file CLMemoryRegion.cpp.
References CLScheduler::get(), and CLScheduler::queue().
|
finalvirtual |
Enqueue a map operation of the allocated buffer on the given queue.
[in,out] | q | The CL command queue to use for the mapping operation. |
[in] | blocking | If true, then the mapping will be ready to use by the time this method returns, else it is the caller's responsibility to flush the queue and wait for the mapping operation to have completed before using the returned mapping pointer. |
Implements ICLMemoryRegion.
Definition at line 88 of file CLMemoryRegion.cpp.
References ARM_COMPUTE_ERROR_ON.
|
finalvirtual |
Host/SVM pointer accessor.
Implements ICLMemoryRegion.
Definition at line 83 of file CLMemoryRegion.cpp.
|
finalvirtual |
Enqueue an unmap operation of the allocated buffer on the given queue.
[in,out] | q | The CL command queue to use for the mapping operation. |
Implements ICLMemoryRegion.
Definition at line 95 of file CLMemoryRegion.cpp.
References ARM_COMPUTE_ERROR_ON.