From fce9f3eb89eeee3fba2296cad936fac582b1dc9f Mon Sep 17 00:00:00 2001 From: Zhigang Gong Date: Thu, 16 May 2013 10:58:51 +0800 Subject: utests: Refine the fill image0 test case to use map gtt. Now we don't fill the whole image to a const color. we fill it according to the coords. Then we can use map gtt to get the result and verify the result easily on cpu side. Signed-off-by: Zhigang Gong Tested-by: Simon Richter --- utests/compiler_fill_image0.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'utests/compiler_fill_image0.cpp') diff --git a/utests/compiler_fill_image0.cpp b/utests/compiler_fill_image0.cpp index cf76be3f..7c8f40e8 100644 --- a/utests/compiler_fill_image0.cpp +++ b/utests/compiler_fill_image0.cpp @@ -14,7 +14,6 @@ static void compiler_fill_image0(void) desc.image_height = h; desc.image_row_pitch = 0; - // Setup kernel and images OCL_CREATE_KERNEL("test_fill_image0"); @@ -29,11 +28,11 @@ static void compiler_fill_image0(void) OCL_NDRANGE(2); // Check result - OCL_MAP_BUFFER(0); + OCL_MAP_BUFFER_GTT(0); for (uint32_t j = 0; j < h; ++j) for (uint32_t i = 0; i < w; i++) - OCL_ASSERT(((uint32_t*)buf_data[0])[j * w + i] == 0x78563412); - OCL_UNMAP_BUFFER(0); + OCL_ASSERT(((uint32_t*)buf_data[0])[j * w + i] == (i << 16 | j)); + OCL_UNMAP_BUFFER_GTT(0); } MAKE_UTEST_FROM_FUNCTION(compiler_fill_image0); -- cgit v1.2.1