[Piglit] [PATCH] CL: Basic test of bitselect builtin

Tom Stellard tom at stellard.net
Thu May 23 17:31:58 PDT 2013


From: Aaron Watry <awatry at gmail.com>

Tests all possible combinations of bitselect input/output bit values, but
only does so for scalar signed int.
---
 tests/cl/program/execute/bitselect.cl | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 tests/cl/program/execute/bitselect.cl

diff --git a/tests/cl/program/execute/bitselect.cl b/tests/cl/program/execute/bitselect.cl
new file mode 100644
index 0000000..c7fde4b
--- /dev/null
+++ b/tests/cl/program/execute/bitselect.cl
@@ -0,0 +1,23 @@
+/*!
+[config]
+dimensions: 1
+global_size: 1 0 0
+kernel_name: test_bitselect
+
+[test]
+# x = 01010101 
+# y = 01100110
+# z = 00111100
+#out= 01100101
+name: bitselect int1
+arg_out: 0 buffer int[1] 0x65 
+arg_in:  1 int 0x55
+arg_in:  2 int 0x66
+arg_in:  3 int 0x3c
+
+!*/
+
+kernel void test_bitselect(global int *out, int x, int y, int z)
+{
+	*out = bitselect(x,y,z);
+}
-- 
1.8.1.2



More information about the Piglit mailing list