-
Notifications
You must be signed in to change notification settings - Fork 752
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL] Add support for __registered_kernels__ (#16485)
This change adds support for a new attribute ``__sycl_detail::__registered_kernels__``, which appears at translation unit scope. The parameter for this attribute is a list of pairs like: ``` [[__sycl_detail__::__registered_kernels__( {"foo", foo}, {"(void(*)(int, int*))iota", (void(*)(int, int*))iota}, {"kernel<float>", kernel<float>} )]]; ``` The first element in each pair is a string, and the second element is a constant expressiton for a pointer to a SYCL free function kernel. The change creates the kernel's wrapper function and generates module-level metadata of the form: ``` !sycl_registered_kernels = !{!0, !1} !0 = !{!"foo", !"mangled-name-of-wrapper-for-foo"} !1 = !{!"kernel<float>", !"mangled-name-of-wrapper-for-kernel<float>"} ``` where the first element in the pair of strings, is the first element of the pair in ``__registered_kernels__`` and the second element is the mangled named of the wrapper corresponding to the free function.
- Loading branch information
1 parent
8af1eb3
commit 745423b
Showing
11 changed files
with
411 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.