[Beignet] [PATCH 2/2] test 64bit-integer selection operator
Homer Hsing
homer.xing at intel.com
Wed Aug 7 00:01:05 PDT 2013
Signed-off-by: Homer Hsing <homer.xing at intel.com>
---
kernels/compiler_long_2.cl | 3 +++
utests/compiler_long_2.cpp | 2 ++
2 files changed, 5 insertions(+)
diff --git a/kernels/compiler_long_2.cl b/kernels/compiler_long_2.cl
index f559d93..92be93a 100644
--- a/kernels/compiler_long_2.cl
+++ b/kernels/compiler_long_2.cl
@@ -13,5 +13,8 @@ kernel void compiler_long_2(global long *src1, global long *src2, global long *d
case 3:
dst[i] = src1[i] ^ src2[i];
break;
+ case 4:
+ dst[i] = src1[i] ? 0x1122334455667788L : 0x8877665544332211UL;
+ break;
}
}
diff --git a/utests/compiler_long_2.cpp b/utests/compiler_long_2.cpp
index 012c2ab..353d74d 100644
--- a/utests/compiler_long_2.cpp
+++ b/utests/compiler_long_2.cpp
@@ -24,6 +24,7 @@ void compiler_long_2(void)
src1[i] = ((long)rand() << 32) + rand();
src2[i] = ((long)rand() << 32) + rand();
}
+ src1[4] = 1;
OCL_MAP_BUFFER(0);
OCL_MAP_BUFFER(1);
memcpy(buf_data[0], src1, sizeof(src1));
@@ -41,6 +42,7 @@ void compiler_long_2(void)
OCL_ASSERT((src1[1] & src2[1]) == dest[1]);
OCL_ASSERT((src1[2] | src2[2]) == dest[2]);
OCL_ASSERT((src1[3] ^ src2[3]) == dest[3]);
+ OCL_ASSERT(0x1122334455667788L == dest[4]);
OCL_UNMAP_BUFFER(2);
}
--
1.8.1.2
More information about the Beignet
mailing list