18 #ifndef __itkOpenCLMemoryObject_h 19 #define __itkOpenCLMemoryObject_h 49 m_Context( context ), m_Id( id ) {}
90 bool IsNull()
const {
return this->m_Id == 0; }
99 cl_mem_object_type GetMemoryType()
const;
102 cl_mem_flags GetFlags()
const;
105 std::size_t GetSize()
const;
109 void * GetHostPointer()
const;
114 cl_uint GetMapCount()
const;
119 cl_uint GetReferenceCount()
const;
128 void Unmap(
void * ptr,
const bool wait =
false );
147 cl_int SetDestructorCallback(
148 void( CL_CALLBACK * pfn_notify )( cl_mem,
void * ),
149 void * user_data = NULL );
165 const Self & operator=(
const Self & );
180 template<
typename charT,
typename traits >
182 std::basic_ostream< charT, traits > &
183 operator<<( 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: ";
205 switch( memoryObject.GetAccess() )
208 strm <<
"Read Write";
break;
210 strm <<
"Write Only";
break;
212 strm <<
"Read Only";
break;
214 strm <<
"Unknown";
break;
OpenCLContext * m_Context
OpenCLEventList class represents a list of OpenCLEvent objects.
Point< std::vcl_size_t, 2 > PointType
OpenCLMemoryObject(OpenCLContext *context, const cl_mem id)
The OpenCLContext class represents an OpenCL context.
OpenCLContext * GetContext() const
bool ITKOpenCL_EXPORT operator==(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
bool ITKOpenCL_EXPORT operator!=(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
OpenCLMemoryObject(OpenCLContext *context=0)
cl_mem GetMemoryId() const
The OpenCLMemoryObject class represents all common memory objects such as buffers and image objects...
OpenCLEvent class represents an OpenCL event object.