From a5bfd4ee387bb3ae8c273e73278455d9ed638ae9 Mon Sep 17 00:00:00 2001 From: Leodasce Sewanou Date: Fri, 12 Dec 2025 09:11:30 +0100 Subject: [PATCH 1/2] [Clang-tidy] fix warning in copy_to_sycl_buffer function adapted the test --- src/tests/shambackends/DeviceBufferTests.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/tests/shambackends/DeviceBufferTests.cpp b/src/tests/shambackends/DeviceBufferTests.cpp index 0b99ddf4bd..883dd96dd7 100644 --- a/src/tests/shambackends/DeviceBufferTests.cpp +++ b/src/tests/shambackends/DeviceBufferTests.cpp @@ -114,10 +114,13 @@ TestStart( sycl::buffer b2 = b.copy_to_sycl_buffer(); - REQUIRE_EQUAL(b1.size(), b2.size()); - REQUIRE_EQUAL(b.get_size(), b1.size()); - - REQUIRE(shamalgs::primitives::equals(q, b1, b2)); + if (b1.size() == b2.size() && b.get_size() == b1.size()) { + sycl::host_accessor acc1(b1, sycl::read_only); + sycl::host_accessor acc2(b2, sycl::read_only); + for (size_t i = 0; i < b1.size(); ++i) { + REQUIRE_EQUAL(acc1[i], acc2[i]); + } + } } TestStart(Unittest, "shambackends/DeviceBuffer:fill", DeviceBuffer_fill1, 1) { From fa48faa442d8e64d36fff7c53de7eee4e1be48a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David--Cl=C3=A9ris=20Timoth=C3=A9e?= Date: Fri, 12 Dec 2025 11:03:18 +0100 Subject: [PATCH 2/2] Update src/tests/shambackends/DeviceBufferTests.cpp --- src/tests/shambackends/DeviceBufferTests.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tests/shambackends/DeviceBufferTests.cpp b/src/tests/shambackends/DeviceBufferTests.cpp index 883dd96dd7..838576f689 100644 --- a/src/tests/shambackends/DeviceBufferTests.cpp +++ b/src/tests/shambackends/DeviceBufferTests.cpp @@ -114,6 +114,9 @@ TestStart( sycl::buffer b2 = b.copy_to_sycl_buffer(); + REQUIRE_EQUAL(b1.size(), b2.size()); + REQUIRE_EQUAL(b.get_size(), b1.size()); + if (b1.size() == b2.size() && b.get_size() == b1.size()) { sycl::host_accessor acc1(b1, sycl::read_only); sycl::host_accessor acc2(b2, sycl::read_only);