We have tests that ensure a program can be compiled for all of the OpenCL C versions advertised by a device, see:
https://github.com/KhronosGroup/OpenCL-CTS/blob/main/test_conformance/compiler/test_opencl_c_versions.cpp
However, we never check that the __OPENCL_C_VERSION__ preprocessor macro is set properly when compiling for each OpenCL C version.
https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_C.html#preprocessor-directives-and-macros
In addition to checking that a program can be compiled for a specific OpenCL C version, we should also check that the preprocessor macro is set correctly, for example by executing the kernel, writing the value of the preprocessor macro to a buffer, and checking that the value written is correct.
We have tests that ensure a program can be compiled for all of the OpenCL C versions advertised by a device, see:
https://github.com/KhronosGroup/OpenCL-CTS/blob/main/test_conformance/compiler/test_opencl_c_versions.cpp
However, we never check that the
__OPENCL_C_VERSION__preprocessor macro is set properly when compiling for each OpenCL C version.https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_C.html#preprocessor-directives-and-macros
In addition to checking that a program can be compiled for a specific OpenCL C version, we should also check that the preprocessor macro is set correctly, for example by executing the kernel, writing the value of the preprocessor macro to a buffer, and checking that the value written is correct.