There is some incorrect result in nested for loops. The single
for loop and 1st nested for loops test get correct result, but
the 2nd nested for loops get incorrect result.

Signed-off-by: Chuanbo Weng <[email protected]>
---
 kernels/test_printf.cl | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/kernels/test_printf.cl b/kernels/test_printf.cl
index 84bb478..d8010d7 100644
--- a/kernels/test_printf.cl
+++ b/kernels/test_printf.cl
@@ -31,6 +31,24 @@ test_printf(void)
           printf("#### output a float to int is %d\n", f);
     }
 
+  for(int i = 0; i < 3; i++)
+    if(x == 0 && y == 0 && z == 0)
+      printf(">>>>>> Test printf in for loop: i = %d\n", i);
+
+  if(x == 0 && y == 0 && z == 0)
+         printf("1st nested loops test:\n");
+  for(int i = 0; i < 3; i++)
+    for(int j = 0; j < 4; j++)
+      if(x == 0 && y == 0 && z == 0)
+        printf(">>>>>> Test printf in nested loops: i = %d, j = %d\n", i, j);
+
+  if(x == 0 && y == 0 && z == 0)
+         printf("2nd nested loops test:\n");
+  for(int i = 0; i < 10; i++)
+    for(int j = 0; j < 5; j++)
+      if(x == 0 && y == 0 && z == 0)
+        printf(">>>>>> Test printf in nested loops: i = %d, j = %d\n", i, j);
+
   if (x == 0 && y == 0 && z == 0) {
     printf("--- End to the printf test ---\n");
   }
-- 
1.9.1

_______________________________________________
Beignet mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/beignet

Reply via email to