[clang] [OpenCL] Add missing OpenCL 3.0 features to OpenCLExtensions.def; revert header-only macros (PR #168016)

Changpeng Fang via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 9 12:16:43 PST 2025


changpeng wrote:

> > Hi, @wenju-he : After this patch, we are seeing a lot of OpenCL 2.0 conformance test failures due to undeclared functions/ __opencl_c_read_write_images is not being defined (was defined in opencl-c-base.h). Is there anything missing in the patch, or we are supposed to use alternative to define it? Thanks. cc: @arsenm
> 
> Didn't [9fd288e](https://github.com/llvm/llvm-project/commit/9fd288e8866788d9defccccfcc75272eb27f54fe) and [669683a](https://github.com/llvm/llvm-project/commit/669683a036bf256e9cfba21bd2b70bafbf03be45) fix it?


Did't check yet. But are we supposed to fix in this way? 
For example all the following definitions are removed, should we define them in clang/lib/Basic/Targets/AMDGPU.h?:
 // Define feature macros for OpenCL C 2.0
#if (__OPENCL_CPP_VERSION__ == 100 || __OPENCL_C_VERSION__ == 200)
#define __opencl_c_pipes 1
#define __opencl_c_generic_address_space 1
#define __opencl_c_work_group_collective_functions 1
#define __opencl_c_atomic_order_acq_rel 1
#define __opencl_c_atomic_order_seq_cst 1
#define __opencl_c_atomic_scope_device 1
#define __opencl_c_atomic_scope_all_devices 1
#define __opencl_c_device_enqueue 1
#define __opencl_c_read_write_images 1
#define __opencl_c_program_scope_global_variables 1
#define __opencl_c_images 1
#endif

https://github.com/llvm/llvm-project/pull/168016


More information about the cfe-commits mailing list