Defines | Functions | Variables
opencl_utils.cpp File Reference
#include <opencl_utils.h>
#include <fstream>
#include <vector>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <stdarg.h>
#include <stdlib.h>
Include dependency graph for opencl_utils.cpp:

Go to the source code of this file.

Defines

#define HDASHLINE   "-----------------------------------------------------------\n"

Functions

const char * oclErrorString (cl_int error)
char * oclFindFilePath (const char *filename, const char *executable_path)
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 ()
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)

Variables

cl_context g_clDeviceContext
cl_command_queue g_clDeviceQueue

Define Documentation

#define HDASHLINE   "-----------------------------------------------------------\n"

Definition at line 3 of file opencl_utils.cpp.


Function Documentation

const char* oclErrorString ( cl_int  error)

Definition at line 346 of file opencl_utils.cpp.

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

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:
cxGPUContextthe 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:
clSelectedPlatformIDOpenCL 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:
cpProgramOpenCL program
cdDevicedevice of interest
binaryreturned code
lengthlength 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.

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:
cFilenameprogram filename
cPreamblecode that is prepended to the loaded file, typically a set of #defines or a header
szFinalLengthreturned 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:
cpProgramOpenCL program
cdDevicedevice 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:
cpProgramOpenCL program
cdDevicedevice of interest
constchar* 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:
clContextthe context to release
clQueuethe command queue to release

Definition at line 140 of file opencl_utils.cpp.


Variable Documentation

cl_context g_clDeviceContext

Definition at line 13 of file opencl_utils.cpp.

cl_command_queue g_clDeviceQueue

Definition at line 14 of file opencl_utils.cpp.



parallel_quickstep
Author(s): Jared Duke
autogenerated on Fri Jan 3 2014 11:36:56