Skip to content

Commit

Permalink
[basic] Enable image format aware scanline comparison.
Browse files Browse the repository at this point in the history
Use format aware memory comparison instead of memcmp.
  • Loading branch information
joshqti committed Aug 8, 2024
1 parent 284f757 commit 7449b8a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test_conformance/basic/test_imagearraycopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ int test_imagearraycopy_single_format(cl_device_id device, cl_context context,
err = clReleaseEvent(copyevent);
test_error(err, "clReleaseEvent failed");

if (memcmp(imgptr, bufptr, buffer_size) != 0)
image_descriptor compareImageInfo = {0};
compareImageInfo.format = format;
compareImageInfo.width = buffer_size / get_pixel_size(format);
size_t where = compare_scanlines(&compareImageInfo, reinterpret_cast<const char *>(imgptr),
reinterpret_cast<const char *>(bufptr));
if (where < compareImageInfo.width)
{
log_error("ERROR: Results did not validate!\n");
auto inchar = static_cast<unsigned char *>(imgptr);
Expand Down

0 comments on commit 7449b8a

Please sign in to comment.