CLUtils  0.2.1
 Hosted by GitHub
Classes | Functions
clutils Namespace Reference

It brings together functionality common to all OpenCL projects. More...

Classes

class  CLEnv
 Sets up an OpenCL environment. More...
 
class  CLEnvInfo
 Facilitates the conveyance of CLEnv arguments. More...
 
class  CPUTimer
 A class for measuring execution times. More...
 
class  GPUTimer
 A class for profiling CL devices. More...
 
class  ProfilingInfo
 A class that collects and manipulates timing information about a test. More...
 

Functions

const char * getOpenCLErrorCodeString (int errorCode)
 Returns the name of an error code. More...
 
bool checkCLGLInterop (cl::Device &device)
 Checks the availability of the "GL Sharing" capability. More...
 
void readSource (const std::vector< std::string > &kernel_filenames, std::vector< std::string > &sourceCodes)
 Reads in the contents from the requested files. More...
 
void split (const std::string &str, char delim, std::vector< std::string > &names)
 Splits a string on the requested delimiter. More...
 
std::pair< const char *, size_t > make_kernel_pair (const std::string &kernel_filename)
 Creates a pair of a char array (source code) and its size. More...
 

Detailed Description

It brings together functionality common to all OpenCL projects.

It offers structures that aim to ease the process of setting up and maintaining an OpenCL environment.

Function Documentation

bool clutils::checkCLGLInterop ( cl::Device &  device)

Checks the availability of the "GL Sharing" capability.

Parameters
[in]devicea device for which to check the "GL Sharing" capability.
Returns
Returns true if "GL Sharing" is available, false otherwise.
const char * clutils::getOpenCLErrorCodeString ( int  errorCode)

Returns the name of an error code.

Gets an error code and returns its name.

Parameters
[in]errorCodean error code.
Returns
Its name as a char array.
std::pair< const char *, size_t > clutils::make_kernel_pair ( const std::string &  sourceCode)

Creates a pair of a char array (source code) and its size.

An operator to be used for producing the pairs required by a cl::Program::Sources object.

Parameters
[in]sourceCodethe source code of a kernel (.cl) file.
Returns
A pair of the source code and its size.
void clutils::readSource ( const std::vector< std::string > &  kernel_filenames,
std::vector< std::string > &  sourceCodes 
)

Reads in the contents from the requested files.

Parameters
[in]kernel_filenamesa vector of strings with the names of the kernel files (.cl).
[out]sourceCodesa vector of strings with the contents of the files.
void clutils::split ( const std::string &  str,
char  delim,
std::vector< std::string > &  names 
)

Splits a string on the requested delimiter.

Parameters
[in]strstring containing the tokens.
[in]delimdelimiter on which to split the string.
[out]namesa vector of all the tokens.