Image Component Library (ICL)
|
The CLDeviceContext class allows preparation of the device used for CLPrograms. More...
#include <CLDeviceContext.h>
Public Member Functions | |
CLDeviceContext () | |
CLDeviceContext Creates a dummy CLDeviceContext. More... | |
CLDeviceContext (std::string const &device) | |
CLDeviceContext Creates a CLDeviceContext on the given device type. More... | |
CLDeviceContext (const CLDeviceContext &other) | |
CLDeviceContext Creates a shallow copy of the given CLDeviceContext. More... | |
CLDeviceContext const & | operator= (CLDeviceContext const &other) |
operator = shallowly copies from other CLDeviceContext More... | |
~CLDeviceContext () | |
~CLDeviceContext Destructor More... | |
CLBuffer | createBuffer (const string &accessMode, size_t size, const void *src=0) |
createBuffer creates a buffer object for memory exchange with graphics card memory More... | |
CLBuffer | createBuffer (const string &accessMode, size_t length, size_t byteDepth, const void *src=0) |
createBuffer createBuffer creates a buffer object for memory exchange with graphics card memory More... | |
CLImage2D | createImage2D (const string &accessMode, const size_t width, const size_t height, int depth, const void *src=0) |
createImage2D Creates a image2D object for memory exchange with graphics card memory More... | |
CLImage2D | createImage2D (const string &accessMode, const size_t width, const size_t height, int depth, int num_channel, const void *src=0) |
createImage2D More... | |
std::string const | getDeviceTypeString () |
getDeviceTypeString Returns the device type as string More... | |
std::string const | getDeviceTypeString () const |
getDeviceTypeString Returns the device type as string (const) More... | |
void | listSelectedPlatform () |
lists various properties of the selected platform More... | |
void | listSelectedDevice () |
lists various properties of the selected device More... | |
Static Public Member Functions | |
static void | listAllPlatformsAndDevices () |
lists various properties of all platforms and their devices More... | |
static void | listAllPlatforms () |
lists various properties of all platforms More... | |
Private Member Functions | |
cl::Device & | getDevice () |
returns the internal cl device structure More... | |
cl::CommandQueue & | getCommandQueue () |
returns the internal cl command queue structure More... | |
cl::Context & | getContext () |
returns the internal cl context structure More... | |
CLBuffer * | createBufferHeap (const string &accessMode, size_t length, size_t byteDepth, const void *src=0) |
createBufferHeap creates a buffer object pointer for memory exchange with graphics card memory. The pointer has to be handles by the user More... | |
CLImage2D * | createImage2DHeap (const string &accessMode, const size_t width, const size_t height, int depth, int num_channel, const void *src=0) |
createImage2DHeap Creates a image2D object pointer for memory exchange with graphics card memory. The pointer has to be handles by the user More... | |
Private Attributes | |
Impl * | impl |
Friends | |
class | CLProgram |
for tight integration with CLProgram instances More... | |
class | CLMemoryAssistant |
for tight integration with CLMemoryAssistant instances More... | |
The CLDeviceContext class allows preparation of the device used for CLPrograms.
The CLDeviceContext class is a wrapper for the opencl c++ device, command queue and context classes. This class is used in CLProgram to instanciate a device and allocate memory. It also is used in CLMemoryAssistant to manage the buffer and image allocation. A CLDeviceContext can be shared over different CLPrograms to allow memory exchanges, e.g. for processing pipelines
icl::utils::CLDeviceContext::CLDeviceContext | ( | ) |
CLDeviceContext Creates a dummy CLDeviceContext.
icl::utils::CLDeviceContext::CLDeviceContext | ( | std::string const & | device | ) |
CLDeviceContext Creates a CLDeviceContext on the given device type.
device | type of device as string. Current supported device types: "gpu","cpu". |
icl::utils::CLDeviceContext::CLDeviceContext | ( | const CLDeviceContext & | other | ) |
CLDeviceContext Creates a shallow copy of the given CLDeviceContext.
other | another CLDeviceContext to copy from |
icl::utils::CLDeviceContext::~CLDeviceContext | ( | ) |
~CLDeviceContext Destructor
CLBuffer icl::utils::CLDeviceContext::createBuffer | ( | const string & | accessMode, |
size_t | size, | ||
const void * | src = 0 |
||
) |
createBuffer creates a buffer object for memory exchange with graphics card memory
accessMode | can either be "r", "w" or "rw", which refers to the readibility of the data by the OpenCL source code |
size | Fixed size for this buffer in bytes |
src | Optional source pointer. If not NULL the content of this pointer will automatically be uploaded to the device. |
Throws a CLBufferException in case of allocation problems.
CLBuffer icl::utils::CLDeviceContext::createBuffer | ( | const string & | accessMode, |
size_t | length, | ||
size_t | byteDepth, | ||
const void * | src = 0 |
||
) |
createBuffer createBuffer creates a buffer object for memory exchange with graphics card memory
accessMode | accessMode can either be "r", "w" or "rw", which refers to the readibility of the data by the OpenCL source code |
length | Fixed length of the buffer (in original type size e.g. float,int, ..., etc.) |
byteDepth | Byte depth of the data type (e.g. float = 4, int32 = 4, uchar = 1 ... etc.) |
src | Optional source pointer. If not NULL the content of this pointer will automatically be uploaded to the device. |
|
private |
createBufferHeap creates a buffer object pointer for memory exchange with graphics card memory. The pointer has to be handles by the user
accessMode | accessMode can either be "r", "w" or "rw", which refers to the readibility of the data by the OpenCL source code |
length | Fixed length of the buffer (in original type size e.g. float,int, ..., etc.) |
byteDepth | Byte depth of the data type (e.g. float = 4, int32 = 4, uchar = 1 ... etc.) |
src | Optional source pointer. If not NULL the content of this pointer will automatically be uploaded to the device. |
Throws a CLBufferException in case of allocation problems.
CLImage2D icl::utils::CLDeviceContext::createImage2D | ( | const string & | accessMode, |
const size_t | width, | ||
const size_t | height, | ||
int | depth, | ||
const void * | src = 0 |
||
) |
createImage2D Creates a image2D object for memory exchange with graphics card memory
accessMode | accessMode accessMode can either be "r", "w" or "rw", which refers to the readibility of the data by the OpenCL source code |
width | The width of the image passed |
height | The height of the image passed |
depth | various image depths can be used depth8u = 0, < 8Bit unsigned integer values range {0,1,...255} depth16s = 1, < 16Bit signed integer values depth32s = 2, < 32Bit signed integer values depth32f = 3, < 32Bit floating point values depth64f = 4, < 64Bit floating point values (WARNING! float64 is not always supported by opencl and thus is not handled in ICL so far) |
src | Optional source pointer. If not NULL the content of this pointer will automatically be uploaded to the device. |
In this case, the number of channels are assumed to be equal to one.
Throws a CLBufferException in case of allocation problems.
CLImage2D icl::utils::CLDeviceContext::createImage2D | ( | const string & | accessMode, |
const size_t | width, | ||
const size_t | height, | ||
int | depth, | ||
int | num_channel, | ||
const void * | src = 0 |
||
) |
createImage2D
accessMode | |
width | |
height | |
depth | various image depths can be used depth8u = 0, < 8Bit unsigned integer values range {0,1,...255} depth16s = 1, < 16Bit signed integer values depth32s = 2, < 32Bit signed integer values depth32f = 3, < 32Bit floating point values depth64f = 4, < 64Bit floating point values (WARNING! float64 is not always supported by opencl and thus is not handled in ICL so far) |
num_channel | The number of image channels |
src | Optional source pointer. If not NULL the content of this pointer will automatically be uploaded to the device. |
Throws a CLBufferException in case of allocation problems.
|
private |
createImage2DHeap Creates a image2D object pointer for memory exchange with graphics card memory. The pointer has to be handles by the user
accessMode | accessMode accessMode can either be "r", "w" or "rw", which refers to the readibility of the data by the OpenCL source code |
width | The width of the image passed |
height | The height of the image passed |
depth | various image depths can be used depth8u = 0, < 8Bit unsigned integer values range {0,1,...255} depth16s = 1, < 16Bit signed integer values depth32s = 2, < 32Bit signed integer values depth32f = 3, < 32Bit floating point values depth64f = 4, < 64Bit floating point values (WARNING! float64 is not always supported by opencl and thus is not handled in ICL so far) |
num_channel | The number of image channels |
src | Optional source pointer. If not NULL the content of this pointer will automatically be uploaded to the device. |
Throws a CLBufferException in case of allocation problems.
|
private |
returns the internal cl command queue structure
|
private |
returns the internal cl context structure
|
private |
returns the internal cl device structure
std::string const icl::utils::CLDeviceContext::getDeviceTypeString | ( | ) |
getDeviceTypeString Returns the device type as string
std::string const icl::utils::CLDeviceContext::getDeviceTypeString | ( | ) | const |
getDeviceTypeString Returns the device type as string (const)
|
static |
lists various properties of all platforms
|
static |
lists various properties of all platforms and their devices
void icl::utils::CLDeviceContext::listSelectedDevice | ( | ) |
lists various properties of the selected device
void icl::utils::CLDeviceContext::listSelectedPlatform | ( | ) |
lists various properties of the selected platform
CLDeviceContext const& icl::utils::CLDeviceContext::operator= | ( | CLDeviceContext const & | other | ) |
|
friend |
for tight integration with CLMemoryAssistant instances
|
private |