-
Notifications
You must be signed in to change notification settings - Fork 803
[SYCL][NFC] Update FE tests to have a common infrastructure #2996
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 6 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
3207cc2
[SYCL] Update FE tests to have a common infrastructure
srividya-sundaram 39966fc
Avoid using "cl::sycl" namespace
srividya-sundaram 2d69057
Update accessors-targets.cpp
srividya-sundaram bbbba5f
Update allow-constexpr-recursion.cpp
srividya-sundaram 04b1200
Remove unused code
srividya-sundaram 2a169a4
Update array-kernel-param-neg.cpp
srividya-sundaram d1e96fa
Inline "cl" namespace and update tests
srividya-sundaram 4f006e7
Update basic-kernel-wrapper.cpp
srividya-sundaram bbd4ff7
Update half-kernel-arg.cpp
srividya-sundaram ecccf60
Update fake-accessors.cpp
srividya-sundaram 014f3e7
Update decomposition.cpp
srividya-sundaram 0a916bf
Update spec-const-kernel-arg.cpp
srividya-sundaram aca853d
Update sampler.cpp
srividya-sundaram d1cbee3
Update streams.cpp
srividya-sundaram cf36c62
Update accessor_inheritance.cpp
srividya-sundaram a35dbb8
Update wrapped-accessor.cpp
srividya-sundaram 2ccb46a
Update array-kernel-param.cpp
srividya-sundaram 184df8b
Include sycl runtime headers as system headers.
srividya-sundaram a63ea02
Address review comments
srividya-sundaram c06c365
Add -syc-std=2020
srividya-sundaram d4942b8
Fix fake-accessors test
srividya-sundaram 7a0a3bf
Remove necessary comment
srividya-sundaram 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 |
|---|---|---|
| @@ -1,43 +1,49 @@ | ||
| // RUN: %clang_cc1 -fsycl -fsycl-is-device -fcxx-exceptions -Wno-sycl-2017-compat -verify -fsyntax-only %s | ||
| // RUN: %clang_cc1 -fsycl -fsycl-is-device -fcxx-exceptions -sycl-std=2020 -verify -fsyntax-only %s | ||
|
|
||
| // This test checks if compiler reports compilation error on an attempt to pass | ||
| // an array of non-trivially copyable structs as SYCL kernel parameter or | ||
| // a non-constant size array. | ||
|
|
||
| struct B { | ||
| #include "Inputs/sycl.hpp" | ||
|
|
||
| cl::sycl::queue q; | ||
srividya-sundaram marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| struct NonTrivialCopyStruct { | ||
| int i; | ||
| B(int _i) : i(_i) {} | ||
| B(const B &x) : i(x.i) {} | ||
| NonTrivialCopyStruct(int _i) : i(_i) {} | ||
| NonTrivialCopyStruct(const NonTrivialCopyStruct &x) : i(x.i) {} | ||
| }; | ||
|
|
||
| struct D { | ||
| struct NonTrivialDestructorStruct { | ||
| int i; | ||
| ~D(); | ||
| ~NonTrivialDestructorStruct(); | ||
| }; | ||
|
|
||
| class E { | ||
| class Array { | ||
| // expected-error@+1 {{kernel parameter is not a constant size array}} | ||
| int i[]; | ||
| int NonConstantSizeArray[]; | ||
|
|
||
| public: | ||
| int operator()() const { return i[0]; } | ||
| int operator()() const { return NonConstantSizeArray[0]; } | ||
| }; | ||
|
|
||
| template <typename Name, typename Func> | ||
| __attribute__((sycl_kernel)) void kernel_single_task(const Func &kernelFunc) { | ||
| kernelFunc(); | ||
| } | ||
|
|
||
| void test() { | ||
| B nsl1[4] = {1, 2, 3, 4}; | ||
| D nsl2[5]; | ||
| E es; | ||
| kernel_single_task<class kernel_capture_refs>([=] { | ||
| // expected-error@+1 {{kernel parameter has non-trivially copy constructible class/struct type}} | ||
| int b = nsl1[2].i; | ||
| // expected-error@+1 {{kernel parameter has non-trivially destructible class/struct type}} | ||
| int d = nsl2[4].i; | ||
| NonTrivialCopyStruct NTCSObject[4] = {1, 2, 3, 4}; | ||
| NonTrivialDestructorStruct NTDSObject[5]; | ||
| // expected-note@+1 {{'UnknownSizeArrayObj' declared here}} | ||
| Array UnknownSizeArrayObj; | ||
|
|
||
| q.submit([&](cl::sycl::handler &h) { | ||
| h.single_task<class kernel_capture_refs>([=] { | ||
| // expected-error@+1 {{kernel parameter has non-trivially copy constructible class/struct type}} | ||
| int b = NTCSObject[2].i; | ||
| // expected-error@+1 {{kernel parameter has non-trivially destructible class/struct type}} | ||
| int d = NTDSObject[4].i; | ||
| }); | ||
| }); | ||
|
|
||
| kernel_single_task<class kernel_bad_array>(es); | ||
| q.submit([&](cl::sycl::handler &h) { | ||
| // expected-error@+1 {{variable 'UnknownSizeArrayObj' with flexible array member cannot be captured in a lambda expression}} | ||
| h.single_task<class kernel_bad_array>(UnknownSizeArrayObj); | ||
| }); | ||
| } | ||
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.