[libclc] r309358 - add __kernel_exec macros

Jan Vesely via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 27 20:39:03 PDT 2017


Author: jvesely
Date: Thu Jul 27 20:39:03 2017
New Revision: 309358

URL: http://llvm.org/viewvc/llvm-project?rev=309358&view=rev
Log:
add __kernel_exec macros

also consolidate macros into one file, and rename to clcmacros.h

Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
Reviewed-by: Aaron Watry <awatry at gmail.com>

Added:
    libclc/trunk/generic/include/clc/clcmacros.h
Removed:
    libclc/trunk/generic/include/clc/clcversion.h
Modified:
    libclc/trunk/generic/include/clc/clc.h
    libclc/trunk/generic/include/clc/clctypes.h

Modified: libclc/trunk/generic/include/clc/clc.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/clc.h?rev=309358&r1=309357&r2=309358&view=diff
==============================================================================
--- libclc/trunk/generic/include/clc/clc.h (original)
+++ libclc/trunk/generic/include/clc/clc.h Thu Jul 27 20:39:03 2017
@@ -21,7 +21,7 @@
 #include <clc/as_type.h>
 
 /* 6.9 Preprocessor Directives and Macros */
-#include <clc/clcversion.h>
+#include <clc/clcmacros.h>
 
 /* 6.11.1 Work-Item Functions */
 #include <clc/workitem/get_global_size.h>

Added: libclc/trunk/generic/include/clc/clcmacros.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/clcmacros.h?rev=309358&view=auto
==============================================================================
--- libclc/trunk/generic/include/clc/clcmacros.h (added)
+++ libclc/trunk/generic/include/clc/clcmacros.h Thu Jul 27 20:39:03 2017
@@ -0,0 +1,18 @@
+/* 6.9 Preprocessor Directives and Macros
+ * Some of these are handled by clang or passed by clover */
+#if __OPENCL_VERSION__ >= 110
+#define CLC_VERSION_1_0 100
+#define CLC_VERSION_1_1 110
+#endif
+
+#if __OPENCL_VERSION__ >= 120
+#define CLC_VERSION_1_2 120
+#endif
+
+#define NULL ((void*)NULL)
+
+#define __kernel_exec(X, typen) __kernel \
+                                __attribute__((work_group_size_hint(X, 1, 1))) \
+                                __attribute__((vec_type_hint(typen)))
+
+#define kernel_exec(X, typen) __kernel_exec(X, typen)

Modified: libclc/trunk/generic/include/clc/clctypes.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/clctypes.h?rev=309358&r1=309357&r2=309358&view=diff
==============================================================================
--- libclc/trunk/generic/include/clc/clctypes.h (original)
+++ libclc/trunk/generic/include/clc/clctypes.h Thu Jul 27 20:39:03 2017
@@ -85,5 +85,3 @@ typedef __attribute__((ext_vector_type(4
 typedef __attribute__((ext_vector_type(8))) double double8;
 typedef __attribute__((ext_vector_type(16))) double double16;
 #endif
-
-#define NULL ((void *)0)

Removed: libclc/trunk/generic/include/clc/clcversion.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/clcversion.h?rev=309357&view=auto
==============================================================================
--- libclc/trunk/generic/include/clc/clcversion.h (original)
+++ libclc/trunk/generic/include/clc/clcversion.h (removed)
@@ -1,8 +0,0 @@
-#if __OPENCL_VERSION__ >= 110
-#define CLC_VERSION_1_0 100
-#define CLC_VERSION_1_1 110
-#endif
-
-#if __OPENCL_VERSION__ >= 120
-#define CLC_VERSION_1_2 120
-#endif




More information about the cfe-commits mailing list