update isl to version 0.17.1
[ppcg.git] / ocl_utilities.h
blob34a987e9a9a77a272f1708264b43e71f3836da8d
1 #ifndef OCL_UTILITIES_H
2 #define OCL_UTILITIES_H
4 #if defined(__APPLE__)
5 #include <OpenCL/opencl.h>
6 #else
7 #include <CL/opencl.h>
8 #endif
10 /* Return the OpenCL error string for a given error number.
12 const char *opencl_error_string(cl_int error);
14 /* Find a GPU or a CPU associated with the first available platform.
15 * If use_gpu is set, then this function first tries to look for a GPU
16 * in the first available platform.
17 * If this fails or if use_gpu is not set, then it tries to use the CPU.
19 cl_device_id opencl_create_device(int use_gpu);
21 /* Create an OpenCL program from a string and compile it.
23 cl_program opencl_build_program_from_string(cl_context ctx, cl_device_id dev,
24 const char *program_source, size_t program_size,
25 const char *opencl_options);
27 /* Create an OpenCL program from a source file and compile it.
29 cl_program opencl_build_program_from_file(cl_context ctx, cl_device_id dev,
30 const char* filename, const char* opencl_options);
32 #endif