Skip to content

[SYCL][Graph] E2E tests for SYCL Graphs (4/4) #10216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e4f89c1
[SYCL][Graphs] Squashed commit of E2E tests
Bensuo Jul 5, 2023
d7a78c8
[SYCL][Graph] Add event and inorder/empty tests
Bensuo Jul 5, 2023
575384d
Merge remote-tracking branch 'origin/sycl' into sycl-graph-patch-4
Bensuo Jul 11, 2023
83b5453
[SYCL][Graph] Add new tests
Bensuo Jul 11, 2023
9b86e94
[SYCL][Graph] Fix clang-format for e2e tests (#261)
reble Jul 12, 2023
86fd94f
[SYCL] Change `graph_support_level` namespace (#256)
Bensuo Jul 14, 2023
e7a996b
[SYCL][Graph] Fix issue with CUDA device in E2E test (#259)
Bensuo Jul 13, 2023
b6015c3
Merge branch 'sycl' into sycl-graph-patch-4
EwanC Jul 17, 2023
b78844b
[SYCL] Disable failing Windows tests
EwanC Jul 17, 2023
39e3fdb
[SYCL][Graph] Deleting unsupported tests (#266)
reble Jul 18, 2023
c7fff4e
[SYCL][Graph] Removed outdated test
EwanC Jul 18, 2023
b1a5b47
[SYCL][Graph] Use same context for e2e queues
EwanC Jul 18, 2023
4c58d19
[SYCL][Graph] Move macro and queue tests
Bensuo Jul 26, 2023
70bf538
[SYCL][Graph] Improve finalize tests
Bensuo Jul 26, 2023
bc8b994
[SYCL][Graph] Unify tests where possible (#275)
Bensuo Jul 26, 2023
f41540e
[SYCL][Graph] Disable failing test on Windows temporarily
reble Jul 27, 2023
0f46bdd
[SYCL][Graph] Add missing newlines at EOF
Bensuo Jul 28, 2023
2306b5f
[SYCL][Graph] Fix incorrect input name
Bensuo Jul 28, 2023
c613bba
[SYCL][Graph] Unify event_status_querying test
Bensuo Jul 28, 2023
3ec58b5
[SYCL][Graph] Minor test improvements
Bensuo Jul 28, 2023
c6cf4c1
[SYCL][Graph] Unify dotp_usm_reduction test
Bensuo Jul 28, 2023
ac714be
[SYCL][Graph] Remove unnecessary sycl::item to size_t conversions
Bensuo Jul 28, 2023
144c9fb
[SYCL][Graph] Remove missed uses of gpu_selector_v
Bensuo Jul 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions sycl/test-e2e/Graph/Explicit/add_node_while_recording.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

// Expected Fail as exception not implemented yet
// XFAIL: *

// Tests attempting to add a node to a command_graph while it is being
// recorded to by a queue is an error.

#include "../graph_common.hpp"

int main() {
queue Queue;

bool Success = false;

exp_ext::command_graph Graph{Queue.get_context(), Queue.get_device()};
Graph.begin_recording(Queue);

try {
Graph.add([&](handler &CGH) {});
} catch (sycl::exception &E) {
auto StdErrc = E.code().value();
if (StdErrc == static_cast<int>(errc::invalid)) {
Success = true;
}
}

Graph.end_recording();
assert(Success);
return 0;
}
11 changes: 11 additions & 0 deletions sycl/test-e2e/Graph/Explicit/add_nodes_after_finalize.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/add_nodes_after_finalize.cpp"
11 changes: 11 additions & 0 deletions sycl/test-e2e/Graph/Explicit/basic_buffer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/basic_buffer.cpp"
11 changes: 11 additions & 0 deletions sycl/test-e2e/Graph/Explicit/basic_usm.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/basic_usm.cpp"
11 changes: 11 additions & 0 deletions sycl/test-e2e/Graph/Explicit/basic_usm_host.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/basic_usm_host.cpp"
11 changes: 11 additions & 0 deletions sycl/test-e2e/Graph/Explicit/basic_usm_mixed.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/basic_usm_mixed.cpp"
11 changes: 11 additions & 0 deletions sycl/test-e2e/Graph/Explicit/basic_usm_shared.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/basic_usm_shared.cpp"
11 changes: 11 additions & 0 deletions sycl/test-e2e/Graph/Explicit/basic_usm_system.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/basic_usm_system.cpp"
11 changes: 11 additions & 0 deletions sycl/test-e2e/Graph/Explicit/buffer_copy.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/buffer_copy.cpp"
11 changes: 11 additions & 0 deletions sycl/test-e2e/Graph/Explicit/buffer_copy_2d.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/buffer_copy_2d.cpp"
11 changes: 11 additions & 0 deletions sycl/test-e2e/Graph/Explicit/buffer_copy_host2target.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/buffer_copy_host2target.cpp"
11 changes: 11 additions & 0 deletions sycl/test-e2e/Graph/Explicit/buffer_copy_host2target_2d.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/buffer_copy_host2target_2d.cpp"
11 changes: 11 additions & 0 deletions sycl/test-e2e/Graph/Explicit/buffer_copy_host2target_offset.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/buffer_copy_host2target_offset.cpp"
11 changes: 11 additions & 0 deletions sycl/test-e2e/Graph/Explicit/buffer_copy_offsets.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/buffer_copy_offsets.cpp"
11 changes: 11 additions & 0 deletions sycl/test-e2e/Graph/Explicit/buffer_copy_target2host.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/buffer_copy_target2host.cpp"
11 changes: 11 additions & 0 deletions sycl/test-e2e/Graph/Explicit/buffer_copy_target2host_2d.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/buffer_copy_target2host_2d.cpp"
11 changes: 11 additions & 0 deletions sycl/test-e2e/Graph/Explicit/buffer_copy_target2host_offset.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/buffer_copy_target2host_offset.cpp"
11 changes: 11 additions & 0 deletions sycl/test-e2e/Graph/Explicit/buffer_ordering.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/buffer_ordering.cpp"
49 changes: 49 additions & 0 deletions sycl/test-e2e/Graph/Explicit/depends_on.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

// Tests that an event returned from adding a graph node using the queue
// recording API can be passed to `handler::depends_on` inside a node
// added using the explicit API. This should create a graph edge.

#include "../graph_common.hpp"

int main() {

queue Queue;

exp_ext::command_graph Graph{Queue.get_context(), Queue.get_device()};

const size_t N = 10;
float *Arr = malloc_device<float>(N, Queue);

Graph.begin_recording(Queue);
// `Event` corresponds to a graph node
event Event = Queue.submit([&](handler &CGH) {
CGH.parallel_for(range<1>{N}, [=](id<1> idx) { Arr[idx] = 42.0f; });
});
Graph.end_recording(Queue);

Graph.add([&](handler &CGH) {
CGH.depends_on(Event); // creates edge to recorded graph node
CGH.parallel_for(range<1>{N}, [=](id<1> idx) { Arr[idx] *= 2.0f; });
});

auto ExecGraph = Graph.finalize();

Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(ExecGraph); }).wait();

constexpr float ref = 42.0f * 2.0f;
std::vector<float> Output(N);
Queue.memcpy(Output.data(), Arr, N * sizeof(float)).wait();
for (int i = 0; i < N; i++)
assert(Output[i] == ref);

sycl::free(Arr, Queue);

return 0;
}
14 changes: 14 additions & 0 deletions sycl/test-e2e/Graph/Explicit/dotp_buffer_reduction.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

// Expected fail as reduction support is not complete.
// XFAIL: *

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/dotp_buffer_reduction.cpp"
14 changes: 14 additions & 0 deletions sycl/test-e2e/Graph/Explicit/dotp_usm_reduction.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

// Expected fail as reduction support is not complete.
// XFAIL: *

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/dotp_usm_reduction.cpp"
14 changes: 14 additions & 0 deletions sycl/test-e2e/Graph/Explicit/double_buffer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

// Expected fail as executable graph update isn't implemented yet
// XFAIL: *

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/double_buffer.cpp"
11 changes: 11 additions & 0 deletions sycl/test-e2e/Graph/Explicit/empty_node.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// REQUIRES: level_zero, gpu
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// Extra run to check for leaks in Level Zero using ZE_DEBUG
// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %}
//
// CHECK-NOT: LEAK

#define GRAPH_E2E_EXPLICIT

#include "../Inputs/empty_node.cpp"
Loading