Skip to content

Commit a84309f

Browse files
authored
[SYCL][Graph] Improve in-order test coverage and output (#18117)
This patch improves coverage for recording a `memcpy` by modifying an existing test.
1 parent b8b6ddc commit a84309f

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

sycl/test-e2e/Graph/RecordReplay/ext_oneapi_enqueue_functions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ int main() {
5252

5353
for (size_t i = 0; i < Size; i++) {
5454
T Ref = Pattern * i;
55-
assert(Output[i] == Ref);
55+
assert(check_value(i, Ref, Output[i], "Output"));
5656
}
5757

5858
return 0;

sycl/test-e2e/Graph/RecordReplay/usm_copy_in_order.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ int main() {
4545
// Shouldn't be captured in graph as a dependency
4646
Queue.submit([&](handler &CGH) {
4747
CGH.parallel_for(N, [=](id<1> it) {
48-
X[it] += 0.5f;
49-
Y[it] += 0.5f;
50-
Z[it] += 0.5f;
48+
X[it] += 1.0f;
49+
Y[it] += 1.0f;
50+
Z[it] += 1.0f;
5151
});
5252
});
5353

@@ -63,14 +63,15 @@ int main() {
6363
// memcpy from 2.0 Y values to Z
6464
Queue.submit([&](handler &CGH) { CGH.memcpy(Z, Y, N * sizeof(int)); });
6565

66+
std::vector<int> Output(N);
67+
Queue.memcpy(Output.data(), Z, N * sizeof(int));
68+
6669
Graph.end_recording();
6770

6871
auto ExecGraph = Graph.finalize();
6972

7073
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(ExecGraph); });
71-
72-
std::vector<int> Output(N);
73-
Queue.memcpy(Output.data(), Z, N * sizeof(int)).wait();
74+
Queue.wait_and_throw();
7475

7576
const int Expected = 2;
7677
for (size_t i = 0; i < N; i++) {

0 commit comments

Comments
 (0)