summaryrefslogtreecommitdiff
path: root/kernels
diff options
context:
space:
mode:
authorJunyan He <junyan.he@linux.intel.com>2016-01-28 12:20:06 +0800
committerYang Rong <rong.r.yang@intel.com>2016-04-22 17:24:17 +0800
commit2d79819d40490c840d8b078100ae98510e3bc4f9 (patch)
tree3f56a9c85a9ae2943fe6ab9b4139c1c75966d6be /kernels
parent391fb2715263faeb30354927bc006e0e8c4d3607 (diff)
Add several printf utest cases.
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Yan Wang <yan.wang@linux.intel.com> Reviewed-by: Junyan He <junyan.he@linux.intel.com>
Diffstat (limited to 'kernels')
-rw-r--r--kernels/test_printf.cl46
1 files changed, 46 insertions, 0 deletions
diff --git a/kernels/test_printf.cl b/kernels/test_printf.cl
index 0a59e88f..a2d3af97 100644
--- a/kernels/test_printf.cl
+++ b/kernels/test_printf.cl
@@ -44,3 +44,49 @@ test_printf(void)
printf("--- End to the printf test ---\n");
}
}
+
+__kernel void
+test_printf_1(void)
+{
+ printf("");// just test null printf
+}
+
+__kernel void
+test_printf_2(void)
+{
+ printf("float %f\n", 2.0);// just test a uniform const
+ printf("long %lx\n", 0xABCD1234CCCCDDDD);
+}
+
+__kernel void
+test_printf_3(char arg)
+{
+ printf("@@ arg from func arg is %c\n", arg);
+}
+
+__kernel void
+test_printf_4(void)
+{
+ int a = get_global_size(0);
+ int b = get_local_size(0);
+ int c = a + 1;
+ int d = b + 2;
+ int e = b * 2;
+ int f = c + 1;
+ int g = d + 2;
+ int h = e * 2;
+ int i = a + 1;
+ int j = c / 2;
+ int k = a * 2;
+ int l = c + 1;
+ int m = f + 2;
+ int n = g * 2;
+ int o = e * 2;
+ int p = a + 1;
+ int q = c / 2;
+ int r = a * 2;
+ int s = c + 1;
+ int t = f + 2;
+ printf("@@ Long result is %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n",
+ a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t);
+}