eyalroz / gpu-kernel-runner

Runs a single CUDA/OpenCL kernel, taking its source from a file and arguments from the command-line

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Avoid OpenCL headers warning about non-specification of target OpenCL version

eyalroz opened this issue · comments

When building with the OpenCL headers of recent CUDA versions (12.x ?), we get:

In file included from /usr/local/cuda/include/CL/opencl.h:24,
                 from /path/to/gpu-kernel-runner/third-party/khronos/cl2.hpp:170,
                 from /path/to/src/gpu-kernel-runner/src/opencl-related/types.hpp:8,
                 from /path/to/src/gpu-kernel-runner/src/launch_configuration.hpp:11,
                 from /path/to/src/gpu-kernel-runner/src/parsed_cmdline_options.hpp:6,
                 from /path/to/src/gpu-kernel-runner/src/kernel-runner.cpp:2:
/usr/local/cuda/include/CL/cl.h:26:104: note: #pragma message: cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 300 (OpenCL 3.0)
 #pragma message("cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 300 (OpenCL 3.0)")

This is not a runtime compilation - it's the compilation of the runner itself. So, let us choose OpenCL 3.0 for our own API.