opencl_utils.h File Reference

#include <CL/cl.h>
#include <fstream>
Include dependency graph for opencl_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define oclCheckError(a, b)   oclCheckErrorEX(a, b, 0)
#define oclCheckErrorEX(a, b, c)   __oclCheckErrorEX(a, b, c, __FILE__ , __LINE__)

Functions

void __oclCheckErrorEX (cl_int iSample, cl_int iReference, void(*pCleanup)(int), const char *cFile, const int iLine)
cl_context dxGetDeviceContext ()
cl_command_queue dxGetDeviceQueue ()
void dxGlobalSync ()
void dxInitDevice ()
void dxShutdownDevice ()
const char * oclErrorString (cl_int error)
char * oclFindFilePath (const char *filename, const char *executablePath)
cl_device_id oclGetFirstDev (cl_context cxGPUContext)
cl_context oclGetGlobalContext ()
cl_command_queue oclGetGlobalQueue ()
cl_int oclGetPlatformID (cl_platform_id *clSelectedPlatformID)
void oclGetProgBinary (cl_program cpProgram, cl_device_id cdDevice, char **binary, size_t *length)
void oclInit ()
void oclInitializeKernels (cl_context cxGPUContext, cl_command_queue cqCommandQueue)
char * oclLoadProgSource (const char *cFilename, const char *cPreamble, size_t *szFinalLength)
void oclLogBuildInfo (cl_program cpProgram, cl_device_id cdDevice)
void oclLogPtx (cl_program cpProgram, cl_device_id cdDevice, const char *cPtxFileName)
void oclShutdown (cl_context clContext, cl_command_queue clQueue)
void oclShutdownKernels (void)

Define Documentation

#define oclCheckError ( a,
 )     oclCheckErrorEX(a, b, 0)

Definition at line 11 of file opencl_utils.h.

#define oclCheckErrorEX ( a,
b,
 )     __oclCheckErrorEX(a, b, c, __FILE__ , __LINE__)

Definition at line 10 of file opencl_utils.h.


Function Documentation

void __oclCheckErrorEX ( cl_int  iSample,
cl_int  iReference,
void(*)(int)  pCleanup,
const char *  cFile,
const int  iLine 
) [inline]

Definition at line 34 of file opencl_utils.h.

cl_context dxGetDeviceContext (  )  [inline]

Definition at line 51 of file opencl_utils.h.

cl_command_queue dxGetDeviceQueue (  )  [inline]

Definition at line 52 of file opencl_utils.h.

void dxGlobalSync (  )  [inline]

Definition at line 54 of file opencl_utils.h.

void dxInitDevice (  )  [inline]

Definition at line 55 of file opencl_utils.h.

void dxShutdownDevice (  )  [inline]

Definition at line 56 of file opencl_utils.h.

const char* oclErrorString ( cl_int  error  ) 

Definition at line 346 of file opencl_utils.cpp.

char* oclFindFilePath ( const char *  filename,
const char *  executablePath 
)

Definition at line 421 of file opencl_utils.cpp.

cl_device_id oclGetFirstDev ( cl_context  cxGPUContext  ) 

Get the first device associated with the given context

Returns:
the first device id associated with the context
Parameters:
cxGPUContext the context with which the device is associated

Definition at line 96 of file opencl_utils.cpp.

cl_context oclGetGlobalContext (  ) 

Definition at line 16 of file opencl_utils.cpp.

cl_command_queue oclGetGlobalQueue (  ) 

Definition at line 20 of file opencl_utils.cpp.

cl_int oclGetPlatformID ( cl_platform_id *  clSelectedPlatformID  ) 

Gets the platform ID for NVIDIA if available, otherwise default

Returns:
the id
Parameters:
clSelectedPlatformID OpenCL platoform ID

Definition at line 30 of file opencl_utils.cpp.

void oclGetProgBinary ( cl_program  cpProgram,
cl_device_id  cdDevice,
char **  binary,
size_t *  length 
)

Get the binary (PTX) of the program associated with the device

Parameters:
cpProgram OpenCL program
cdDevice device of interest
binary returned code
length length of returned code

Definition at line 211 of file opencl_utils.cpp.

void oclInit (  ) 

Initializes the global context and command queue

Definition at line 116 of file opencl_utils.cpp.

void oclInitializeKernels ( cl_context  cxGPUContext,
cl_command_queue  cqCommandQueue 
)
char* oclLoadProgSource ( const char *  cFilename,
const char *  cPreamble,
size_t *  szFinalLength 
)

Loads a Program file and prepends the cPreamble to the code.

Returns:
the source string if succeeded, 0 otherwise
Parameters:
cFilename program filename
cPreamble code that is prepended to the loaded file, typically a set of defines or a header
szFinalLength returned length of the code string

Definition at line 155 of file opencl_utils.cpp.

void oclLogBuildInfo ( cl_program  cpProgram,
cl_device_id  cdDevice 
)

Get and log the binary (PTX) from the OpenCL compiler for the requested program & device

Parameters:
cpProgram OpenCL program
cdDevice device of interest

Definition at line 328 of file opencl_utils.cpp.

void oclLogPtx ( cl_program  cpProgram,
cl_device_id  cdDevice,
const char *  cPtxFileName 
)

Get and log the binary (PTX) from the OpenCL compiler for the requested program & device

Parameters:
cpProgram OpenCL program
cdDevice device of interest
const char* cPtxFileName optional PTX file name

Definition at line 259 of file opencl_utils.cpp.

void oclShutdown ( cl_context  clContext,
cl_command_queue  clQueue 
)

Releases the global context and command queue

Parameters:
clContext the context to release
clQueue the command queue to release

Definition at line 140 of file opencl_utils.cpp.

void oclShutdownKernels ( void   ) 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines


parallel_quickstep
Author(s): Jared Duke
autogenerated on Fri Jan 11 09:59:39 2013