-
Notifications
You must be signed in to change notification settings - Fork 794
[SYCL] Fix resource leak related to SYCL_FALLBACK_ASSERT #12532
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
aelovikov-intel
merged 4 commits into
intel:sycl
from
aelovikov-intel:fix-fallback-assert
Jan 31, 2024
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
75ed135
[SYCL] Fix resource leak related to SYCL_FALLBACK_ASSERT
aelovikov-intel 25b294d
Remove old AssertHappened buffer in preview mode
aelovikov-intel 199ee9b
clang-format
aelovikov-intel 9e3377a
Remove UR_L0_LEAKS_DEBUG from the test and disable on HIP
aelovikov-intel 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
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,32 @@ | ||
// RUN: %{build} -o %t.out | ||
// RUN: %{run} %t.out | ||
|
||
// Device globals aren't supported on opencl:gpu yet. | ||
// UNSUPPORTED: opencl && gpu | ||
|
||
// TODO: Fails at JIT compilation for some reason. | ||
// UNSUPPORTED: hip | ||
#define SYCL_FALLBACK_ASSERT 1 | ||
|
||
#include <sycl/sycl.hpp> | ||
|
||
// DeviceGlobalUSMMem::~DeviceGlobalUSMMem() has asserts to ensure some | ||
// resources have been cleaned up when it's executed. Those asserts used to fail | ||
// when "AssertHappened" buffer used in fallback implementation of the device | ||
// assert was a data member of the queue_impl. | ||
sycl::ext::oneapi::experimental::device_global<int32_t> dg; | ||
|
||
int main() { | ||
sycl::queue q; | ||
q.submit([&](sycl::handler &cgh) { | ||
sycl::range<1> R{16}; | ||
cgh.parallel_for(sycl::nd_range<1>{R, R}, [=](sycl::nd_item<1> ndi) { | ||
if (ndi.get_global_linear_id() == 0) | ||
dg.get() = 42; | ||
auto sg = sycl::ext::oneapi::experimental::this_sub_group(); | ||
auto active = sycl::ext::oneapi::group_ballot(sg, 1); | ||
}); | ||
}).wait(); | ||
|
||
return 0; | ||
} |
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.