From 12f08a61b5933baf9ceb24609b95cb1cb85d88c8 Mon Sep 17 00:00:00 2001 From: Zhigang Gong Date: Thu, 21 Feb 2013 17:09:51 +0800 Subject: Use new OCL1.2 API rather than those deprecated API. Use clCreateImage to replace the old API clCreateImage2D. It will silent the compiler warnings. Signed-off-by: Zhigang Gong Reviewed-by: Homer Hsing --- utests/compiler_fill_image0.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'utests/compiler_fill_image0.cpp') diff --git a/utests/compiler_fill_image0.cpp b/utests/compiler_fill_image0.cpp index ed92432f..2fef90cf 100644 --- a/utests/compiler_fill_image0.cpp +++ b/utests/compiler_fill_image0.cpp @@ -5,14 +5,20 @@ static void compiler_fill_image0(void) const size_t w = 512; const size_t h = 512; cl_image_format format; + cl_image_desc desc; format.image_channel_order = CL_RGBA; format.image_channel_data_type = CL_UNSIGNED_INT8; + desc.image_type = CL_MEM_OBJECT_IMAGE2D; + desc.image_width = w; + desc.image_height = h; + desc.image_row_pitch = w * sizeof(uint32_t); + // Setup kernel and images OCL_CREATE_KERNEL("test_fill_image0"); - OCL_CREATE_IMAGE(buf[0], 0, &format, w, h, w * sizeof(uint32_t), NULL); + OCL_CREATE_IMAGE(buf[0], 0, &format, &desc, NULL); // Run the kernel OCL_SET_ARG(0, sizeof(cl_mem), &buf[0]); -- cgit v1.2.1