diff options
author | Pan Xiuli <xiuli.pan@intel.com> | 2015-12-02 16:57:39 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2015-12-10 16:00:25 +0800 |
commit | ebe4161e2abd70bb0b6e69bd6d5909b083e60239 (patch) | |
tree | 0b5b7c4a597cb8071ee90b1376134b93087f7e04 /kernels | |
parent | 16b0d62bb01fcc229aa92bc55a0a1c783a8043d5 (diff) |
Utest: Add test for get_global/local_linear_id
Add two utest case test for OCL2.0 new work-item built-in
functions.
Signed-off-by: Pan Xiuli <xiuli.pan@intel.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
Diffstat (limited to 'kernels')
-rw-r--r-- | kernels/builtin_global_linear_id.cl | 4 | ||||
-rw-r--r-- | kernels/builtin_local_linear_id.cl | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/kernels/builtin_global_linear_id.cl b/kernels/builtin_global_linear_id.cl new file mode 100644 index 00000000..6810ffd6 --- /dev/null +++ b/kernels/builtin_global_linear_id.cl @@ -0,0 +1,4 @@ +kernel void builtin_global_linear_id( __global int *ret) { + int id = get_global_linear_id(); + ret[id] = id; +} diff --git a/kernels/builtin_local_linear_id.cl b/kernels/builtin_local_linear_id.cl new file mode 100644 index 00000000..0ddcc734 --- /dev/null +++ b/kernels/builtin_local_linear_id.cl @@ -0,0 +1,6 @@ +kernel void builtin_local_linear_id( __global int *ret) { + int id = get_local_linear_id() + (get_group_id(0) + \ + get_group_id(1) * 2 + get_group_id(2) * 6) * \ + get_local_size(0) * get_local_size(1) * get_local_size(2); + ret[id] = id; +} |