Skip to content

Commit 2620292

Browse files
author
Hugh Delaney
authored
[SYCL][test] Remove UNSUPPORTED for HIP (#14180)
This should work. Also update test a little bit.
1 parent 47a0341 commit 2620292

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

sycl/test-e2e/Basic/buffer/buffer_dev_to_dev.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// FIXME flaky fail on HIP
2-
// UNSUPPORTED: hip
31
// RUN: %{build} -o %t.out
42
// RUN: %{run} %t.out
53

@@ -12,15 +10,16 @@
1210
//===----------------------------------------------------------------------===//
1311

1412
#include <cassert>
15-
#include <memory>
1613
#include <sycl/detail/core.hpp>
1714

1815
using namespace sycl;
1916

17+
constexpr int size = 10;
18+
2019
int main() {
21-
int Data[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
20+
int Data[size] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
2221
{
23-
buffer<int, 1> Buffer(Data, range<1>(10),
22+
buffer<int, 1> Buffer(Data, range<1>(size),
2423
{property::buffer::use_host_ptr()});
2524

2625
device Device(default_selector_v);
@@ -33,17 +32,17 @@ int main() {
3332

3433
assert(FirstQueue.get_context() != SecondQueue.get_context());
3534
FirstQueue.submit([&](handler &Cgh) {
36-
auto Accessor = Buffer.get_access<access::mode::read_write>(Cgh);
37-
Cgh.parallel_for<class init_b>(range<1>{10},
35+
accessor Accessor{Buffer, Cgh};
36+
Cgh.parallel_for<class init_b>(range<1>{size},
3837
[=](id<1> Index) { Accessor[Index] = 0; });
3938
});
4039
SecondQueue.submit([&](handler &Cgh) {
41-
auto Accessor = Buffer.get_access<access::mode::read_write>(Cgh);
40+
accessor Accessor{Buffer, Cgh};
4241
Cgh.parallel_for<class increment_b>(
43-
range<1>{10}, [=](id<1> Index) { Accessor[Index] += 1; });
42+
range<1>{size}, [=](id<1> Index) { Accessor[Index] += 1; });
4443
});
4544
} // Data is copied back
46-
for (int I = 0; I < 10; I++) {
45+
for (int I = 0; I < size; I++) {
4746
assert(Data[I] == 1);
4847
}
4948

0 commit comments

Comments
 (0)