Skip to content

Commit cb49713

Browse files
committed
samplerlessReads: fix use_pitches test for devices with read_write images supported
The test specified a image_row_pitch and image_slice_pitch on the read_write image without a host_ptr or parent buffer. The read_write image doesn't get inialized like the read_only does, so it's fine to just reset the pitches back to 0 for its creation.
1 parent 4a923c0 commit cb49713

5 files changed

Lines changed: 22 additions & 0 deletions

File tree

test_conformance/images/samplerlessReads/test_iterations.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ int test_read_image_2D( cl_context context, cl_command_queue queue, cl_kernel ke
8989

9090
if(gTestReadWrite)
9191
{
92+
// We need to reset this because gEnablePitch might be true and
93+
// specifying a pitch on an image without a parent or host_ptr is
94+
// invalid.
95+
image_desc.image_row_pitch = 0;
9296
read_write_image = clCreateImage(context,
9397
CL_MEM_READ_WRITE,
9498
imageInfo->format,

test_conformance/images/samplerlessReads/test_read_1D.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ int test_read_image_1D( cl_context context, cl_command_queue queue, cl_kernel ke
9191

9292
if(gTestReadWrite)
9393
{
94+
// We need to reset this because gEnablePitch might be true and
95+
// specifying a pitch on an image without a parent or host_ptr is
96+
// invalid.
97+
image_desc.image_row_pitch = 0;
9498
read_write_image = clCreateImage(context,
9599
CL_MEM_READ_WRITE,
96100
imageInfo->format,

test_conformance/images/samplerlessReads/test_read_1D_array.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ int test_read_image_1D_array( cl_context context, cl_command_queue queue, cl_ker
9191

9292
if(gTestReadWrite)
9393
{
94+
// We need to reset this because gEnablePitch might be true and
95+
// specifying a pitch on an image without a parent or host_ptr is
96+
// invalid.
97+
image_desc.image_row_pitch = 0;
9498
read_write_image = clCreateImage(context,
9599
CL_MEM_READ_WRITE,
96100
imageInfo->format,

test_conformance/images/samplerlessReads/test_read_2D_array.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ int test_read_image_2D_array( cl_context context, cl_command_queue queue, cl_ker
8080

8181
if(gTestReadWrite)
8282
{
83+
// We need to reset this because gEnablePitch might be true and
84+
// specifying a pitch on an image without a parent or host_ptr is
85+
// invalid.
86+
image_desc.image_row_pitch = 0;
87+
image_desc.image_slice_pitch = 0;
8388
read_write_image = clCreateImage(context,
8489
CL_MEM_READ_WRITE,
8590
imageInfo->format,

test_conformance/images/samplerlessReads/test_read_3D.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ int test_read_image_3D( cl_context context, cl_command_queue queue, cl_kernel ke
7979

8080
if(gTestReadWrite)
8181
{
82+
// We need to reset this because gEnablePitch might be true and
83+
// specifying a pitch on an image without a parent or host_ptr is
84+
// invalid.
85+
image_desc.image_row_pitch = 0;
86+
image_desc.image_slice_pitch = 0;
8287
read_write_image = clCreateImage(context,
8388
CL_MEM_READ_WRITE,
8489
imageInfo->format,

0 commit comments

Comments
 (0)