Image Component Library (ICL)
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
icl::utils::CLBuffer Class Reference

Wrapper for an OpenCL Buffer. More...

#include <CLBuffer.h>

Inheritance diagram for icl::utils::CLBuffer:
icl::utils::CLMemory

Public Member Functions

 CLBuffer ()
 default constructor (creates null instance) More...
 
 CLBuffer (const CLBuffer &other)
 copy constructor (always performs shallow copy) More...
 
CLBufferoperator= (const CLBuffer &other)
 assignment operator (always performs a shallow copy) More...
 
 ~CLBuffer ()
 destructor More...
 
void copy (CLBuffer &dst, int len, int src_offset=0, int dst_offset=0) throw (CLBufferException)
 copies the content of this buffer into the given buffer More...
 
void read (void *dst, int len, int offset=0, bool block=true) throw (CLBufferException)
 reads buffer from graphics memory into given destination pointer More...
 
void write (const void *src, int len, int offset=0, bool block=true) throw (CLBufferException)
 writes source data into the graphics memory More...
 
bool isNull () const
 checks whether buffer is null More...
 
 operator bool () const
 checks whether buffer is not null More...
 
- Public Member Functions inherited from icl::utils::CLMemory
 CLMemory (CLMemory const &other)
 CLMemory default copy constructor. More...
 
CLMemoryoperator= (CLMemory const &other)
 operator = default assignment operator More...
 
virtual ~CLMemory ()
 Destructor. More...
 
CLBufferasCLBuffer () throw (CLBufferException)
 asCLBuffer Casting function to cast to CLBuffer pointer (reinterpret_cast) More...
 
CLImage2DasCLImage2D () throw (CLBufferException)
 asCLImage2D Casting function to cast to CLImage2D pointer (reinterpret_cast) More...
 
const std::vector< icl32sgetDimensions () const
 returns the dimensions (3Dim-std::vector for x,y,z dimensions) More...
 
const icl64s getSize () const
 returns total size of the memory (x*y*z) More...
 
const icl32s getByteDepth () const
 returns the bytedepth of the used data type (e.g. float32 = 4byte) More...
 

Private Member Functions

 CLBuffer (cl::Context &context, cl::CommandQueue &cmdQueue, const string &accessMode, size_t size, const void *src=NULL) throw (CLBufferException)
 private constructor (buffer can only be created by CLProgram instances) More...
 
 CLBuffer (cl::Context &context, cl::CommandQueue &cmdQueue, const string &accessMode, size_t length, size_t byte_depth, const void *src=NULL) throw (CLBufferException)
 
cl::Buffer & getBuffer ()
 provides access to the underlying cl-buffer More...
 
const cl::Buffer & getBuffer () const
 

Private Attributes

Impl * impl
 internal hidden implementation type More...
 

Friends

class CLProgram
 for tight integration with CLProgram instances More...
 
class CLKernel
 for tight integration with CLKernel instances More...
 
class CLDeviceContext
 for tight integration with CLDeviceContext instances More...
 

Additional Inherited Members

- Public Types inherited from icl::utils::CLMemory
enum  MemoryType { Buffer, Image2D, Invalid }
 Memorys type available. More...
 
typedef SmartPtr< CLMemoryPtr
 smart pointer to this class type More...
 
- Protected Member Functions inherited from icl::utils::CLMemory
 CLMemory (MemoryType const type=Invalid)
 CLMemory Default constructor. Only inherit classes can use this constructor. More...
 
void setDimensions (icl32s const &x, icl32s const &y, icl32s const &z)
 sets the dimensions x,y,z and total size More...
 
- Protected Attributes inherited from icl::utils::CLMemory
std::vector< icl32sm_dimensions
 size of each dimension x,y,z More...
 
icl64s m_size
 size in total x*y*z More...
 
icl32s m_byte_depth
 byte depth of the data type used (e.g. float32 = 4byte) More...
 

Detailed Description

Wrapper for an OpenCL Buffer.

Valid CLBuffer instances can only be created by a CLProgram instance.

See also
CLProgram for more details

Constructor & Destructor Documentation

icl::utils::CLBuffer::CLBuffer ( cl::Context &  context,
cl::CommandQueue &  cmdQueue,
const string &  accessMode,
size_t  size,
const void *  src = NULL 
)
throw (CLBufferException
)
private

private constructor (buffer can only be created by CLProgram instances)

icl::utils::CLBuffer::CLBuffer ( cl::Context &  context,
cl::CommandQueue &  cmdQueue,
const string &  accessMode,
size_t  length,
size_t  byte_depth,
const void *  src = NULL 
)
throw (CLBufferException
)
private
icl::utils::CLBuffer::CLBuffer ( )

default constructor (creates null instance)

icl::utils::CLBuffer::CLBuffer ( const CLBuffer other)

copy constructor (always performs shallow copy)

icl::utils::CLBuffer::~CLBuffer ( )

destructor

Member Function Documentation

void icl::utils::CLBuffer::copy ( CLBuffer dst,
int  len,
int  src_offset = 0,
int  dst_offset = 0 
)
throw (CLBufferException
)

copies the content of this buffer into the given buffer

cl::Buffer& icl::utils::CLBuffer::getBuffer ( )
private

provides access to the underlying cl-buffer

const cl::Buffer& icl::utils::CLBuffer::getBuffer ( ) const
private
bool icl::utils::CLBuffer::isNull ( ) const
inline

checks whether buffer is null

icl::utils::CLBuffer::operator bool ( ) const
inline

checks whether buffer is not null

CLBuffer& icl::utils::CLBuffer::operator= ( const CLBuffer other)

assignment operator (always performs a shallow copy)

void icl::utils::CLBuffer::read ( void *  dst,
int  len,
int  offset = 0,
bool  block = true 
)
throw (CLBufferException
)

reads buffer from graphics memory into given destination pointer

void icl::utils::CLBuffer::write ( const void *  src,
int  len,
int  offset = 0,
bool  block = true 
)
throw (CLBufferException
)

writes source data into the graphics memory

Friends And Related Function Documentation

friend class CLDeviceContext
friend

for tight integration with CLDeviceContext instances

friend class CLKernel
friend

for tight integration with CLKernel instances

friend class CLProgram
friend

for tight integration with CLProgram instances

Member Data Documentation

Impl* icl::utils::CLBuffer::impl
private

internal hidden implementation type

internal implemetation


The documentation for this class was generated from the following file: