PIP 5.6.1
Platform-Independent Primitives
Public Member Functions | List of all members
PIOpenCL::Buffer Class Reference

OpenCL buffer wrapper optionally bound to a host container. More...

#include <piopencl.h>

Public Member Functions

 ~Buffer ()
 Destroys the buffer object.
 
void * handle ()
 Returns the native OpenCL memory handle.
 
bool resize (uint new_elements)
 Resizes the buffer to another element count.
 
void clear ()
 Fills the whole buffer with the default element value.
 
void copyToContainer ()
 Copies device data back to the bound host container.
 
void copyTo (void *data)
 Copies the whole buffer to raw host memory.
 
void copyTo (void *data, int elements_count, int elements_offset=0)
 Copies a subrange of the buffer to raw host memory.
 
void copyTo (Buffer *buffer, int elements_count=-1, int elements_from_offset=0, int elements_to_offset=0)
 Copies data from this buffer to another buffer.
 
void copyFromContainer ()
 Uploads data from the bound host container.
 
void copyFrom (void *data)
 Copies the whole raw host memory block into the buffer.
 
void copyFrom (void *data, int elements_count, int elements_offset=0)
 Copies a subrange from raw host memory into the buffer.
 
void copyFrom (Buffer *buffer, int elements_count=-1, int elements_from_offset=0, int elements_to_offset=0)
 Copies data from another buffer into this buffer.
 
uint elementsCount () const
 Returns the number of logical elements in the buffer.
 

Detailed Description

OpenCL buffer wrapper optionally bound to a host container.