r277181 - [OpenCL] Add extension cl_khr_mipmap_image to clang
Yaxun Liu via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 29 10:52:34 PDT 2016
Author: yaxunl
Date: Fri Jul 29 12:52:34 2016
New Revision: 277181
URL: http://llvm.org/viewvc/llvm-project?rev=277181&view=rev
Log:
[OpenCL] Add extension cl_khr_mipmap_image to clang
Adding extension cl_khr_mipmap_image to clang's OpenCL Extensions and initiated inside AMDGPU Target.
Patch by Aaron En Ye Shi.
Differential Revision: https://reviews.llvm.org/D22637
Modified:
cfe/trunk/include/clang/Basic/OpenCLExtensions.def
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/test/Misc/amdgcn.languageOptsOpenCL.cl
cfe/trunk/test/SemaOpenCL/extension-version.cl
Modified: cfe/trunk/include/clang/Basic/OpenCLExtensions.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/OpenCLExtensions.def?rev=277181&r1=277180&r2=277181&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/OpenCLExtensions.def (original)
+++ cfe/trunk/include/clang/Basic/OpenCLExtensions.def Fri Jul 29 12:52:34 2016
@@ -67,6 +67,7 @@ OPENCLEXT_INTERNAL(cl_khr_spir, 120, ~0U
// 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)
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=277181&r1=277180&r2=277181&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Fri Jul 29 12:52:34 2016
@@ -2126,6 +2126,7 @@ public:
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;
}
}
Modified: cfe/trunk/test/Misc/amdgcn.languageOptsOpenCL.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/amdgcn.languageOptsOpenCL.cl?rev=277181&r1=277180&r2=277181&view=diff
==============================================================================
--- cfe/trunk/test/Misc/amdgcn.languageOptsOpenCL.cl (original)
+++ cfe/trunk/test/Misc/amdgcn.languageOptsOpenCL.cl Fri Jul 29 12:52:34 2016
@@ -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)
+#ifndef cl_khr_mipmap_image
+#error "Missing cl_khr_mipmap_image define"
+#endif
+#else
+#ifdef cl_khr_mipmap_image
+#error "Incorrect cl_khr_mipmap_image define"
+#endif
+// expected-warning at +2{{unsupported OpenCL extension 'cl_khr_mipmap_image' - ignoring}}
+#endif
+#pragma OPENCL EXTENSION cl_khr_mipmap_image: enable
+
#ifdef cl_khr_srgb_image_writes
#error "Incorrect cl_khr_srgb_image_writes define"
#endif
Modified: cfe/trunk/test/SemaOpenCL/extension-version.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaOpenCL/extension-version.cl?rev=277181&r1=277180&r2=277181&view=diff
==============================================================================
--- cfe/trunk/test/SemaOpenCL/extension-version.cl (original)
+++ cfe/trunk/test/SemaOpenCL/extension-version.cl Fri Jul 29 12:52:34 2016
@@ -222,6 +222,18 @@
#pragma OPENCL EXTENSION cl_khr_egl_image: enable
#if (__OPENCL_C_VERSION__ >= 200)
+#ifndef cl_khr_mipmap_image
+#error "Missing cl_khr_mipmap_image define"
+#endif
+#else
+#ifdef cl_khr_mipmap_image
+#error "Incorrect cl_khr_mipmap_image define"
+#endif
+// expected-warning at +2{{unsupported OpenCL extension 'cl_khr_mipmap_image' - ignoring}}
+#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"
#endif
More information about the cfe-commits
mailing list