Skip to content

Commit 669683a

Browse files
authored
clang/AMDGPU: Add missing __opencl_c_read_write_images feature macro (llvm#170307)
This is a partial fix for the rocm device-libs build. This was most likely broken by 423bdb2
1 parent 4ff3d1c commit 669683a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

clang/lib/Basic/Targets/AMDGPU.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,10 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUTargetInfo final : public TargetInfo {
316316
Opts["cl_amd_media_ops"] = true;
317317
Opts["cl_amd_media_ops2"] = true;
318318

319+
// FIXME: Check subtarget for image support.
319320
Opts["__opencl_c_images"] = true;
320321
Opts["__opencl_c_3d_image_writes"] = true;
322+
Opts["__opencl_c_read_write_images"] = true;
321323
Opts["cl_khr_3d_image_writes"] = true;
322324
Opts["__opencl_c_program_scope_global_variables"] = true;
323325
Opts["__opencl_c_atomic_order_seq_cst"] = true;

clang/test/Misc/amdgcn.languageOptsOpenCL.cl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@
162162
#ifndef __opencl_c_program_scope_global_variables
163163
#error "Missing __opencl_c_program_scope_global_variables define"
164164
#endif
165+
166+
#ifndef __opencl_c_read_write_images
167+
#error "Missing __opencl_c_read_write_images define"
168+
#endif
165169
#endif
166170

167171
#if (__OPENCL_C_VERSION__ >= 300)

0 commit comments

Comments
 (0)