diff options
author | Ruiling Song <ruiling.song@intel.com> | 2013-08-22 16:52:05 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@linux.intel.com> | 2013-08-29 14:36:56 +0800 |
commit | 8c5a15a0e9ff70ef6a6f0a3933d14972b7f6234a (patch) | |
tree | 1632bd55bcd66f9813f8bd86ce69f9abf9f404b8 /kernels/compiler_group_size.cl | |
parent | 000d0870387a97a4985c5115e1663d328ce91d18 (diff) | |
download | beignet-8c5a15a0e9ff70ef6a6f0a3933d14972b7f6234a.tar.gz |
utests: Add a unit test for non-aligned group size.
To hit prediction logic.
Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'kernels/compiler_group_size.cl')
-rw-r--r-- | kernels/compiler_group_size.cl | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/kernels/compiler_group_size.cl b/kernels/compiler_group_size.cl index 9dba236d..0fe88c1a 100644 --- a/kernels/compiler_group_size.cl +++ b/kernels/compiler_group_size.cl @@ -10,3 +10,20 @@ compiler_group_size(__global unsigned int *dst) dst[idz*size_x*size_y + idy*size_x + idx] = idz*size_x*size_y + idy*size_x +idx; } +struct xyz{ + unsigned b:16; + unsigned e:16; + unsigned o; +}; + +__kernel void +compiler_group_size4(__global struct xyz *src, __global unsigned int *dst, unsigned int num, unsigned int c) +{ + uint idx = (uint)get_global_id(0); + if(idx>=num) + return; + struct xyz td = src[idx]; + for(unsigned x = td.b;x<=td.e;x++) + dst[td.o+x] = c; +} + |