-
Notifications
You must be signed in to change notification settings - Fork 68
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
Allow any manifestly constant-evaluated expression and conversion in device function #388
Allow any manifestly constant-evaluated expression and conversion in device function #388
Conversation
This should address KhronosGroup#267
Look good enough to get us started :). In theory, if recursion is tail-recurvice if you be allowed to (as it will not need a call stack on the GPU) |
You assume that the compiler is smart enough to replace a tail-recursion by a loop. What if |
I agree with Ronan, |
https://reviews.llvm.org/D99517, LLVM have now a pragma that should force it for example. But I see your point that it's "just an optimization". Same as The goal is only to ensure that the generated accelerator backend code should not have recursion; how we achieve this goal can be multiple. |
WG: Better approach is to add sentence about |
In the case of a manifestly constant-evaluated expression or conversion, any code accepted by the C++ standard in this case is also accepted in SYCL device function.
ef19c48
to
bdc8fea
Compare
This has been generalized to address #379 |
bug fix or NEXT or KHR? |
Changing to a draft to wait for SYCL Next. |
Please open MR on GitLab. Thanks! |
I have rebased this PR for SYCL Next as internal https://gitlab.khronos.org/sycl/Specification/-/merge_requests/740 |
Just removing the Draft status to consider this to be closed during next meeting and look at GitLab. |
Recording our decision from the WG meeting on September 26, 2024:
|
(cherry picked from commit bde612085fe849640f3136558e6750895b691509)
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 think this looks good. Just one small comment below.
Take into account Greg Lueck comment KhronosGroup#388 (comment) Also reformat some text to pass the CI.
Co-authored-by: Greg Lueck <[email protected]>
344e8ce
to
54c476e
Compare
Please add "manifestly constant-evaluated expression" as a Glossary term with definition saying it is as defined in the C++20 specification. |
There are a lot of restrictions for kernel code, except when present in a constant evaluated context. This is a test corresponding to the specification clarification introduced by PR KhronosGroup/SYCL-Docs#388
There are a lot of restrictions for kernel code, except when present in a constant evaluated context. This is a test corresponding to the specification clarification introduced by PR KhronosGroup/SYCL-Docs#388
There are a lot of restrictions for kernel code, except when present in a constant evaluated context. This is a test corresponding to the specification clarification introduced by PR KhronosGroup/SYCL-Docs#388
There are a lot of restrictions for kernel code, except when present in a constant evaluated context. This is a test corresponding to the specification clarification introduced by PR KhronosGroup/SYCL-Docs#388
See ISO C++ standard "The if statement [stmt.if]".
WG approved to merge to SYCL 2020 |
…device function Cherry pick KhronosGroup#388 from main (cherry picked from commit 94eb558)
…ion-recursion Allow any manifestly constant-evaluated expression and conversion in device function (cherry picked from commit 94eb558)
This should address #267