10 #ifndef INCLUDE_OPENCL_H_
11 #define INCLUDE_OPENCL_H_
14 #include <OpenCL/cl.h>
24 #define STR_HELPER(x) #x
25 #define STR(x) STR_HELPER(x)
27 #define MAX_KERNEL_SOURCE_LENGTH 100000
28 #define MAX_KERNEL_CONSTANTS_LENGTH 1000
35 #define ERROR_NO_PLATFORMS -1
36 #define ERROR_INVALID_PLATFORMS -2
37 #define ERROR_NO_DEVICES -3
38 #define ERROR_INVALID_DEVICE -4
53 cl_platform_id *platform,
54 cl_uint device_number,
57 cl_command_queue *command_queue,
91 cl_uint device_number,
117 char *kernel_constants,
118 char *kernel_filename,
119 const char *kernel_name);
130 unsigned long *size);
long device_mem_bytes
Definition: opencl.h:31
void readfile(char *filename, char **text, unsigned long *size)
Definition: opencl.c:363
cl_kernel make_kernel_from_file(cl_context context, cl_device_id device, char *kernel_constants, char *kernel_filename, const char *kernel_name)
Definition: opencl.c:300
long device_max_alloc_bytes
Definition: opencl.h:32
void check_cl_error(cl_int err, const char *file, int line)
Definition: opencl.c:280
void init_opencl(cl_uint platform_number, cl_platform_id *platform, cl_uint device_number, cl_device_id *device, cl_context *context, cl_command_queue *command_queue, int verbose)
Definition: opencl.c:24
int get_device_infos(cl_uint platform_number, cl_uint device_number, DEVICE_INFOS *device_infos)
Definition: opencl.c:199
void init_command_queue(cl_command_queue *command_queue, cl_device_id *device, cl_context *context)
Definition: opencl.c:148
void print_build_information(cl_program program, cl_device_id device)
Definition: opencl.c:166