-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL][Graph] Modified the adapters such that it is valid to call release on... #18619
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
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6d28760
Modified the adapters such that it is valid to call release on CB whi…
konradkusiak97 8ec66e8
Modified spec wording and made creating an event branchless on CUDA a…
konradkusiak97 e3a6a53
Added backticks
konradkusiak97 a51c279
Changed to EXPECT_SUCCESS and added queue wait before exiting
konradkusiak97 3953a9a
Brought back additional fence for wait event path
konradkusiak97 2a70f96
Removed explicit sync where necessary
konradkusiak97 20e750c
Retain CB before releasing
konradkusiak97 1efb6d2
Set cmd_buf_handle to nullptr after releasing
konradkusiak97 62fda4b
Added new e2e test and modified the spec
konradkusiak97 a61980e
rephrased
konradkusiak97 f441469
Added execution event sync on CB release in V2 adapter
konradkusiak97 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// RUN: %{build} -o %t.out | ||
// RUN: %{run} %t.out | ||
// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG | ||
// 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 %} | ||
// Extra run to check for immediate-command-list in Level Zero | ||
// RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} | ||
|
||
#define GRAPH_E2E_EXPLICIT | ||
|
||
#include "../Inputs/release_while_executing.cpp" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Tests destroying finalized command_graph before it is finished executing, | ||
// relying on the backends to properly synchronize and wait for the submitted | ||
// work to finish. | ||
|
||
#include "../graph_common.hpp" | ||
|
||
int main() { | ||
queue Queue; | ||
|
||
using T = int; | ||
|
||
std::vector<T> DataA(Size), ReferenceA(Size); | ||
|
||
std::iota(DataA.begin(), DataA.end(), 1); | ||
std::iota(ReferenceA.begin(), ReferenceA.end(), 2); | ||
|
||
T *PtrA = malloc_device<T>(Size, Queue); | ||
|
||
// Create the command_graph in a seperate scope so that it's destroyed before | ||
// Queue.wait() | ||
{ | ||
exp_ext::command_graph Graph{Queue.get_context(), Queue.get_device()}; | ||
|
||
Queue.copy(DataA.data(), PtrA, Size); | ||
Queue.wait_and_throw(); | ||
|
||
auto Node = add_node(Graph, Queue, [&](handler &CGH) { | ||
CGH.parallel_for(Size, [=](item<1> Item) { PtrA[Item.get_id()] += 1; }); | ||
}); | ||
|
||
auto GraphExec = Graph.finalize(); | ||
Queue.submit([&](handler &CGH) { CGH.ext_oneapi_graph(GraphExec); }); | ||
} | ||
|
||
Queue.wait_and_throw(); | ||
|
||
Queue.copy(PtrA, DataA.data(), Size); | ||
Queue.wait_and_throw(); | ||
|
||
free(PtrA, Queue); | ||
|
||
for (size_t i = 0; i < Size; i++) { | ||
assert(check_value(i, ReferenceA[i], DataA[i], "DataA")); | ||
} | ||
|
||
return 0; | ||
} |
10 changes: 10 additions & 0 deletions
10
sycl/test-e2e/Graph/RecordReplay/release_while_executing.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// RUN: %{build} -o %t.out | ||
// RUN: %{run} %t.out | ||
// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG | ||
// 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 %} | ||
// Extra run to check for immediate-command-list in Level Zero | ||
// RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} | ||
|
||
#define GRAPH_E2E_RECORD_REPLAY | ||
|
||
#include "../Inputs/release_while_executing.cpp" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
konradkusiak97 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.