diff options
author | Ruiling Song <ruiling.song@intel.com> | 2013-09-03 15:39:56 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@linux.intel.com> | 2013-09-03 16:16:50 +0800 |
commit | 4d20a39d1c4dc243cb98e8dade7659a74cd950de (patch) | |
tree | f766693f4c01132dea22f0481bb9bbdcb3009f48 /utests/compiler_group_size.cpp | |
parent | 09e43cc77aabd955d4e999da39ca3e18016f051f (diff) | |
download | beignet-4d20a39d1c4dc243cb98e8dade7659a74cd950de.tar.gz |
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 <ruiling.song@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'utests/compiler_group_size.cpp')
-rw-r--r-- | utests/compiler_group_size.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/utests/compiler_group_size.cpp b/utests/compiler_group_size.cpp index 724d6e8b..0c8881c5 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); } } |