summaryrefslogtreecommitdiff
path: root/utests/compiler_fill_image0.cpp
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@linux.intel.com>2013-05-16 10:58:51 +0800
committerZhigang Gong <zhigang.gong@linux.intel.com>2013-05-17 15:19:00 +0800
commitfce9f3eb89eeee3fba2296cad936fac582b1dc9f (patch)
treef133b093015da084cb173bfc9d7adafe7417e4cd /utests/compiler_fill_image0.cpp
parent2d33298c289fc7194b2770c751b50e079178ee0e (diff)
downloadbeignet-fce9f3eb89eeee3fba2296cad936fac582b1dc9f.tar.gz
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 <zhigang.gong@linux.intel.com> Tested-by: Simon Richter <Simon.Richter@hogyros.de>
Diffstat (limited to 'utests/compiler_fill_image0.cpp')
-rw-r--r--utests/compiler_fill_image0.cpp7
1 files changed, 3 insertions, 4 deletions
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);