summaryrefslogtreecommitdiff
path: root/kernels
diff options
context:
space:
mode:
authorLuo Xionghu <xionghu.luo@intel.com>2015-01-28 11:49:51 +0800
committerZhigang Gong <zhigang.gong@intel.com>2015-01-28 12:44:58 +0800
commit600d23b04e8be609fa5dcdc6ffcc0e383799cd40 (patch)
tree521561c264e02b4aef492f4cf0946f7b2f7b87c4 /kernels
parentd0ade586e3cdbf2c8f1923872c93b3b6b07b897b (diff)
fix clz utest issue.
should use clz function instead of __builtin_clz. add zero input check. v2: add signed type test. remove redundant case. v3: remove printf. Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'kernels')
-rw-r--r--kernels/compiler_clz.cl8
-rw-r--r--kernels/compiler_clz_int.cl5
-rw-r--r--kernels/compiler_clz_short.cl5
3 files changed, 6 insertions, 12 deletions
diff --git a/kernels/compiler_clz.cl b/kernels/compiler_clz.cl
index 7ab62619..4b061785 100644
--- a/kernels/compiler_clz.cl
+++ b/kernels/compiler_clz.cl
@@ -3,10 +3,14 @@
{ \
__global TYPE* A = &src[get_global_id(0)]; \
__global TYPE* B = &dst[get_global_id(0)]; \
- *B = __builtin_clz(*A); \
+ *B = clz(*A); \
}
-COMPILER_CLZ(uint)
COMPILER_CLZ(ulong)
+COMPILER_CLZ(uint)
COMPILER_CLZ(ushort)
COMPILER_CLZ(uchar)
+COMPILER_CLZ(long)
+COMPILER_CLZ(int)
+COMPILER_CLZ(short)
+COMPILER_CLZ(char)
diff --git a/kernels/compiler_clz_int.cl b/kernels/compiler_clz_int.cl
deleted file mode 100644
index 0f17f865..00000000
--- a/kernels/compiler_clz_int.cl
+++ /dev/null
@@ -1,5 +0,0 @@
-kernel void compiler_clz_int(global int *src, global int *dst) {
- int i = get_global_id(0);
- dst[i] = clz(src[i]);
-}
-
diff --git a/kernels/compiler_clz_short.cl b/kernels/compiler_clz_short.cl
deleted file mode 100644
index 1ecf7a9b..00000000
--- a/kernels/compiler_clz_short.cl
+++ /dev/null
@@ -1,5 +0,0 @@
-kernel void compiler_clz_short(global short *src, global short *dst) {
- int i = get_global_id(0);
- dst[i] = clz(src[i]);
-}
-