oclkit is a small set of C functions, to avoid writing the same OpenCL boiler plate over and over again, yet keeping full control over executing OpenCL.
ocl_new
: Create a new OpenCL platform instance with all devices initialized. Each device is assigned its own queue. The returned pointer is opaque and should only be modified with the following functions.ocl_free
: Releases all resources except for programs created withocl_get_program
.ocl_get_context
: Return thecl_context
pointerocl_get_num_devices
: Return the number of detected devices.ocl_get_devices
: Return array of devices.ocl_get_cmd_queues
: Return array of command queues.ocl_get_program
: Create program from source file. Release withclReleaseProgram
.ocl_strerr
: Return static C string of an OpenCL error code.OCL_CHECK_ERROR
: Check error code and print a message onstderr
if error code is notCL_SUCCESS
.
Run make
in the top-level directory and change into build/examples
.
The code is licensed under GPL v3.