Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes | Friends
icl::utils::CLBuffer Class Reference

Wrapper for an OpenCL Buffer. More...

#include <CLBuffer.h>

List of all members.

Public Member Functions

 CLBuffer ()
 default constructor (creates null instance)
 CLBuffer (const CLBuffer &other)
 copy constructor (always performs shallow copy)
CLBufferoperator= (const CLBuffer &other)
 assignment operator (always performs a shallow copy)
 ~CLBuffer ()
 destructor
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
void read (void *dst, int len, int offset=0, bool block=true) throw (CLBufferException)
 reads buffer from graphics memory into given destination pointer
void write (const void *src, int len, int offset=0, bool block=true) throw (CLBufferException)
 writes source data into the graphics memory
bool isNull () const
 checks whether buffer is null
 operator bool () const
 checks whether buffer is not null

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)
cl::Buffer & getBuffer ()
 provides access to the underlying cl-buffer
const cl::Buffer & getBuffer () const

Private Attributes

Impl * impl
 internal hidden implementation type

Friends

class CLProgram
 for tight integration with CLProgram instances
class CLKernel
 for tight integration with CLKernel instances

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)

default constructor (creates null instance)

copy constructor (always performs shallow copy)

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 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:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines