From: Alexey Bader Date: Fri, 26 Jan 2018 11:48:46 +0000 (+0000) Subject: [OpenCL] Add "cles_khr_int64" extension. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f7c3d6634a1e67481fa327717c32c16efad1465a;p=clang [OpenCL] Add "cles_khr_int64" extension. 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 --- diff --git a/include/clang/Basic/OpenCLExtensions.def b/include/clang/Basic/OpenCLExtensions.def index c3319d2d80..13cb12e7c5 100644 --- a/include/clang/Basic/OpenCLExtensions.def +++ b/include/clang/Basic/OpenCLExtensions.def @@ -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) diff --git a/test/SemaOpenCL/extension-version.cl b/test/SemaOpenCL/extension-version.cl index e560276046..714e4c2108 100644 --- a/test/SemaOpenCL/extension-version.cl +++ b/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@+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"