]> granicus.if.org Git - clang/commitdiff
[OpenCL] Add "cles_khr_int64" extension.
authorAlexey Bader <alexey.bader@intel.com>
Fri, 26 Jan 2018 11:48:46 +0000 (11:48 +0000)
committerAlexey Bader <alexey.bader@intel.com>
Fri, 26 Jan 2018 11:48:46 +0000 (11:48 +0000)
Summary:
For OpenCL 1.1 embedded profile 64 bit integers i.e. long,
ulong including the appropriate vector data types and operations
on 64-bit integers are optional. The "cles_khr_int64" extension
string will be reported if the embedded profile implementation
supports 64-bit integers.

Reviewers: Anastasia, bader

Reviewed By: Anastasia, bader

Subscribers: bader, yaxunl, Anastasia, cfe-commits

Differential Revision: https://reviews.llvm.org/D42532

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323522 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/OpenCLExtensions.def
test/SemaOpenCL/extension-version.cl

index c3319d2d808b99e85c61d4b2e658b981a22da04c..13cb12e7c581122cd948ea0e2c967308933f1c08 100644 (file)
@@ -53,6 +53,9 @@ OPENCLEXT_INTERNAL(cl_khr_icd, 100, ~0U)
 OPENCLEXT_INTERNAL(cl_khr_gl_event, 110, ~0U)
 OPENCLEXT_INTERNAL(cl_khr_d3d10_sharing, 110, ~0U)
 
+// EMBEDDED_PROFILE
+OPENCLEXT_INTERNAL(cles_khr_int64, 110, ~0U)
+
 // OpenCL 1.2.
 OPENCLEXT_INTERNAL(cl_khr_context_abort, 120, ~0U)
 OPENCLEXT_INTERNAL(cl_khr_d3d11_sharing, 120, ~0U)
index e560276046513e0d50f592d813971d6e52342327..714e4c21086168d1b5340ac038e30785e6a90f05 100644 (file)
 #endif
 #pragma OPENCL EXTENSION cl_khr_d3d10_sharing: enable
 
+#if (__OPENCL_C_VERSION__ >= 110)
+#ifndef cles_khr_int64
+#error "Missing cles_khr_int64 define"
+#endif
+#else
+// expected-warning@+2{{unsupported OpenCL extension 'cles_khr_int64' - ignoring}}
+#endif
+#pragma OPENCL EXTENSION cles_khr_int64: enable
+
 #if (__OPENCL_C_VERSION__ >= 120)
 #ifndef cl_khr_context_abort
 #error "Missing cl_context_abort define"