#include <opencl_utils.h>
#include <fstream>
#include <vector>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <stdarg.h>
#include <stdlib.h>
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 HDASHLINE "-----------------------------------------------------------\n" |
Definition at line 3 of file opencl_utils.cpp.
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
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
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
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.
char* oclLoadProgSource | ( | const char * | cFilename, |
const char * | cPreamble, | ||
size_t * | szFinalLength | ||
) |
Loads a Program file and prepends the cPreamble to the code.
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
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
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
clContext | the context to release |
clQueue | the command queue to release |
Definition at line 140 of file opencl_utils.cpp.
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.