-
Notifications
You must be signed in to change notification settings - Fork 802
[SYCL] Test for fix of linked alloca's deps #1470
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
bader
merged 16 commits into
intel:sycl
from
s-kanaev:private/s-kanaev/fix-linked-allocacmd-deps
Aug 3, 2020
Merged
Changes from 5 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
d8297bd
[SYCL] Fix linked AllocaCmd dependencies
0d10b3d
Merge branch 'sycl' into private/s-kanaev/fix-linked-allocacmd-deps
5a44580
[SYCL] Add test
49a8909
[SYCL] Fix test
462ee07
[SYCL] Fix test
c8960d8
Merge branch 'sycl' into private/s-kanaev/fix-linked-allocacmd-deps
704fdb0
[SYCL] Add unit-test
0abc928
[SYCL] Fix lit test
e84cad7
[SYCL] Fix style issue
fa0dda4
[SYCL] Fix style issue
658b057
[SYCL] Fix lit test
107fe7f
[SYCL] Apply suggestion
83e7688
Merge branch 'sycl' into private/s-kanaev/fix-linked-allocacmd-deps
897b1b1
[SYCL] Remove redundant test
b85c3df
Merge remote-tracking branch 'public/sycl' into private/s-kanaev/fix-…
ba8a54d
[SYCL] Fix testing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -I %sycl_source_dir %s -o %t.out | ||
| // RUN: env SYCL_PRINT_EXECUTION_GRAPH=always %t.out | ||
| // RUN: cat graph_7after_addHostAccessor.dot | ||
| // RUN: cat graph_7after_addHostAccessor.dot | FileCheck %s | ||
|
|
||
| #include <CL/sycl.hpp> | ||
|
|
||
| namespace S = cl::sycl; | ||
|
|
||
| void test() { | ||
| auto EH = [](S::exception_list EL) { | ||
| for (const std::exception_ptr &E : EL) { | ||
| throw E; | ||
| } | ||
| }; | ||
|
|
||
| S::queue Queue(EH); | ||
|
|
||
| static const size_t BSIZE = 10; | ||
| S::buffer<int, 1> Buf{BSIZE}; | ||
|
|
||
| // 0. submit kernel | ||
| Queue.submit([&](S::handler &CGH) { | ||
| S::accessor<int, 1, S::access::mode::write, | ||
| S::access::target::global_buffer> | ||
| GeneratorAcc(Buf, CGH); | ||
|
|
||
| auto GeneratorKernel = [GeneratorAcc]() { | ||
| for (size_t Idx = 0; Idx < GeneratorAcc.get_count(); ++Idx) | ||
| GeneratorAcc[Idx] = BSIZE - Idx; | ||
| }; | ||
|
|
||
| CGH.single_task<class GeneratorTask0>(GeneratorKernel); | ||
| }); | ||
| // 1. create host-accessor | ||
| { | ||
| S::accessor<int, 1, S::access::mode::write, | ||
| S::access::target::host_buffer> | ||
| Acc(Buf); | ||
|
|
||
| for (size_t Idx = 0; Idx < Acc.get_count(); ++Idx) | ||
| Acc[Idx] = -1; | ||
| } | ||
|
|
||
| // 2. submit kernel | ||
| Queue.submit([&](S::handler &CGH) { | ||
| S::accessor<int, 1, S::access::mode::write, | ||
| S::access::target::global_buffer> | ||
| GeneratorAcc(Buf, CGH); | ||
|
|
||
| auto GeneratorKernel = [GeneratorAcc]() { | ||
s-kanaev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| for (size_t Idx = 0; Idx < GeneratorAcc.get_count(); ++Idx) | ||
| GeneratorAcc[Idx] = Idx; | ||
| }; | ||
|
|
||
| CGH.single_task<class GeneratorTask>(GeneratorKernel); | ||
| }); | ||
|
|
||
| // 3. create host-accessor | ||
| { | ||
| S::accessor<int, 1, S::access::mode::write, | ||
| S::access::target::host_buffer> | ||
| Acc(Buf); | ||
|
|
||
| bool Failure = false; | ||
| for (size_t Idx = 0; Idx < Acc.get_count(); ++Idx) { | ||
| fprintf(stderr, "Buffer [%03zu] = %i\n", Idx, Acc[Idx]); | ||
| Failure |= (Acc[Idx] != Idx); | ||
| } | ||
|
|
||
| assert(!Failure || "Invalid data in buffer"); | ||
| } | ||
| } | ||
|
|
||
| int main(void) { | ||
| test(); | ||
|
|
||
| return 0; | ||
| } | ||
|
|
||
| // CHECK: "[[MAP_ON_CPU:0x[0-9a-fA-F]+]]"{{.*}} MAP ON | ||
| // CHECK: "[[MAP_ON_CPU]]" -> "[[MAP_DEP_1:0x[0-9a-fA-F]+]]" | ||
| // CHECK: "[[MAP_ON_CPU]]" -> "[[MAP_DEP_2:0x[0-9a-fA-F]+]]" | ||
| // CHECK: "[[MAP_DEP_2]]"{{.*}}\nEXEC CG ON | ||
| // CHECK: "[[MAP_DEP_1]]"{{.*}}\nALLOCA ON HOST | ||
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.