Skip to content

Commit d747667

Browse files
authored
[SYCL][Graph] Clean-up E2E Tests (intel#12685)
Some clean-up for SYCL-Graph E2E tests: * Remove redundant `Event` variables that are initialized over loop iterations but never used. * Remove all instances of the no immediate command-list property, and use environment variable instead to test both paths. * Always use FileCheck leak checking rather than `CHECK-NOT: Leak`. * Remove unnecessary threading code from `Inputs/basic_usm.cpp`
1 parent aa015f3 commit d747667

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+99
-156
lines changed

sycl/test-e2e/Graph/Explicit/buffer_fill.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// RUN: %{build} -o %t.out
22
// RUN: %{run} %t.out
33
// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG
4-
// RUN: %if level_zero %{env %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck --implicit-check-not=LEAK %s %}
4+
// RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %}
55
// Extra run to check for immediate-command-list in Level Zero
66
// RUN: %if level_zero && linux %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %}
7-
//
7+
88
// TODO enable cuda once buffer issue investigated and fixed
99
// UNSUPPORTED: cuda
1010

sycl/test-e2e/Graph/Explicit/buffer_fill_2d.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
// RUN: %{build} -o %t.out
22
// RUN: %{run} %t.out
33
// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG
4-
// RUN: %if level_zero %{env %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck --implicit-check-not=LEAK %s %}
5-
//
4+
// RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %}
5+
// Extra run to check for immediate-command-list in Level Zero
6+
// RUN: %if level_zero && linux %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %}
7+
68
// TODO enable cuda once buffer issue investigated and fixed
79
// UNSUPPORTED: cuda
810

sycl/test-e2e/Graph/Explicit/buffer_fill_3d.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
// RUN: %{build} -o %t.out
22
// RUN: %{run} %t.out
33
// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG
4-
// RUN: %if level_zero %{env %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck --implicit-check-not=LEAK %s %}
5-
//
4+
// RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %}
5+
// Extra run to check for immediate-command-list in Level Zero
6+
// RUN: %if level_zero && linux %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %}
7+
68
// TODO enable cuda once buffer issue investigated and fixed
79
// UNSUPPORTED: cuda
810

sycl/test-e2e/Graph/Explicit/queue_constructor_buffer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// RUN: %{build} -o %t.out
22
// RUN: %{run} %t.out
33
// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG
4-
// RUN: %if level_zero %{ %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s %}
5-
//
6-
// CHECK-NOT: LEAK
7-
//
4+
// RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %}
5+
// Extra run to check for immediate-command-list in Level Zero
6+
// RUN: %if level_zero && linux %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %}
7+
88
// TODO enable cuda once buffer issue investigated and fixed
99
// UNSUPPORTED: cuda
1010

sycl/test-e2e/Graph/Explicit/queue_constructor_usm.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
// RUN: %{build} -o %t.out
22
// RUN: %{run} %t.out
33
// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG
4-
// RUN: %if level_zero %{ %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %}
4+
// RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %}
55
// Extra run to check for immediate-command-list in Level Zero
66
// RUN: %if level_zero && linux %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %}
7-
//
87

98
#define GRAPH_E2E_EXPLICIT
109

sycl/test-e2e/Graph/Explicit/stream.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// RUN: %{build} -o %t.out
2-
// RUN: %{run} %t.out %GPU_CHECK_PLACEHOLDER
3-
// RUN: %if level_zero %{ %{l0_leak_check} %{run} %t.out %GPU_CHECK_PLACEHOLDER 2>&1 | FileCheck %s --implicit-check-not=LEAK %}
4-
//
2+
// RUN: %{run} %t.out
3+
// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG
4+
// RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %}
5+
// Extra run to check for immediate-command-list in Level Zero
6+
// RUN: %if level_zero && linux %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %}
57

68
// Skip as sycl streams aren't implemented yet
79
// REQUIRES: NOT_YET_IMPLEMENTED

sycl/test-e2e/Graph/Explicit/usm_memset.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// RUN: %{build} -o %t.out
22
// RUN: %{run} %t.out
33
// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG
4-
// RUN: %if level_zero %{env %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck --implicit-check-not=LEAK %s %}
4+
// RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %}
55
// Extra run to check for immediate-command-list in Level Zero
66
// RUN: %if level_zero && linux %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %}
7-
//
7+
88
// USM memset command not supported for OpenCL
99
// UNSUPPORTED: opencl
1010

sycl/test-e2e/Graph/Inputs/basic_buffer.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@ int main() {
3939

4040
auto GraphExec = Graph.finalize();
4141

42-
event Event;
4342
for (unsigned n = 0; n < Iterations; n++) {
44-
Event =
45-
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
43+
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
4644
}
4745
Queue.wait_and_throw();
4846
}

sycl/test-e2e/Graph/Inputs/basic_usm.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// and submission of the graph.
33

44
#include "../graph_common.hpp"
5-
#include <thread>
65

76
int main() {
87
queue Queue{};
@@ -13,7 +12,6 @@ int main() {
1312

1413
using T = int;
1514

16-
const unsigned NumThreads = std::thread::hardware_concurrency();
1715
std::vector<T> DataA(Size), DataB(Size), DataC(Size);
1816

1917
std::iota(DataA.begin(), DataA.end(), 1);
@@ -38,19 +36,10 @@ int main() {
3836
// Add commands to graph
3937
add_nodes(Graph, Queue, Size, PtrA, PtrB, PtrC);
4038

41-
Barrier SyncPoint{NumThreads};
42-
4339
auto GraphExec = Graph.finalize();
4440

45-
auto SubmitGraph = [&]() {
46-
SyncPoint.wait();
47-
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
48-
};
49-
50-
event Event;
5141
for (unsigned n = 0; n < Iterations; n++) {
52-
Event =
53-
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
42+
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
5443
}
5544

5645
Queue.wait_and_throw();

sycl/test-e2e/Graph/Inputs/basic_usm_host.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,8 @@ int main() {
4242

4343
auto GraphExec = Graph.finalize();
4444

45-
event Event;
4645
for (unsigned n = 0; n < Iterations; n++) {
47-
Event =
48-
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
46+
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
4947
}
5048

5149
Queue.wait_and_throw();

sycl/test-e2e/Graph/Inputs/basic_usm_mixed.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@ int main() {
4545

4646
auto GraphExec = Graph.finalize();
4747

48-
event Event;
4948
for (unsigned n = 0; n < Iterations; n++) {
50-
Event =
51-
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
49+
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
5250
}
5351

5452
Queue.wait_and_throw();

sycl/test-e2e/Graph/Inputs/basic_usm_shared.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,8 @@ int main() {
4242

4343
auto GraphExec = Graph.finalize();
4444

45-
event Event;
4645
for (unsigned n = 0; n < Iterations; n++) {
47-
Event =
48-
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
46+
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
4947
}
5048

5149
Queue.wait_and_throw();

sycl/test-e2e/Graph/Inputs/basic_usm_system.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,8 @@ int main() {
4242

4343
auto GraphExec = Graph.finalize();
4444

45-
event Event;
4645
for (unsigned n = 0; n < Iterations; n++) {
47-
Event =
48-
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
46+
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
4947
}
5048

5149
Queue.wait_and_throw();

sycl/test-e2e/Graph/Inputs/buffer_copy.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,8 @@ int main() {
108108

109109
auto GraphExec = Graph.finalize();
110110

111-
event Event;
112111
for (unsigned n = 0; n < Iterations; n++) {
113-
Event =
114-
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
112+
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
115113
}
116114
Queue.wait_and_throw();
117115
}

sycl/test-e2e/Graph/Inputs/buffer_copy_2d.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,9 @@ int main() {
103103

104104
auto GraphExec = Graph.finalize();
105105

106-
event Event;
107106
for (unsigned n = 0; n < Iterations; n++) {
108-
Event =
109-
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
107+
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
110108
}
111-
// Event.wait();
112109
Queue.wait_and_throw();
113110
}
114111

sycl/test-e2e/Graph/Inputs/buffer_fill.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
int main() {
66

7-
queue Queue{{sycl::ext::intel::property::queue::no_immediate_command_list{}}};
7+
queue Queue;
88

99
if (!are_graphs_supported(Queue)) {
1010
return 0;

sycl/test-e2e/Graph/Inputs/buffer_fill_2d.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
int main() {
66

7-
queue Queue{{sycl::ext::intel::property::queue::no_immediate_command_list{}}};
7+
queue Queue;
88

99
if (!are_graphs_supported(Queue)) {
1010
return 0;

sycl/test-e2e/Graph/Inputs/buffer_fill_3d.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
int main() {
66

7-
queue Queue{{sycl::ext::intel::property::queue::no_immediate_command_list{}}};
7+
queue Queue;
88

99
if (!are_graphs_supported(Queue)) {
1010
return 0;

sycl/test-e2e/Graph/Inputs/memadvise.cpp

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

99
using T = int;
1010

11-
queue Queue{{sycl::ext::intel::property::queue::no_immediate_command_list{}}};
11+
queue Queue;
1212

1313
if (!are_graphs_supported(Queue)) {
1414
return 0;

sycl/test-e2e/Graph/Inputs/multiple_exec_graphs.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,12 @@ int main() {
3333
Queue.copy(DataC.data(), PtrC, Size);
3434
Queue.wait_and_throw();
3535

36-
// event Event = add_nodes(Graph, Queue, Size, PtrA, PtrB, PtrC);
37-
// Queue.wait_and_throw();
38-
3936
add_nodes(Graph, Queue, Size, PtrA, PtrB, PtrC);
4037

4138
// Finalize and execute several iterations of the graph
42-
event Event;
4339
for (unsigned n = 0; n < Iterations; n++) {
4440
auto GraphExec = Graph.finalize();
45-
Event =
46-
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
41+
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
4742
}
4843
Queue.wait_and_throw();
4944

sycl/test-e2e/Graph/Inputs/prefetch.cpp

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

99
using T = int;
1010

11-
queue Queue{{sycl::ext::intel::property::queue::no_immediate_command_list{}}};
11+
queue Queue;
1212

1313
if (!are_graphs_supported(Queue)) {
1414
return 0;

sycl/test-e2e/Graph/Inputs/queue_constructor_buffer.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "../graph_common.hpp"
55

66
int main() {
7-
queue Queue{{sycl::ext::intel::property::queue::no_immediate_command_list{}}};
7+
queue Queue;
88

99
if (!are_graphs_supported(Queue)) {
1010
return 0;
@@ -37,10 +37,8 @@ int main() {
3737

3838
auto GraphExec = Graph.finalize();
3939

40-
event Event;
4140
for (unsigned n = 0; n < Iterations; n++) {
42-
Event =
43-
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
41+
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
4442
}
4543
Queue.wait_and_throw();
4644
}

sycl/test-e2e/Graph/Inputs/queue_constructor_usm.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "../graph_common.hpp"
55

66
int main() {
7-
queue Queue{{sycl::ext::intel::property::queue::no_immediate_command_list{}}};
7+
queue Queue;
88

99
if (!are_graphs_supported(Queue)) {
1010
return 0;
@@ -41,10 +41,8 @@ int main() {
4141
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
4242
};
4343

44-
event Event;
4544
for (unsigned n = 0; n < Iterations; n++) {
46-
Event =
47-
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
45+
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
4846
}
4947

5048
Queue.wait_and_throw();

sycl/test-e2e/Graph/Inputs/sub_graph.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,8 @@ int main() {
101101
// Finalize a graph with the additional kernel for writing out to
102102
auto MainGraphExec = MainGraph.finalize();
103103

104-
event Event;
105104
for (unsigned n = 0; n < Iterations; n++) {
106-
Event = Queue.submit(
107-
[&](handler &CGH) { CGH.ext_oneapi_graph(MainGraphExec); });
105+
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(MainGraphExec); });
108106
}
109107
Queue.wait_and_throw();
110108

sycl/test-e2e/Graph/Inputs/sub_group_prop.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ void test(queue &Queue, const std::vector<size_t> SupportedSGSizes) {
141141
}
142142

143143
int main() {
144-
queue Queue({sycl::ext::intel::property::queue::no_immediate_command_list{}});
144+
queue Queue;
145145

146146
if (!are_graphs_supported(Queue)) {
147147
return 0;

sycl/test-e2e/Graph/Inputs/temp_buffer_reinterpret.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ int main() {
4646
}
4747
auto GraphExec = Graph.finalize();
4848

49-
event Event;
5049
for (unsigned n = 0; n < Iterations; n++) {
51-
Event =
52-
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
50+
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
5351
}
5452

5553
Queue.copy(BufferA.get_access(), DataA.data());

sycl/test-e2e/Graph/Inputs/usm_memset.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
int main() {
66

7-
queue Queue{{sycl::ext::intel::property::queue::no_immediate_command_list{}}};
7+
queue Queue;
88

99
if (!are_graphs_supported(Queue)) {
1010
return 0;

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "../graph_common.hpp"
1313

1414
int main() {
15-
queue Queue{{sycl::ext::intel::property::queue::no_immediate_command_list{}}};
15+
queue Queue;
1616

1717
if (!are_graphs_supported(Queue)) {
1818
return 0;
@@ -54,8 +54,7 @@ int main() {
5454
// Execute several iterations of the graph (first iteration has already run
5555
// before graph recording)
5656
for (unsigned n = 1; n < Iterations; n++) {
57-
Event =
58-
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
57+
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); });
5958
}
6059
Queue.wait_and_throw();
6160

0 commit comments

Comments
 (0)