When specifying the include paths in the program build options, double quotes can't be used to escape special characters (for example spaces). It doesn't matter if the specified path is relative or absolute. Example snippet: cl_device_id dev; // some device cl_context context; // some context cl_program prog = clCreateProgramWithSource(context, 1, &src, &len, &err) const char* options = "-I\"/home/user/dir/\""; const char* src = "#include <a_file.cl>\n"; cl_int err = clBuildProgram(prog, 1, &dev, options, nullptr, nullptr); if(err != CL_SUCCESS) { size_t len = 0; clGetProgramBuildInfo(prog, dev, CL_PROGRAM_BUILD_LOG, 0, nullptr, &len); char* buf = new char[len]; clGetProgramBuildInfo(prog, dev, CL_PROGRAM_BUILD_LOG, len, log, nullptr); printf(log); } Assume the file "/home/user/dir/a_file.cl" exists and is a valid OpenCL C source file. For reference, this example builds and runs on AMD's APP SDK implementation and NVidia's implementation, while interestingly it does not build on Beignet and Intel's proprietary OpenCL SDK.
Just to clarify, the failure message is a failure to find <a_file.cl>, not anything to do with passing bad flags. Removing the quotes allows the program to build and run as expected, but means I can't have any directories with spaces in them, and is just an unnecessary incompatibility with other OpenCL implementations.
Hi Andrew, If you are using release_v1.1.1, there will be a problem. You can find something can fix the problem in patch below: https://cgit.freedesktop.org/beignet/commit/?h=Release_v1.1&id=8e9ef20 Thanks Xiuli
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/beignet/beignet/issues/71.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.