Skip to content

Commit

Permalink
[SYCL] Update to ext_oneapi_graph
Browse files Browse the repository at this point in the history
This is based on:
* reble/llvm#61
* reble/llvm#65
  • Loading branch information
EwanC committed Jan 5, 2023
1 parent 6a1fc0c commit e4f7d4d
Show file tree
Hide file tree
Showing 19 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion SYCL/CommandGraph/graph_finalize_empty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ int main() {
graph;
auto graphExec = graph.finalize(testQueue.get_context());

testQueue.submit([&](handler &cgh) { cgh.graph(graphExec); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(graphExec); });
testQueue.wait();

return 0;
Expand Down
4 changes: 2 additions & 2 deletions SYCL/CommandGraph/graph_record_after_finalize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ int main() {

// Execute several iterations of the graph
for (unsigned n = 0; n < iterations; n++) {
testQueue.submit([&](handler &cgh) { cgh.graph(graphExec); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(graphExec); });
}
// Execute the extended graph.
for (unsigned n = 0; n < iterations; n++) {
testQueue.submit([&](handler &cgh) { cgh.graph(graphExecAdditional); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(graphExecAdditional); });
}
// Perform a wait on all graph submissions.
testQueue.wait_and_throw();
Expand Down
2 changes: 1 addition & 1 deletion SYCL/CommandGraph/graph_record_after_use.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ int main() {
// Execute several iterations of the graph (first iteration has already run
// before graph recording)
for (unsigned n = 1; n < iterations; n++) {
testQueue.submit([&](handler &cgh) { cgh.graph(graphExec); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(graphExec); });
}
// Perform a wait on all graph submissions.
testQueue.wait();
Expand Down
2 changes: 1 addition & 1 deletion SYCL/CommandGraph/graph_record_basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int main() {

// Execute several iterations of the graph
for (unsigned n = 0; n < iterations; n++) {
testQueue.submit([&](handler &cgh) { cgh.graph(graphExec); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(graphExec); });
}
// Perform a wait on all graph submissions.
testQueue.wait();
Expand Down
2 changes: 1 addition & 1 deletion SYCL/CommandGraph/graph_record_basic_usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int main() {

// Execute several iterations of the graph
for (unsigned n = 0; n < iterations; n++) {
testQueue.submit([&](handler &cgh) { cgh.graph(graphExec); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(graphExec); });
}
// Perform a wait on all graph submissions.
testQueue.wait();
Expand Down
4 changes: 2 additions & 2 deletions SYCL/CommandGraph/graph_record_double_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ int main() {
testQueue.end_recording();

for (size_t i = 0; i < iterations; i++) {
testQueue.submit([&](handler &cgh) { cgh.graph(graphExec); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(graphExec); });
// Update to second set of buffers
execGraph.update(graphUpdate);
testQueue.submit([&](handler &cgh) { cgh.graph(graphExec); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(graphExec); });
// Reset back to original buffers
execGraph.update(graph);
}
Expand Down
2 changes: 1 addition & 1 deletion SYCL/CommandGraph/graph_record_host_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ int main() {

// Execute several iterations of the graph
for (unsigned n = 0; n < iterations; n++) {
testQueue.submit([&](handler &cgh) { cgh.graph(graphExec); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(graphExec); });
}
// Perform a wait on all graph submissions.
testQueue.wait();
Expand Down
2 changes: 1 addition & 1 deletion SYCL/CommandGraph/graph_record_multiple_exec_graphs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ int main() {
// before graph recording)
for (unsigned n = 1; n < iterations; n++) {
auto graphExec = graph.finalize(testQueue.get_context());
testQueue.submit([&](handler &cgh) { cgh.graph(graphExec); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(graphExec); });
}
// Perform a wait on all graph submissions.
testQueue.wait();
Expand Down
6 changes: 3 additions & 3 deletions SYCL/CommandGraph/graph_record_queue_shortcuts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ int main() {
auto graphExec = graph.finalize(testQueue.get_context());

// Execute several iterations of the graph using the different shortcuts
event e = testQueue.exec_graph(graphExec);
event e = testQueue.ext_oneapi_graph(graphExec);

assert(iterations > 2);
const unsigned loop_iterations = iterations - 2;
std::vector<event> events(loop_iterations);
for (unsigned n = 0; n < loop_iterations; n++) {
events[n] = testQueue.exec_graph(graphExec, e);
events[n] = testQueue.ext_oneapi_graph(graphExec, e);
}

testQueue.exec_graph(graphExec, events).wait();
testQueue.ext_oneapi_graph(graphExec, events).wait();
}

bool failed = false;
Expand Down
2 changes: 1 addition & 1 deletion SYCL/CommandGraph/graph_record_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int main() {

auto graphExec = graph.finalize(testQueue.get_context());

testQueue.submit([&](handler &cgh) { cgh.graph(graphExec); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(graphExec); });

// Perform a wait on all graph submissions.
testQueue.wait();
Expand Down
4 changes: 2 additions & 2 deletions SYCL/CommandGraph/graph_record_sub_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ int main() {
});
});

testQueue.submit([&](handler &cgh) { cgh.graph(subGraphExec); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(subGraphExec); });

// Copy to another output buffer.
testQueue.submit([&](handler &cgh) {
Expand All @@ -110,7 +110,7 @@ int main() {

// Execute several iterations of the graph
for (unsigned n = 0; n < iterations; n++) {
testQueue.submit([&](handler &cgh) { cgh.graph(mainGraphExec); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(mainGraphExec); });
}
// Perform a wait on all graph submissions.
testQueue.wait_and_throw();
Expand Down
2 changes: 1 addition & 1 deletion SYCL/CommandGraph/graph_record_temp_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ int main() {

// Execute several iterations of the graph
for (unsigned n = 0; n < iterations; n++) {
testQueue.submit([&](handler &cgh) { cgh.graph(graphExec); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(graphExec); });
}
// Perform a wait on all graph submissions.
testQueue.wait();
Expand Down
2 changes: 1 addition & 1 deletion SYCL/CommandGraph/graph_record_temp_buffer_reinterpret.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ int main() {

// Execute several iterations of the graph
for (unsigned n = 0; n < iterations; n++) {
testQueue.submit([&](handler &cgh) { cgh.graph(graphExec); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(graphExec); });
}
// Perform a wait on all graph submissions.
testQueue.wait();
Expand Down
2 changes: 1 addition & 1 deletion SYCL/CommandGraph/graph_record_threaded_finalize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int main() {
testQueue.end_recording();
auto finalizeGraph = [&]() {
auto graphExec = graph.finalize(testQueue.get_context());
testQueue.submit([&](sycl::handler &cgh) { cgh.graph(graphExec); });
testQueue.submit([&](sycl::handler &cgh) { cgh.ext_oneapi_graph(graphExec); });
};

std::vector<std::thread> threads;
Expand Down
2 changes: 1 addition & 1 deletion SYCL/CommandGraph/graph_record_threaded_submit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ int main() {

auto graphExec = graph.finalize(testQueue.get_context());
auto submitGraph = [&]() {
testQueue.submit([&](handler &cgh) { cgh.graph(graphExec); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(graphExec); });
};

std::vector<std::thread> threads;
Expand Down
2 changes: 1 addition & 1 deletion SYCL/CommandGraph/graph_record_usm_memcpy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ int main() {

// Execute graph over n iterations
for (unsigned n = 0; n < iterations; n++) {
testQueue.submit([&](handler &cgh) { cgh.graph(graphExec); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(graphExec); });
}
// Perform a wait on all graph submissions.
testQueue.wait();
Expand Down
2 changes: 1 addition & 1 deletion SYCL/CommandGraph/graph_record_valid_no_end.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ int main() {

try {
auto graphExec = graph.finalize(testQueue.get_context());
testQueue.submit([&](handler &cgh) { cgh.graph(graphExec); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(graphExec); });
} catch (sycl::exception &e) {
std::cout << "Exception thrown on finalize or submission.\n";
std::abort();
Expand Down
4 changes: 2 additions & 2 deletions SYCL/CommandGraph/graph_record_whole_graph_update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ int main() {
testQueue.end_recording();
// Execute several iterations of the graph for 1st set of buffers
for (unsigned n = 0; n < iterations; n++) {
testQueue.submit([&](handler &cgh) { cgh.graph(graphExec); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(graphExec); });
}

graphExec.update(graphB);

// Execute several iterations of the graph for 2nd set of buffers
for (unsigned n = 0; n < iterations; n++) {
testQueue.submit([&](handler &cgh) { cgh.graph(graphExec); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(graphExec); });
}

// Perform a wait on all graph submissions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ int main() {
testQueue.end_recording();
// Execute several iterations of the graph for 1st set of buffers
for (unsigned n = 0; n < iterations; n++) {
testQueue.submit([&](handler &cgh) { cgh.graph(graphExec); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(graphExec); });
}

graphExec.update(graphB);

// Execute several iterations of the graph for 2nd set of buffers
for (unsigned n = 0; n < iterations; n++) {
testQueue.submit([&](handler &cgh) { cgh.graph(graphExec); });
testQueue.submit([&](handler &cgh) { cgh.ext_oneapi_graph(graphExec); });
}

// Perform a wait on all graph submissions.
Expand Down

0 comments on commit e4f7d4d

Please sign in to comment.