-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL] Report Compiling error for recursion in SYCL kernel #3390
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
Changes from all commits
f3e005d
4968d31
1d53420
68c5111
971f2e2
9b17f65
4a3eb37
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ int fib(int n) { | |
|
||
// expected-note@+1 2{{function implemented using recursion declared here}} | ||
void kernel2(void) { | ||
// expected-warning@+1 {{SYCL kernel cannot call a recursive function}} | ||
// expected-error@+1 {{SYCL kernel cannot call a recursive function}} | ||
kernel2(); | ||
} | ||
|
||
|
@@ -24,7 +24,7 @@ void *operator new(size_t); | |
void usage2(myFuncDef functionPtr) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could it be possible to add a test like void kernel3(void) {
if constexpr (false)
kernel3();
if (false)
kernel3();
} and verify it does not fire? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, @keryell There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's reasonable to not diagnose recursion in dead branches, but we should still have test coverage (with comments) that show we've explicitly considered this case. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment is still unaddressed, btw. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @AaronBallman :Note that my patch adds a test for this. See: #3475 |
||
// expected-error@+1 {{SYCL kernel cannot allocate storage}} | ||
int *ip = new int; | ||
// expected-warning@+1 {{SYCL kernel cannot call a recursive function}} | ||
// expected-error@+1 {{SYCL kernel cannot call a recursive function}} | ||
kernel2(); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this diagnostic issued twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still curious about this.