Skip to content

Commit

Permalink
Finish off rewriting regression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lbushi25 committed Feb 8, 2024
1 parent 6d25416 commit f0d325f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
5 changes: 3 additions & 2 deletions sycl/test-e2e/Regression/pf-wg-atomic64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ using AtomicRefT =

int main() {
queue q;
auto *p = malloc_shared<unsigned long long>(1, q);
sycl::buffer<unsigned long long> p_buf{sycl::range{1}};
try {
q.submit([&](sycl::handler &cgh) {
sycl::accessor p{p_buf, cgh};
cgh.parallel_for_work_group(range{1}, range{1}, [=](group<1>) {
AtomicRefT feature(*p);
AtomicRefT feature(p[0]);
feature += 42;
});
}).wait();
Expand Down
18 changes: 11 additions & 7 deletions sycl/test-e2e/Regression/range-rounding-this-id.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@ template <int D> void test(queue &q) {
id<D> this_id;
id<D> ref_id;
};
std::vector<T, usm_allocator<T, usm::alloc::shared>> vec(range.size(), q);
auto *p = vec.data();
q.parallel_for(range, [=](auto it) {
p[it.get_linear_id()] = {sycl::ext::oneapi::experimental::this_id<D>(),
it.get_id()};
}).wait_and_throw();

std::vector<T> vec(range.size());
{
sycl::buffer<T> p_buf{vec};
q.submit([&](sycl::handler &h) {
sycl::accessor p{p_buf, h};
q.parallel_for(range, [=](auto it) {
p[it.get_linear_id()] = {sycl::ext::oneapi::experimental::this_id<D>(),
it.get_id()};
});
}).wait_and_throw();
} // p_buf goes out of scope here and writed back to vec
for (const auto &[this_item, ref_item] : vec) {
if (this_item != ref_item) {
std::cout << "fail: " << this_item << " != " << ref_item << "\n";
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Regression/reduction_64bit_atomic64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: %{build} -o %t.out
//
// RUN: %{run} %t.out

// REQUIRES: aspect-usm_shared_allocations
// Tests that a previously known case for reduction doesn't cause a requirement
// for atomic64.
// TODO: When aspect requirements are added to testing, this test could be set
Expand Down

0 comments on commit f0d325f

Please sign in to comment.