Update the printf test case.
authorJunyan He <junyan.he@linux.intel.com>
Fri, 20 Jun 2014 09:41:31 +0000 (17:41 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Mon, 23 Jun 2014 03:00:55 +0000 (11:00 +0800)
Signed-off-by: Junyan He <junyan.he@linux.intel.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
kernels/test_printf.cl

index 3f4c98d..c21ee98 100644 (file)
@@ -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");
+  }
 }