scott.linder added a comment. https://www.khronos.org/registry/OpenCL/sdk/2.0/docs/man/xhtml/preprocessorDirectives.html describes `__OPENCL_VERSION__` as "an integer reflecting the version number of the OpenCL supported by the OpenCL device." as contrasted with `__OPENCL_C_VERSION__` which is described as "an integer reflecting the OpenCL C version specified by the -cl-std build option to clBuildProgram or clCompileProgram. If the -cl-std build option is not specified, the OpenCL C version supported by the compiler for this OpenCL device will be used."
But I don't see where the correct use of these is defined? How should the user decide which to use? It does seem like `__OPENCL_VERSION__` and `__OPENCL_C_VERSION__` can differ, e.g. if you compile for a device supporting 2.0 with `-cl-std=1.2`, but why would `__OPENCL_VERSION__` ever be referenced then? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77923/new/ https://reviews.llvm.org/D77923 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits