-
Notifications
You must be signed in to change notification settings - Fork 743
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][clang] Emit default template arguments in integration header #16005
Merged
sommerlukas
merged 10 commits into
intel:sycl
from
Fznamznon:default-template-args-int-header
Nov 18, 2024
Merged
[SYCL][clang] Emit default template arguments in integration header #16005
sommerlukas
merged 10 commits into
intel:sycl
from
Fznamznon:default-template-args-int-header
Nov 18, 2024
Commits on Nov 6, 2024
-
[SYCL][clang] Emit default template arguments in integration header
For free function kernels support clang forward declares the kernel itself as well as its parameter types. In case a free function kernel has a parameter that is templated and has a default template argument, all template arguments including arguments that match default arguments must be printed in kernel's forward declarations, for example ``` template <typename T, typename = int> struct Arg { T val; }; // For the kernel SYCL_EXT_ONEAPI_FUNCTION_PROPERTY( (ext::oneapi::experimental::nd_range_kernel<1>)) void foo(Arg<int> arg) { arg.val = 42; } // Integration header must contain void foo(Arg<int, int> arg); ``` Unfortunately, even though integration header emission already has extensive support for forward declarations priting, some modifications to clang's type printing are still required. infrastructure, since neither of existing PrintingPolicy flags help to reach the correct result. Using `SuppressDefaultTemplateArgs = true` doesn't help without printing canonical types, printing canonical types for the case like ``` template <typename T> SYCL_EXT_ONEAPI_FUNCTION_PROPERTY( (ext::oneapi::experimental::nd_range_kernel<1>)) void foo(Arg<T> arg) { arg.val = 42; } // Printing canonical types is causing the following integration header template <typename T> void foo(Arg<type-parameter-0-0, int> arg); ``` Using `SkipCanonicalizationOfTemplateTypeParms` field of printing policy doesn't help here since at the one point where it is checked we take canonical type of `Arg`, not its parameters and it will contain template argument types in canonical type after that.
Configuration menu - View commit details
-
Copy full SHA for c3cdacb - Browse repository at this point
Copy the full SHA c3cdacbView commit details -
Configuration menu - View commit details
-
Copy full SHA for da51a19 - Browse repository at this point
Copy the full SHA da51a19View commit details
Commits on Nov 8, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 6ba5063 - Browse repository at this point
Copy the full SHA 6ba5063View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3e0e4bb - Browse repository at this point
Copy the full SHA 3e0e4bbView commit details
Commits on Nov 11, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 4f091c0 - Browse repository at this point
Copy the full SHA 4f091c0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7e2272f - Browse repository at this point
Copy the full SHA 7e2272fView commit details -
Configuration menu - View commit details
-
Copy full SHA for e206684 - Browse repository at this point
Copy the full SHA e206684View commit details -
Configuration menu - View commit details
-
Copy full SHA for aded78e - Browse repository at this point
Copy the full SHA aded78eView commit details
Commits on Nov 14, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 30ff224 - Browse repository at this point
Copy the full SHA 30ff224View commit details -
Configuration menu - View commit details
-
Copy full SHA for e2779e8 - Browse repository at this point
Copy the full SHA e2779e8View commit details
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.