diff options
author | Homer Hsing <homer.xing@intel.com> | 2012-11-20 09:51:03 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@linux.intel.com> | 2013-03-29 18:41:32 +0800 |
commit | 7f769fb1445af1f1f0dc04817bc93d724366e4d3 (patch) | |
tree | c59c692f9bc556c34d0605ecadfadb1fd1f626c9 /kernels/compiler_data_types.cl | |
parent | 9304765aecf492f533b5d62d756705654a882e8d (diff) | |
download | beignet-7f769fb1445af1f1f0dc04817bc93d724366e4d3.tar.gz |
Test case for OpenCL 1.1 supported data types
Diffstat (limited to 'kernels/compiler_data_types.cl')
-rw-r--r-- | kernels/compiler_data_types.cl | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/kernels/compiler_data_types.cl b/kernels/compiler_data_types.cl new file mode 100644 index 00000000..b23877d9 --- /dev/null +++ b/kernels/compiler_data_types.cl @@ -0,0 +1,49 @@ +/* OpenCL 1.1 Supported Data Types */ +__kernel void compiler_data_types() +{ + // built-in scalar data types (section 6.1.1) + bool b; + char c; + unsigned char uc; + uchar uc_2; + short s; + unsigned short us; + ushort us_2; + int i; + unsigned int ui; + uint ui_2; + long l; + unsigned long ul; + ulong ul_2; + float f; + half h; + size_t sz; + ptrdiff_t pt; + intptr_t it; + uintptr_t uit; + + // built-in vector data types (section 6.1.2) + // supported values of $n$ are 2, 3, 4, 8, 16 for all vector data types +#define VEC(sz) char##sz c##sz; \ + uchar##sz uc##sz; \ + short##sz s##sz; \ + ushort##sz us##sz;\ + int##sz i##sz; \ + uint##sz ui##sz; \ + long##sz l##sz; \ + ulong##sz ul##sz; \ + float##sz f##sz; +#if 0 + VEC(2); + VEC(3); + VEC(4); + VEC(8); + VEC(16); +#endif + + // Other built-in data types (section 6.1.3) + image2d_t i2dt; + image3d_t i3dt; + sampler_t st; + event_t et; +} |