[libclc] r211787 - OpenCL 1.1 does not define CL_VERSION_1_2 so use hardcoded number instead

Jeroen Ketema j.ketema at imperial.ac.uk
Thu Jun 26 08:26:38 PDT 2014


Author: jketema
Date: Thu Jun 26 10:26:38 2014
New Revision: 211787

URL: http://llvm.org/viewvc/llvm-project?rev=211787&view=rev
Log:
OpenCL 1.1 does not define CL_VERSION_1_2 so use hardcoded number instead

Otherwise the test evaluates to true on OpenCL 1.1 and earlier. Since we
therefore cannot use the CL_VERSION_?_? macros move them to the proper
position in the top-level header.

Modified:
    libclc/trunk/generic/include/clc/clc.h
    libclc/trunk/generic/include/clc/float/definitions.h

Modified: libclc/trunk/generic/include/clc/clc.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/clc.h?rev=211787&r1=211786&r2=211787&view=diff
==============================================================================
--- libclc/trunk/generic/include/clc/clc.h (original)
+++ libclc/trunk/generic/include/clc/clc.h Thu Jun 26 10:26:38 2014
@@ -11,9 +11,6 @@
 /* Function Attributes */
 #include <clc/clcfunc.h>
 
-/* 6.9 Preprocessor Directives and Macros */
-#include <clc/clcversion.h>
-
 /* 6.1 Supported Data Types */
 #include <clc/clctypes.h>
 
@@ -23,6 +20,9 @@
 /* 6.2.4.2 Reinterpreting Types Using as_type() and as_typen() */
 #include <clc/as_type.h>
 
+/* 6.9 Preprocessor Directives and Macros */
+#include <clc/clcversion.h>
+
 /* 6.11.1 Work-Item Functions */
 #include <clc/workitem/get_global_size.h>
 #include <clc/workitem/get_global_id.h>

Modified: libclc/trunk/generic/include/clc/float/definitions.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/float/definitions.h?rev=211787&r1=211786&r2=211787&view=diff
==============================================================================
--- libclc/trunk/generic/include/clc/float/definitions.h (original)
+++ libclc/trunk/generic/include/clc/float/definitions.h Thu Jun 26 10:26:38 2014
@@ -49,7 +49,7 @@
 
 #ifdef cl_khr_fp16
 
-#if __OPENCL_VERSION__ >= CL_VERSION_1_2
+#if __OPENCL_VERSION__ >= 120
 
 #define HALF_DIG        3
 #define HALF_MANT_DIG   11





More information about the cfe-commits mailing list