diff --git a/src/common-opencl.c b/src/common-opencl.c index 44a124b..f18e583 100644 --- a/src/common-opencl.c +++ b/src/common-opencl.c @@ -84,6 +84,14 @@ HANDLE_CLERROR(ret_code, "Error creating command queue"); } +static char * include_source(char *pathname) +{ + char *include[PATH_BUFFER_SIZE]; + sprintf(include, "-I %s", path_expand(pathname)); + + return include; +} + static void build_kernel(int dev_id) { @@ -95,7 +103,8 @@ HANDLE_CLERROR(ret_code, "Error while creating program"); cl_int build_code; - build_code = clBuildProgram(program[dev_id], 0, NULL, "", NULL, NULL); + build_code = clBuildProgram(program[dev_id], 0, NULL, + include_source("$JOHN/"), NULL, NULL); HANDLE_CLERROR(clGetProgramBuildInfo(program[dev_id], devices[dev_id], CL_PROGRAM_BUILD_LOG, sizeof(opencl_log), (void *) opencl_log,