[clang] 669683a - clang/AMDGPU: Add missing __opencl_c_read_write_images feature macro (#170307)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 2 08:46:20 PST 2025
Author: Matt Arsenault
Date: 2025-12-02T16:46:16Z
New Revision: 669683a036bf256e9cfba21bd2b70bafbf03be45
URL: https://github.com/llvm/llvm-project/commit/669683a036bf256e9cfba21bd2b70bafbf03be45
DIFF: https://github.com/llvm/llvm-project/commit/669683a036bf256e9cfba21bd2b70bafbf03be45.diff
LOG: clang/AMDGPU: Add missing __opencl_c_read_write_images feature macro (#170307)
This is a partial fix for the rocm device-libs build. This
was most likely broken by 423bdb2bf257e19271d62e60b6339d84b8ce05aa
Added:
Modified:
clang/lib/Basic/Targets/AMDGPU.h
clang/test/Misc/amdgcn.languageOptsOpenCL.cl
Removed:
################################################################################
diff --git a/clang/lib/Basic/Targets/AMDGPU.h b/clang/lib/Basic/Targets/AMDGPU.h
index a51d8d2375cfe..1d8f27ab915e2 100644
--- a/clang/lib/Basic/Targets/AMDGPU.h
+++ b/clang/lib/Basic/Targets/AMDGPU.h
@@ -316,8 +316,10 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUTargetInfo final : public TargetInfo {
Opts["cl_amd_media_ops"] = true;
Opts["cl_amd_media_ops2"] = true;
+ // FIXME: Check subtarget for image support.
Opts["__opencl_c_images"] = true;
Opts["__opencl_c_3d_image_writes"] = true;
+ Opts["__opencl_c_read_write_images"] = true;
Opts["cl_khr_3d_image_writes"] = true;
Opts["__opencl_c_program_scope_global_variables"] = true;
Opts["__opencl_c_atomic_order_seq_cst"] = true;
diff --git a/clang/test/Misc/amdgcn.languageOptsOpenCL.cl b/clang/test/Misc/amdgcn.languageOptsOpenCL.cl
index 80c0825895c86..57ea891b3eb29 100644
--- a/clang/test/Misc/amdgcn.languageOptsOpenCL.cl
+++ b/clang/test/Misc/amdgcn.languageOptsOpenCL.cl
@@ -162,6 +162,10 @@
#ifndef __opencl_c_program_scope_global_variables
#error "Missing __opencl_c_program_scope_global_variables define"
#endif
+
+ #ifndef __opencl_c_read_write_images
+ #error "Missing __opencl_c_read_write_images define"
+ #endif
#endif
#if (__OPENCL_C_VERSION__ >= 300)
More information about the cfe-commits
mailing list