-
Notifications
You must be signed in to change notification settings - Fork 805
[SYCL] Re-implement diagnostics about virtual calls #14141
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
AlexeySachkov
merged 16 commits into
intel:sycl
from
AlexeySachkov:private/asachkov/virtual-functions-diagnostics
Jul 22, 2024
Merged
[SYCL] Re-implement diagnostics about virtual calls #14141
AlexeySachkov
merged 16 commits into
intel:sycl
from
AlexeySachkov:private/asachkov/virtual-functions-diagnostics
Jul 22, 2024
Conversation
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
With `sycl_ext_oneapi_virtual_functions` extensions we would like to allow certain kernels to perform virtual function calls. That is if they were submitted with the right properties. That means that instead of simply checking for presence of virtual function calls in device code, we need to analyze call chain to see how exactly a kernel performing such call is defined. This is not a task for the front-end and therefore the diagnostics mechanism is moved to a pass, as suggested by the implementation design proposed in intel#10540
…ual-functions-diagnostics
…ual-functions-diagnostics
AlexeySachkov
added a commit
that referenced
this pull request
Jul 12, 2024
This commit is a part of virtual functions extension implementation that is proposed in #10540. As part of the feature, we would like to achieve both: - allow virtual function calls from SYCL kernels that are submitted with the right properties as described in the language extension specification - disallow virtual function calls from SYCL kernels that do not use any (or the right) properties to conform with the core SYCL 2020 specification Implementing such diagnostics will require call graph traversal to understand the origin of the call and that is not what's easy to do in FE. Therefore, the implementation design for virtual functions proposes that such diagnostic is offloaded to a pass. The draft of the analysis pass implementation can be seen in #14141 This commit is a preparations for it: it introduces an attribute to all virtual function calls in device code so they can be easily detected and not confused with plain function pointer calls (for which we don't have a language specification and therefore well-defined behavior yet). Note that the new approach will relax virtual function call diagnostics, because it will allow non-virtual calls to virtual functions to be performed from kernels. This is in line with discussion in KhronosGroup/SYCL-Docs#565 about relaxing current SYCL 2020 restrictions about virtual functions.
sarnex
approved these changes
Jul 16, 2024
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.
lgtm, just minor comments!
mdtoguchi
approved these changes
Jul 16, 2024
…ual-functions-diagnostics
maarquitos14
approved these changes
Jul 18, 2024
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.
LGTM.
elizabethandrews
approved these changes
Jul 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
With
sycl_ext_oneapi_virtual_functions
extensions we would like to allow certain kernels to perform virtual function calls. That is if they were submitted with the right properties.That means that instead of simply checking for presence of virtual function calls in device code, we need to analyze call chain to see how exactly a kernel performing such call is defined.
This is not a task for the front-end and therefore the diagnostics mechanism is moved to a pass, as suggested by the implementation design proposed in #10540