#include <itkOpenCLMemoryObject.h>
The OpenCLMemoryObject class represents all common memory objects such as buffers and image objects.
- See also
- OpenCLContext
Definition at line 38 of file itkOpenCLMemoryObject.h.
◆ PointType
◆ RectangleType
◆ Self
◆ SizeType
◆ Access
◆ OpenCLMemoryObject() [1/3]
itk::OpenCLMemoryObject::OpenCLMemoryObject |
( |
OpenCLContext * | context = 0 | ) |
|
|
inlineprotected |
Constructs a null OpenCL memory object and associates it with context.
Definition at line 42 of file itkOpenCLMemoryObject.h.
◆ OpenCLMemoryObject() [2/3]
itk::OpenCLMemoryObject::OpenCLMemoryObject |
( |
OpenCLContext * | context, |
|
|
const cl_mem | id ) |
|
inlineprotected |
Constructs an OpenCL memory object from the native identifier id, and associates it with context. This class takes over ownership of id and will release it in the destructor.
Definition at line 50 of file itkOpenCLMemoryObject.h.
◆ ~OpenCLMemoryObject()
itk::OpenCLMemoryObject::~OpenCLMemoryObject |
( |
| ) |
|
|
protected |
Destructor for OpenCL memory object. After the memory object reference count becomes zero and commands queued for execution on a command-queue(s) that use memory object have finished, the memory object is deleted. If memory object is a buffer object, memory object cannot be deleted until all sub-buffer objects associated with memory object are deleted.
◆ OpenCLMemoryObject() [3/3]
itk::OpenCLMemoryObject::OpenCLMemoryObject |
( |
const Self & | other | ) |
|
|
privatedelete |
◆ GetAccess()
Returns the access mode that was used to create this memory object.
◆ GetContext()
◆ GetFlags()
cl_mem_flags itk::OpenCLMemoryObject::GetFlags |
( |
| ) |
const |
Returns the access flags that were used to create this memory object.
◆ GetHostPointer()
void * itk::OpenCLMemoryObject::GetHostPointer |
( |
| ) |
const |
Return the host pointer argument value specified when memory object is created. Otherwise a NULL value is returned.
◆ GetMapCount()
cl_uint itk::OpenCLMemoryObject::GetMapCount |
( |
| ) |
const |
Returns map count. The map count returned should be considered immediately stale. It is unsuitable for general use in applications. This feature is provided for debugging.
◆ GetMapFlags()
Helper function to get cl_map_flags from access.
◆ GetMemoryId()
cl_mem itk::OpenCLMemoryObject::GetMemoryId |
( |
| ) |
const |
|
inline |
◆ GetMemoryType()
cl_mem_object_type itk::OpenCLMemoryObject::GetMemoryType |
( |
| ) |
const |
Returns the memory object type used to create this object.
◆ GetReferenceCount()
cl_uint itk::OpenCLMemoryObject::GetReferenceCount |
( |
| ) |
const |
Returns memory object reference count. The reference count returned should be considered immediately stale. It is unsuitable for general use in applications. This feature is provided for identifying memory leaks.
◆ GetSize()
std::vcl_size_t itk::OpenCLMemoryObject::GetSize |
( |
| ) |
const |
Returns actual size of the data store associated with memory object in bytes.
◆ IsNull()
bool itk::OpenCLMemoryObject::IsNull |
( |
| ) |
const |
|
inline |
◆ operator=()
const Self & itk::OpenCLMemoryObject::operator= |
( |
const Self & | | ) |
|
|
privatedelete |
◆ SetDestructorCallback()
cl_int itk::OpenCLMemoryObject::SetDestructorCallback |
( |
void(CL_CALLBACK *pfn_notify)(cl_mem, void *) | , |
|
|
void * | user_data = nullptr ) |
Registers a user callback function with a memory object. Each call to
{clSetMemObjectDestructorCallback} registers the specified user callback function on a callback stack associated with memobj. The registered user callback functions are called in the reverse order in which they were registered. The user callback functions are called and then the memory objects resources are freed and the memory object is deleted. This provides a mechanism for the application (and libraries) using memobj to be notified when the memory referenced by host_ptr, specified when the memory object is created and used as the storage bits for the memory object, can be reused or freed.
◆ SetId()
void itk::OpenCLMemoryObject::SetId |
( |
OpenCLContext * | context, |
|
|
const cl_mem | id ) |
|
protected |
Helper function to pass cl_mem id.
◆ Unmap()
void itk::OpenCLMemoryObject::Unmap |
( |
void * | ptr, |
|
|
const bool | wait = false ) |
Requests a command to unmap a previously mapped region at ptr of a memory object. This function will wait until the request has finished if the wait is true. The request is executed on the active command queue for context.
- See also
- UnmapAsync(), OpenCLBuffer::Map()
◆ UnmapAsync()
Requests a command to unmap a previously mapped region at ptr of a memory object. The request will be started after all events in event_list are finished. Returns an event object that can be used to wait for the request to finish. The request is executed on the active command queue for context().
- See also
- Unmap(), OpenCLBuffer::MapAsync()
◆ m_Context
◆ m_Id
cl_mem itk::OpenCLMemoryObject::m_Id |
|
private |