-
Notifications
You must be signed in to change notification settings - Fork 773
[SYCL] Move diagnostic from integration header emission #2644
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 all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
2f5e8ad
[SYCL] Emit diagnostics using Visitor class implementation
srividya-sundaram d50f24b
[SYCL] Fix failing tests
srividya-sundaram 660cb95
Use cl::sycl namespace
srividya-sundaram a6d0df0
set IsInvalid=true for null ptr type kernel name
srividya-sundaram 7cd339d
Revert IsInvalid=true for nullptr type kernel name
srividya-sundaram 55d4311
Fix CodeGenSYCL/template-template-parameter.cpp
srividya-sundaram 643bc94
Add Visitor method to handle template parameter pack in kernel names
srividya-sundaram 65a3fcc
Merge branch 'sycl' into std-ns-diag
srividya-sundaram 954bbfb
Address review comments
srividya-sundaram 80e6bab
Merge branch 'std-ns-diag' of https://github.com/srividya-sundaram/ll…
srividya-sundaram 5379751
clang-format fix
srividya-sundaram 44e36d3
Remove note
srividya-sundaram b316aa5
Move test from CodeGenSYCL to SemaSYCL
srividya-sundaram 2b5b3e9
Fix incorrect line number in Inputs/sycl.hpp
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 was deleted.
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
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,55 @@ | ||
// RUN: %clang_cc1 -fsycl -fsycl-is-device -sycl-std=2020 -DCHECK_ERROR -verify %s | ||
|
||
#include "Inputs/sycl.hpp" | ||
|
||
namespace std { | ||
typedef long unsigned int size_t; | ||
typedef long int ptrdiff_t; | ||
typedef decltype(nullptr) nullptr_t; | ||
class T; | ||
class U; | ||
} // namespace std | ||
|
||
template <typename T> | ||
struct Templated_kernel_name; | ||
|
||
template <typename T, typename... Args> class TemplParamPack; | ||
|
||
using namespace cl::sycl; | ||
queue q; | ||
|
||
int main() { | ||
#ifdef CHECK_ERROR | ||
// expected-error@Inputs/sycl.hpp:220 5 {{kernel name cannot be a type in the "std" namespace}} | ||
q.submit([&](handler &h) { | ||
// expected-note@+1{{in instantiation of function template specialization}} | ||
h.single_task<std::nullptr_t>([=] {}); | ||
}); | ||
q.submit([&](handler &h) { | ||
// expected-note@+1{{in instantiation of function template specialization}} | ||
h.single_task<std::T>([=] {}); | ||
}); | ||
q.submit([&](handler &h) { | ||
// expected-note@+1{{in instantiation of function template specialization}} | ||
h.single_task<Templated_kernel_name<std::nullptr_t>>([=] {}); | ||
}); | ||
q.submit([&](handler &h) { | ||
// expected-note@+1{{in instantiation of function template specialization}} | ||
h.single_task<Templated_kernel_name<std::U>>([=] {}); | ||
}); | ||
q.submit([&](handler &cgh) { | ||
// expected-note@+1{{in instantiation of function template specialization}} | ||
cgh.single_task<TemplParamPack<int, float, std::nullptr_t, double>>([]() {}); | ||
}); | ||
#endif | ||
|
||
// Although in the std namespace, these resolve to builtins such as `int` that are allowed in kernel names | ||
q.submit([&](handler &h) { | ||
h.single_task<std::size_t>([=] {}); | ||
}); | ||
q.submit([&](handler &h) { | ||
h.single_task<std::ptrdiff_t>([=] {}); | ||
}); | ||
|
||
return 0; | ||
} |
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
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.