[PATCH] D42532: [OpenCL] Add "cles_khr_int64" extension.

Mariya Podchishchaeva via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 25 05:52:41 PST 2018


Fznamznon created this revision.
Herald added subscribers: cfe-commits, Anastasia, yaxunl.

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.


Repository:
  rC Clang

https://reviews.llvm.org/D42532

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


Index: test/SemaOpenCL/extension-version.cl
===================================================================
--- test/SemaOpenCL/extension-version.cl
+++ test/SemaOpenCL/extension-version.cl
@@ -131,6 +131,15 @@
 #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 at +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"
Index: include/clang/Basic/OpenCLExtensions.def
===================================================================
--- include/clang/Basic/OpenCLExtensions.def
+++ include/clang/Basic/OpenCLExtensions.def
@@ -53,6 +53,9 @@
 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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42532.131424.patch
Type: text/x-patch
Size: 1158 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180125/06ca07d9/attachment.bin>


More information about the cfe-commits mailing list