utests: fix the image desc initilization for get_image_info.
authorJunyan He <junyan.he@linux.intel.com>
Fri, 13 Jun 2014 07:08:10 +0000 (15:08 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Fri, 13 Jun 2014 08:58:40 +0000 (16:58 +0800)
As now the clCreateImage implements more check, we need to
set more elements to pass all the argument check.

Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
utests/get_cl_info.cpp

index 4148ce9..0e87e28 100644 (file)
@@ -502,9 +502,21 @@ void get_image_info(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;
-  OCL_CREATE_IMAGE2D(buf[0], 0, &format, w, h, 0, NULL);
+  desc.image_type = CL_MEM_OBJECT_IMAGE2D;
+  desc.image_width = w;
+  desc.image_height = h;
+  desc.image_row_pitch = 0;
+  desc.image_row_pitch = 0;
+  desc.image_slice_pitch = 0;
+  desc.num_mip_levels = 0;
+  desc.num_samples = 0;
+  desc.buffer = NULL;
+
+  OCL_CREATE_IMAGE(buf[0], 0, &format, &desc, NULL);
   cl_mem image = buf[0];
 
   cl_image_format ret_format;