Skip to content

Commit

Permalink
[basic] Enable image format aware scanline comparison. (#2042)
Browse files Browse the repository at this point in the history
Use format aware memory comparison instead of memcmp.
  • Loading branch information
joshqti authored Aug 13, 2024
1 parent b4c3bf2 commit b8981f5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test_conformance/basic/test_imagearraycopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,13 @@ 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 b8981f5

Please sign in to comment.