From 4d20a39d1c4dc243cb98e8dade7659a74cd950de Mon Sep 17 00:00:00 2001 From: Ruiling Song Date: Tue, 3 Sep 2013 15:39:56 +0800 Subject: [PATCH] utest: memset the output buffer to fix random fail. the inactive lanes will not modify corresponding output. So, output buffer needs initialization to 0. Signed-off-by: Ruiling Song Reviewed-by: Zhigang Gong --- utests/compiler_group_size.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utests/compiler_group_size.cpp b/utests/compiler_group_size.cpp index 724d6e8..0c8881c 100644 --- a/utests/compiler_group_size.cpp +++ b/utests/compiler_group_size.cpp @@ -107,6 +107,10 @@ void compiler_group_size4(void) ((struct xyz*)buf_data[0])[0].o = 0; OCL_UNMAP_BUFFER(0); + OCL_MAP_BUFFER(1); + memset(((uint32_t*)buf_data[1]), 0x0, sizeof(uint32_t)*n); + OCL_UNMAP_BUFFER(1); + OCL_SET_ARG(0, sizeof(cl_mem), &buf[0]); OCL_SET_ARG(1, sizeof(cl_mem), &buf[1]); OCL_SET_ARG(2, sizeof(cl_int), &group_size[i]); @@ -127,7 +131,6 @@ void compiler_group_size4(void) } } - memset(((uint32_t*)buf_data[1]), 0x0, sizeof(int)*n); OCL_UNMAP_BUFFER(1); } } -- 2.7.4