12 #ifndef OPENCL_UTILS_H
13 #define OPENCL_UTILS_H
15 #if defined(__PW_FPGA)
17 extern void queue_cleanup();
18 extern void cleanup();
22 cl_platform_id findPlatform(
char *platform_name);
26 cl_device_id *getDevices(cl_platform_id pid, cl_device_type device_type,
27 cl_uint *num_devices);
30 cl_program getProgramWithBinary(cl_context context,
const cl_device_id *devices,
31 unsigned num_devices,
int N[3],
34 void openCLContextCallBackFxn(
const char *errinfo,
const void *private_info,
35 size_t cb,
void *user_data);
37 void *alignedMalloc(
size_t size);
39 void printError(cl_int error);
41 void _checkError(
const char *file,
int line,
const char *func, cl_int err,
42 const char *msg, ...);
44 #define checkError(status, ...) \
45 _checkError(__FILE__, __LINE__, __FUNCTION__, status, __VA_ARGS__)