Skip to content

Commit 0acbc86

Browse files
Akos299tdavidcl
andauthored
[Clang-tidy] fix warning in copy_to_sycl_buffer function (#1422)
warning: 'equals<int>' is deprecated: Use equals(const sham::DeviceScheduler_ptr &, sham::DeviceBuffer<T> &, sham::DeviceBuffer<T> &, u32 ) instead. [clang-diagnostic-deprecated-declarations] 280 | return equals(q, buf1, buf2, buf1.size()); | ^ /__w/Shamrock/Shamrock/src/tests/shambackends/DeviceBufferTests.cpp:120:35: note: in instantiation of function template specialization 'shamalgs::primitives::equals<int>' requested here 120 | REQUIRE(shamalgs::primitives::equals(q, b1, b2)); | ^ /__w/Shamrock/Shamrock/src/shamalgs/include/shamalgs/primitives/equals.hpp:74:7: note: 'equals<int>' has been explicitly marked deprecated here 74 | [[deprecated( | ^ --------- Co-authored-by: David--Cléris Timothée <timothee.davidcleris@proton.me>
1 parent 74d8c80 commit 0acbc86

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/tests/shambackends/DeviceBufferTests.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,13 @@ TestStart(
117117
REQUIRE_EQUAL(b1.size(), b2.size());
118118
REQUIRE_EQUAL(b.get_size(), b1.size());
119119

120-
REQUIRE(shamalgs::primitives::equals(q, b1, b2));
120+
if (b1.size() == b2.size() && b.get_size() == b1.size()) {
121+
sycl::host_accessor acc1(b1, sycl::read_only);
122+
sycl::host_accessor acc2(b2, sycl::read_only);
123+
for (size_t i = 0; i < b1.size(); ++i) {
124+
REQUIRE_EQUAL(acc1[i], acc2[i]);
125+
}
126+
}
121127
}
122128

123129
TestStart(Unittest, "shambackends/DeviceBuffer:fill", DeviceBuffer_fill1, 1) {

0 commit comments

Comments
 (0)