-
Notifications
You must be signed in to change notification settings - Fork 738
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 specialization constant-length alloca extension proposal #12660
Conversation
Document extension proposal for specialization constant length private memory allocations. Users will be able to perform dynamic memory allocations using specialization constants and a new `private_alloca` function returning a `private_ptr` that will be automatically freed on function return. This is included as an experimental extension as implementation will shortly follow once the extension is approved. Signed-off-by: Victor Perez <victor.perez@codeplay.com>
@v-klochkov proposed an additional variant of namespace sycl::ext::oneapi::experimental {
template <typename ElementType, auto &SpecName,
access::decorated DecorateAddress, std::size_t Alignment>
private_ptr<ElementType, DecorateAddress>
aligned_private_alloca(kernel_handler &h);
} // namespace sycl::ext::oneapi::experimental i.e., receiving the alignment as an additional template argument. This goes in line with other functions in C++ and SYCL like |
sycl/doc/extensions/experimental/sycl_ext_oneapi_spec_constant_length_alloca.asciidoc
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/experimental/sycl_ext_oneapi_spec_constant_length_alloca.asciidoc
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/experimental/sycl_ext_oneapi_spec_constant_length_alloca.asciidoc
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/experimental/sycl_ext_oneapi_spec_constant_length_alloca.asciidoc
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/experimental/sycl_ext_oneapi_spec_constant_length_alloca.asciidoc
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/experimental/sycl_ext_oneapi_spec_constant_length_alloca.asciidoc
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/experimental/sycl_ext_oneapi_spec_constant_length_alloca.asciidoc
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/experimental/sycl_ext_oneapi_spec_constant_length_alloca.asciidoc
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/experimental/sycl_ext_oneapi_spec_constant_length_alloca.asciidoc
Outdated
Show resolved
Hide resolved
Signed-off-by: Victor Perez <victor.perez@codeplay.com>
76a8d16
to
50bcc0b
Compare
@victor-eds What is the default alignment for non aligned version of the function? template <typename ElementType, access::decorated DecorateAddress, std::size_t Alignment = sizeof(ElementType)>
private_ptr<ElementType, DecorateAddress>
private_alloca(const specialization_constant<std::size_t> &size); |
Default alignment should be Having a second template <typename ElementType, std::size_t Alignment, auto &SpecName,
access::decorated DecorateAddress>
private_ptr<ElementType, DecorateAdress>
aligned_private_alloca(kernel_handler &kh); Can be more easily transformed to: template <typename ElementType, std::size_t Alignment, auto &SpecName,
access::decorated DecorateAddress = /*default*/>
private_ptr<ElementType, DecorateAdress>
aligned_private_alloca(kernel_handler &kh); WDYT? |
@v-klochkov I added the second signature. Feel free to comment. |
sycl/doc/extensions/experimental/sycl_ext_oneapi_spec_constant_length_alloca.asciidoc
Outdated
Show resolved
Hide resolved
Signed-off-by: Victor Perez <victor.perez@codeplay.com>
d61b905
to
c18c5c5
Compare
sycl/doc/extensions/experimental/sycl_ext_oneapi_spec_constant_length_alloca.asciidoc
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/experimental/sycl_ext_oneapi_spec_constant_length_alloca.asciidoc
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/experimental/sycl_ext_oneapi_spec_constant_length_alloca.asciidoc
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/experimental/sycl_ext_oneapi_spec_constant_length_alloca.asciidoc
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/experimental/sycl_ext_oneapi_spec_constant_length_alloca.asciidoc
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/experimental/sycl_ext_oneapi_spec_constant_length_alloca.asciidoc
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/experimental/sycl_ext_oneapi_spec_constant_length_alloca.asciidoc
Outdated
Show resolved
Hide resolved
Signed-off-by: Victor Perez <victor.perez@codeplay.com>
6d7a363
to
609a863
Compare
This PR has been approved by the required reviewers, but, as you also provided feedback, can you please confirm current status looks good to you? Please, resolve the open alignment conversation if so. Thanks! |
@victor-eds, could you change the file name from |
Done (#12881). Thanks for pointing out! |
Document extension proposal for specialization constant length private memory allocations. Users will be able to perform dynamic memory allocations using specialization constants and new
private_alloca
andaligned_private_alloca
functions returning aprivate_ptr
to a memory region of automatic storage duration.This is included as an experimental extension as implementation will shortly follow once the extension is approved.