[PATCH] D22637: [OpenCL] Add extension cl_khr_mipmap_image to clang

Aaron En Ye Shi via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 22 12:53:32 PDT 2016


ashi1 updated this revision to Diff 65126.
ashi1 marked an inline comment as done.
ashi1 added a comment.

Revised based on Sam's comments.


Repository:
  rL LLVM

https://reviews.llvm.org/D22637

Files:
  include/clang/Basic/OpenCLExtensions.def
  lib/Basic/Targets.cpp
  test/Misc/amdgcn.languageOptsOpenCL.cl
  test/SemaOpenCL/extension-version.cl

Index: test/SemaOpenCL/extension-version.cl
===================================================================
--- test/SemaOpenCL/extension-version.cl
+++ test/SemaOpenCL/extension-version.cl
@@ -221,6 +221,18 @@
 #endif
 #pragma OPENCL EXTENSION cl_khr_egl_image: enable
 
+#if (__OPENCL_C_VERSION__ < 200)
+#ifdef cl_khr_mipmap_image
+#error "Incorrect cl_khr_mipmap_image define"
+#endif
+// expected-warning at +6{{unsupported OpenCL extension 'cl_khr_mipmap_image' - ignoring}}
+#else
+#ifndef cl_khr_mipmap_image
+#error "Missing cl_khr_mipmap_image define"
+#endif
+#endif
+#pragma OPENCL EXTENSION cl_khr_mipmap_image: enable
+
 #if (__OPENCL_C_VERSION__ >= 200)
 #ifndef cl_khr_srgb_image_writes
 #error "Missing cl_khr_srgb_image_writes define"
Index: test/Misc/amdgcn.languageOptsOpenCL.cl
===================================================================
--- test/Misc/amdgcn.languageOptsOpenCL.cl
+++ test/Misc/amdgcn.languageOptsOpenCL.cl
@@ -181,6 +181,18 @@
 #pragma OPENCL EXTENSION cl_khr_egl_image: enable
 // expected-warning at -1{{unsupported OpenCL extension 'cl_khr_egl_image' - ignoring}}
 
+#if (__OPENCL_C_VERSION__ < 200)
+#ifdef cl_khr_mipmap_image
+#error "Incorrect cl_khr_mipmap_image define"
+#endif
+// expected-warning at +6{{unsupported OpenCL extension 'cl_khr_mipmap_image' - ignoring}}
+#else
+#ifndef cl_khr_mipmap_image
+#error "Missing cl_khr_mipmap_image define"
+#endif
+#endif
+#pragma OPENCL EXTENSION cl_khr_mipmap_image: enable
+
 #ifdef cl_khr_srgb_image_writes
 #error "Incorrect cl_khr_srgb_image_writes define"
 #endif
Index: lib/Basic/Targets.cpp
===================================================================
--- lib/Basic/Targets.cpp
+++ lib/Basic/Targets.cpp
@@ -2115,6 +2115,7 @@
       Opts.cl_khr_fp16 = 1;
       Opts.cl_khr_int64_base_atomics = 1;
       Opts.cl_khr_int64_extended_atomics = 1;
+      Opts.cl_khr_mipmap_image = 1;
       Opts.cl_khr_3d_image_writes = 1;
     }
   }
Index: include/clang/Basic/OpenCLExtensions.def
===================================================================
--- include/clang/Basic/OpenCLExtensions.def
+++ include/clang/Basic/OpenCLExtensions.def
@@ -67,6 +67,7 @@
 // OpenCL 2.0.
 OPENCLEXT_INTERNAL(cl_khr_egl_event, 200, ~0U)
 OPENCLEXT_INTERNAL(cl_khr_egl_image, 200, ~0U)
+OPENCLEXT_INTERNAL(cl_khr_mipmap_image, 200, ~0U)
 OPENCLEXT_INTERNAL(cl_khr_srgb_image_writes, 200, ~0U)
 OPENCLEXT_INTERNAL(cl_khr_subgroups, 200, ~0U)
 OPENCLEXT_INTERNAL(cl_khr_terminate_context, 200, ~0U)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22637.65126.patch
Type: text/x-patch
Size: 2492 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160722/f228d9ac/attachment.bin>


More information about the cfe-commits mailing list