From 830d3c32d00669f7eec5d80a083b3a0a88b39d11 Mon Sep 17 00:00:00 2001 From: Luo Xionghu Date: Thu, 21 Apr 2016 18:50:40 +0800 Subject: fix failed cases for stand alone utest; 1. use clEnqueueMapBuffer/Image instead of clEnqueueReadBuffer/Image; 2. add sanity check for clEnqueueMapImage; v2: disable OpenCL 2.0 specific builtin cases for stand alone utest. v3: don't hide failed cases. fix utest build warnings. Signed-off-by: Luo Xionghu Reviewed-by: Yang Rong --- utests/builtin_num_groups.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'utests/builtin_num_groups.cpp') diff --git a/utests/builtin_num_groups.cpp b/utests/builtin_num_groups.cpp index bbff4353..832766e9 100644 --- a/utests/builtin_num_groups.cpp +++ b/utests/builtin_num_groups.cpp @@ -62,13 +62,8 @@ static void builtin_num_groups(void) // Run the kernel OCL_NDRANGE( dim ); - err = clEnqueueReadBuffer( queue, buf[0], CL_TRUE, 0, sizeof(int), &num_groups, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - printf("Error: Failed to read output array! %d\n", err); - exit(1); - } - + OCL_MAP_BUFFER(0); + num_groups = ((int*)buf_data[0])[0]; #if udebug printf("get_num_groups(%d) = %d (dimension:%d)\n", dim_arg_global, num_groups, dim); #endif @@ -78,6 +73,7 @@ static void builtin_num_groups(void) { OCL_ASSERT( num_groups == 1); } + OCL_UNMAP_BUFFER(0); } } } -- cgit v1.2.1