This repository was archived by the owner on Mar 28, 2023. It is now read-only.
forked from llvm/llvm-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 130
[SYCL] Adds regression test for reduction resource leak #624
Merged
vladimirlaz
merged 8 commits into
intel:intel
from
steffenlarsen:steffen/reduction_resource_leak
Mar 22, 2022
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8aafdab
[SYCL] Adds regression test for reduction resource leak
steffenlarsen 3c6979e
Add the build command
steffenlarsen 3e14780
Fix check placement
steffenlarsen 0a1828c
Fix typo
steffenlarsen b0a4e76
Attempted fix to test run
steffenlarsen f5bdd8c
Add USM test case
steffenlarsen ee49469
Fix formatting
steffenlarsen 72130d1
Fix top-level USM leak
steffenlarsen 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // REQUIRES: level_zero | ||
| // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out | ||
| // RUN: env ZE_DEBUG=4 %GPU_RUN_PLACEHOLDER %t.out 2>&1 | FileCheck --implicit-check-not "LEAK" %s | ||
|
|
||
| // Tests that additional resources required by discard_write reductions od not | ||
| // leak. | ||
|
|
||
| #include <CL/sycl.hpp> | ||
|
|
||
| using namespace cl::sycl; | ||
|
|
||
| int main() { | ||
| queue Q; | ||
|
|
||
| nd_range<1> NDRange(range<1>{49 * 5}, range<1>{49}); | ||
| std::plus<> BOp; | ||
|
|
||
| buffer<int, 1> OutBuf(1); | ||
| buffer<int, 1> InBuf(49 * 5); | ||
| Q.submit([&](handler &CGH) { | ||
| auto In = InBuf.get_access<access::mode::read>(CGH); | ||
| auto Out = OutBuf.get_access<access::mode::discard_write>(CGH); | ||
| auto Redu = ext::oneapi::reduction(Out, 0, BOp); | ||
| CGH.parallel_for<class DiscardSum>( | ||
| NDRange, Redu, [=](nd_item<1> NDIt, auto &Sum) { | ||
| Sum.combine(In[NDIt.get_global_linear_id()]); | ||
| }); | ||
| }); | ||
| 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.