Skip to content
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

[SYCL][DOC] Add ext_intel_virtual_functions specification #10540

Open
wants to merge 57 commits into
base: sycl
Choose a base branch
from

Conversation

AlexeySachkov
Copy link
Contributor

No description provided.

Add a note that the extension does not intent to support `dynamic_cast`
or `typeid`.

Update properties interface, fix all examples to correctly use new
properties (vatiable templates don't have default template argument
values).
@AlexeySachkov AlexeySachkov marked this pull request as ready for review December 6, 2023 11:58
@AlexeySachkov AlexeySachkov requested review from a team as code owners December 6, 2023 11:58
AlexeySachkov added a commit that referenced this pull request Jul 22, 2024
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
AlexeySachkov added a commit that referenced this pull request Jul 25, 2024
Test plan can be found in #10540. This PR introduces a basic test case
for a scenario where object of a polymorphic class is constructed in one
kernel, but used in another kernel.
hdelan pushed a commit to hdelan/llvm that referenced this pull request Jul 26, 2024
Test plan can be found in intel#10540. This PR introduces a basic test case
for a scenario where object of a polymorphic class is constructed in one
kernel, but used in another kernel.
AlexeySachkov added a commit that referenced this pull request Aug 5, 2024
Implementation design explaining those changes in a bigger picture can
be found in #10540

Key things implemented here:
- device code split to outline virtual functions into separate device
images
- emission of new properties for virtual functions
- generation of `calls-indirectly` LLVM IR attribute for kernels that
construct objects with virtual functions, but don't do calls
- device image manipulations to cleanup or preserve virtual functions
depending on a device image

Even though those pieces are technically independent from each other, it
is hard to split them apart into separate PRs, because they all have to
be either present or absent for existing E2E tests for virtual functions
to work.
AlexeySachkov added a commit to AlexeySachkov/llvm that referenced this pull request Aug 7, 2024
Corresponding SYCL extension proposal (intel#10540) has been
recently updated to change naming of properties it introduces.

This patch aligns the implementation with the proposed extension spec.
AlexeySachkov added a commit that referenced this pull request Aug 9, 2024
Corresponding SYCL extension proposal (#10540) has been
recently updated to change naming of properties it introduces.

This patch aligns the implementation with the proposed extension spec.
functions they may call, the extension introduces new compile-time-constant
properties.

[source,dpcpp]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May these "[source,dpcpp]" be changed to "```c++"? Otherwise, the syntax is not highlighted.

};

struct calls_indirectly_key {
template <typename First, typename... SetIds>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed offline - typename First likely can be omitted.

KornevNikita added a commit to KornevNikita/llvm that referenced this pull request Sep 26, 2024
This allows calls_indirectly property to handle all passed template
arguments, but not the only first one.

Also applying some minor changes to the spec.

Spec & Design: intel#10540
AlexeySachkov pushed a commit that referenced this pull request Oct 1, 2024
This allows calls_indirectly property to handle all passed template
arguments, but not the only first one.

Also applying some minor changes to the spec.

Spec & Design: #10540
KornevNikita added a commit to KornevNikita/llvm that referenced this pull request Oct 2, 2024
AlexeySachkov pushed a commit that referenced this pull request Nov 6, 2024
AlexeySachkov added a commit to AlexeySachkov/llvm that referenced this pull request Nov 26, 2024
Corresponding SYCL extension proposal (intel#10540) has been
recently updated to change naming of properties it introduces.

This patch aligns the implementation with the proposed extension spec.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants