24.02.1
|
OpenCL memory region interface. More...
#include <CLMemoryRegion.h>
Public Member Functions | |
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... | |
virtual void * | ptr ()=0 |
Host/SVM pointer accessor. More... | |
virtual void * | map (cl::CommandQueue &q, bool blocking)=0 |
Enqueue a map operation of the allocated buffer on the given queue. More... | |
virtual void | unmap (cl::CommandQueue &q)=0 |
Enqueue an unmap operation of the allocated buffer on the given queue. 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... | |
Public Member Functions inherited from IMemoryRegion | |
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 memory region interface.
Definition at line 35 of file CLMemoryRegion.h.
ICLMemoryRegion | ( | size_t | size | ) |
|
virtualdefault |
Default Destructor.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default move constructor.
|
overridevirtual |
Returns the pointer to the allocated data.
Implements IMemoryRegion.
|
overridevirtual |
Returns the pointer to the allocated data.
Implements IMemoryRegion.
Definition at line 43 of file CLMemoryRegion.cpp.
Referenced by CLBufferMemoryRegion::CLBufferMemoryRegion().
const cl::Buffer & cl_data | ( | ) | const |
Returns the underlying CL buffer.
Definition at line 38 of file CLMemoryRegion.cpp.
Referenced by CLTensorAllocator::cl_data(), and CLTensorAllocator::set_associated_memory_group().
|
overridevirtual |
Extract a sub-region from the memory.
[in] | offset | Offset to the region |
[in] | size | Size of the region |
Implements IMemoryRegion.
Definition at line 53 of file CLMemoryRegion.cpp.
References ARM_COMPUTE_UNUSED, offset(), and IMemoryRegion::size().
|
pure virtual |
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. |
Implemented in CLFineSVMMemoryRegion, CLCoarseSVMMemoryRegion, and CLBufferMemoryRegion.
Referenced by CLTensorAllocator::map().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default move assignment operator.
|
pure virtual |
|
pure virtual |
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. |
Implemented in CLFineSVMMemoryRegion, CLCoarseSVMMemoryRegion, and CLBufferMemoryRegion.
Referenced by CLTensorAllocator::unmap().