add __kernel_exec macros

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

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 309358
This commit is contained in:
Jan Vesely 2017-07-28 03:39:03 +00:00
parent 843ab57457
commit 09f0a560e1
4 changed files with 19 additions and 11 deletions

View File

@ -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>

View File

@ -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)

View File

@ -85,5 +85,3 @@ typedef __attribute__((ext_vector_type(4))) double double4;
typedef __attribute__((ext_vector_type(8))) double double8;
typedef __attribute__((ext_vector_type(16))) double double16;
#endif
#define NULL ((void *)0)

View File

@ -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