18#ifndef __itkOpenCLMemoryObject_h
19#define __itkOpenCLMemoryObject_h
49 m_Context( context ), m_Id( id ) {}
90 bool IsNull()
const {
return this->m_Id == 0; }
128 void Unmap(
void * ptr,
const bool wait =
false );
148 void ( CL_CALLBACK * pfn_notify )( cl_mem,
void * ),
149 void * user_data =
nullptr );
180template<
typename charT,
typename traits >
182std::basic_ostream< charT, traits > &
183operator<<( std::basic_ostream< charT, traits > & strm,
186 if( memoryObject.
IsNull() )
188 strm <<
"OpenCLMemoryObject(null)";
192 const char indent =
' ';
194 strm <<
"OpenCLMemoryObject" << std::endl
195 << indent <<
"Id: " << memoryObject.
GetMemoryId() << std::endl
196 << indent <<
"Context: " << memoryObject.
GetContext() << std::endl
197 << indent <<
"Memory type: " << memoryObject.
GetMemoryType() << std::endl
198 << indent <<
"Flags: " << memoryObject.
GetFlags() << std::endl
199 << indent <<
"Size: " << memoryObject.
GetSize() << std::endl
200 << indent <<
"Map count: " << memoryObject.
GetMapCount() << std::endl
201 << indent <<
"Reference count: " << memoryObject.
GetReferenceCount() << std::endl
202 << indent <<
"Host pointer: " << memoryObject.
GetHostPointer() << std::endl
203 << indent <<
"Access: ";
208 strm <<
"Read Write";
break;
210 strm <<
"Write Only";
break;
212 strm <<
"Read Only";
break;
214 strm <<
"Unknown";
break;
The OpenCLContext class represents an OpenCL context.
OpenCLEventList class represents a list of OpenCLEvent objects.
OpenCLEvent class represents an OpenCL event object.
The OpenCLMemoryObject class represents all common memory objects such as buffers and image objects.
cl_int SetDestructorCallback(void(CL_CALLBACK *pfn_notify)(cl_mem, void *), void *user_data=nullptr)
cl_uint GetMapCount() const
void SetId(OpenCLContext *context, const cl_mem id)
cl_map_flags GetMapFlags(const OpenCLMemoryObject::Access access)
OpenCLContext * m_Context
OpenCLMemoryObject(OpenCLContext *context=0)
cl_mem_object_type GetMemoryType() const
OpenCLMemoryObject(OpenCLContext *context, const cl_mem id)
cl_mem_flags GetFlags() const
cl_uint GetReferenceCount() const
cl_mem GetMemoryId() const
OpenCLEvent UnmapAsync(void *ptr, const OpenCLEventList &event_list=OpenCLEventList())
const Self & operator=(const Self &)
OpenCLMemoryObject(const Self &other)
OpenCLContext * GetContext() const
Point< std::vcl_size_t, 2 > PointType
std::vcl_size_t GetSize() const
OpenCLMemoryObject::Access GetAccess() const
void * GetHostPointer() const
void Unmap(void *ptr, const bool wait=false)
bool ITKOpenCL_EXPORT operator==(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
bool ITKOpenCL_EXPORT operator!=(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &strm, const OpenCLCommandQueue &queue)