Change constant unit test to cover 4 byte data type.
authorRuiling Song <ruiling.song@intel.com>
Tue, 3 Sep 2013 07:42:37 +0000 (15:42 +0800)
committerZhigang Gong <zhigang.gong@linux.intel.com>
Wed, 4 Sep 2013 02:45:31 +0000 (10:45 +0800)
Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
kernels/compiler_function_constant0.cl
utests/compiler_function_constant0.cpp

index 363d84e..5340352 100644 (file)
@@ -1,5 +1,5 @@
 __kernel void
-compiler_function_constant0(__constant short *c0, __constant char *c1, __global int *dst, int value)
+compiler_function_constant0(__constant int *c0, __constant char *c1, __global int *dst, int value)
 {
   int id = (int)get_global_id(0);
   dst[id] = value + c0[id%69] + c1[0];
index c0a8a9d..6fbbd30 100644 (file)
@@ -7,7 +7,7 @@ void compiler_function_constant0(void)
 
   // Setup kernel and buffers
   OCL_CREATE_KERNEL("compiler_function_constant0");
-  OCL_CREATE_BUFFER(buf[0], 0, 75 * sizeof(short), NULL);
+  OCL_CREATE_BUFFER(buf[0], 0, 75 * sizeof(int32_t), NULL);
   OCL_CREATE_BUFFER(buf[1], 0, 1 * sizeof(char), NULL);
   OCL_CREATE_BUFFER(buf[2], 0, n * sizeof(uint32_t), NULL);
   OCL_SET_ARG(0, sizeof(cl_mem), &buf[0]);
@@ -17,7 +17,7 @@ void compiler_function_constant0(void)
 
   OCL_MAP_BUFFER(0);
   for(uint32_t i = 0; i < 69; ++i)
-    ((short *)buf_data[0])[i] = i;
+    ((int32_t *)buf_data[0])[i] = i;
   OCL_UNMAP_BUFFER(0);
 
   OCL_MAP_BUFFER(1);