summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunyan He <junyan.he@linux.intel.com>2014-06-20 17:41:31 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-06-23 11:00:55 +0800
commitfcb3b6f12dbd28c97b2dbed0610cbe44650cb082 (patch)
tree6b993d027ce585d5efbc529a870c1a3a542bc363
parent3e6df8e6bfc2a4ac7303f46efd7a71de1afaccbf (diff)
Update the printf test case.
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
-rw-r--r--kernels/test_printf.cl19
1 files changed, 19 insertions, 0 deletions
diff --git a/kernels/test_printf.cl b/kernels/test_printf.cl
index 3f4c98d..c21ee98 100644
--- a/kernels/test_printf.cl
+++ b/kernels/test_printf.cl
@@ -4,10 +4,29 @@ test_printf(void)
int x = (int)get_global_id(0);
int y = (int)get_global_id(1);
int z = (int)get_global_id(2);
+ uint a = 'x';
+ float f = 5.0f;
+
+ if (x == 0 && y == 0 && z == 0) {
+ printf("--- Welcome to the printf test of %s ---\n", "Intel Beignet");
+
+ printf("### output a char is %c\n", a);
+ }
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));
+
+ if (x == 1)
+ if (y == 0) {
+ if (z % 2 == 0)
+ printf("#### output a float is %f\n", f);
+ else
+ printf("#### output a float to int is %d\n", f);
+ }
+ if (x == 0 && y == 0 && z == 0) {
+ printf("--- End to the printf test ---\n");
+ }
}