--- /dev/null
+__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));
+}
--- /dev/null
+#include "utest_helper.hpp"
+
+void test_printf(void)
+{
+ // Setup kernel and buffers
+ OCL_CREATE_KERNEL("test_printf");
+ globals[0] = 16;
+ locals[0] = 16;
+ globals[1] = 4;
+ locals[1] = 4;
+ globals[2] = 8;
+ locals[2] = 8;
+
+ // Run the kernel on GPU
+ OCL_NDRANGE(3);
+}
+
+MAKE_UTEST_FROM_FUNCTION(test_printf);