summaryrefslogtreecommitdiff
path: root/kernels/test_printf.cl
diff options
context:
space:
mode:
authorJunyan He <junyan.he@linux.intel.com>2014-06-10 12:53:22 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-06-11 11:04:11 +0800
commite5d25dac46ab2f90d9fc66210f3bdc54e72445fe (patch)
tree1ee83b92a61ebdb6ae11153462b7f1a1194c7821 /kernels/test_printf.cl
parent97dec3e93f14d2431352b1501b57fe21cee3b719 (diff)
Add the utest case for printf
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'kernels/test_printf.cl')
-rw-r--r--kernels/test_printf.cl13
1 files changed, 13 insertions, 0 deletions
diff --git a/kernels/test_printf.cl b/kernels/test_printf.cl
new file mode 100644
index 00000000..3f4c98d1
--- /dev/null
+++ b/kernels/test_printf.cl
@@ -0,0 +1,13 @@
+__kernel void
+test_printf(void)
+{
+ int x = (int)get_global_id(0);
+ int y = (int)get_global_id(1);
+ int z = (int)get_global_id(2);
+
+ if (x % 15 == 0)
+ if (y % 3 == 0)
+ if (z % 7 == 0)
+ printf("######## global_id(x, y, z) = (%d, %d, %d), global_size(d0, d1, d3) = (%d, %d, %d)\n",
+ x, y, z, get_global_size(0), get_global_size(1), get_global_size(2));
+}