summaryrefslogtreecommitdiff
path: root/utests
diff options
context:
space:
mode:
authorGuo Yejun <yejun.guo@intel.com>2016-09-02 10:03:50 +0800
committerYang Rong <rong.r.yang@intel.com>2016-09-05 14:59:14 +0800
commit641d7550668054e585e730b49788ca157d100c2f (patch)
tree5f2d31e8820f3515911f3da72507e451a4d781e7 /utests
parentb00aa4463cbe5d3de598a171a53e0c6c059bf7c3 (diff)
downloadbeignet-641d7550668054e585e730b49788ca157d100c2f.tar.gz
fix w of image when simulate image1dbuffer with image2d
and also change the utest to hit the potential case Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
Diffstat (limited to 'utests')
-rw-r--r--utests/image_1D_buffer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/utests/image_1D_buffer.cpp b/utests/image_1D_buffer.cpp
index 66eb6e79..fefb241f 100644
--- a/utests/image_1D_buffer.cpp
+++ b/utests/image_1D_buffer.cpp
@@ -3,8 +3,8 @@
void image_1D_buffer(void)
{
- size_t buffer_sz = 65536;
- char *buf_content = (char *)malloc(buffer_sz * sizeof(int));
+ size_t buffer_sz = 8192 * 2 + 32;
+ int *buf_content = (int *)malloc(buffer_sz * sizeof(int));
int error;
cl_image_desc image_desc;
cl_image_format image_format;
@@ -13,7 +13,7 @@ void image_1D_buffer(void)
OCL_CREATE_KERNEL("image_1D_buffer");
for (int32_t i = 0; i < (int32_t)buffer_sz; ++i)
- buf_content[i] = (rand() & 0xFFFFFFFF);
+ buf_content[i] = rand();
OCL_CREATE_BUFFER(buf[0], CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, buffer_sz * sizeof(int), buf_content);
OCL_CREATE_BUFFER(buf[1], CL_MEM_READ_WRITE, buffer_sz * sizeof(int), NULL);