[PATCH] D77910: AMDGPU: Define cl_khr_gl_sharing as a supported extension

Matt Arsenault via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 10 15:37:23 PDT 2020


arsenm created this revision.
arsenm added reviewers: yaxunl, Anastasia.
Herald added subscribers: danielkiss, kerbowa, kristof.beyls, t-tye, tpr, dstuttard, nhaehnle, wdng, jvesely, kzhuravl.

This doesn't seem to be that useful, since it doesn't change any
device side functions. Report it since it seems a macro should be
reported for every extension.

      

ROCm already reports this. Clover doesn't report it, but since this
isn't useful for device code, it probably isn't harmful to always
define the macro.


https://reviews.llvm.org/D77910

Files:
  clang/lib/Basic/Targets/AMDGPU.h
  clang/test/Misc/amdgcn.languageOptsOpenCL.cl


Index: clang/test/Misc/amdgcn.languageOptsOpenCL.cl
===================================================================
--- clang/test/Misc/amdgcn.languageOptsOpenCL.cl
+++ clang/test/Misc/amdgcn.languageOptsOpenCL.cl
@@ -29,11 +29,10 @@
 #endif
 #pragma OPENCL EXTENSION cl_khr_int64_extended_atomics: enable
 
-#ifdef cl_khr_gl_sharing
+#ifndef cl_khr_gl_sharing
 #error "Incorrect cl_khr_gl_sharing define"
 #endif
 #pragma OPENCL EXTENSION cl_khr_gl_sharing: enable
-// expected-warning at -1{{unsupported OpenCL extension 'cl_khr_gl_sharing' - ignoring}}
 
 #ifndef cl_khr_icd
 #error "Missing cl_khr_icd define"
Index: clang/lib/Basic/Targets/AMDGPU.h
===================================================================
--- clang/lib/Basic/Targets/AMDGPU.h
+++ clang/lib/Basic/Targets/AMDGPU.h
@@ -267,6 +267,7 @@
       Opts.support("cl_khr_mipmap_image_writes");
       Opts.support("cl_khr_subgroups");
       Opts.support("cl_khr_3d_image_writes");
+      Opts.support("cl_khr_gl_sharing");
       Opts.support("cl_amd_media_ops");
       Opts.support("cl_amd_media_ops2");
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77910.256685.patch
Type: text/x-patch
Size: 1088 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200410/735bce91/attachment.bin>


More information about the cfe-commits mailing list