Skip to content

Commit

Permalink
[SYCL][COMPAT] Avoid local memory initialization through group_local_…
Browse files Browse the repository at this point in the history
…memory_for_overwrite (#12836)

group_local_memory becomes an issue for performance due to the
initialization phase.
group_local_memory_for_overwrite allocates memory similarly without
initialization, so, if initialization is needed, the user is now
responsible for it.

More info:
https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/supported/sycl_ext_oneapi_local_memory.asciidoc
  • Loading branch information
Alcpz authored Feb 28, 2024
1 parent f7c26d9 commit d7fb328
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sycl/include/syclcompat/memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace syclcompat {

template <typename AllocT> auto *local_mem() {
sycl::multi_ptr<AllocT, sycl::access::address_space::local_space>
As_multi_ptr = sycl::ext::oneapi::group_local_memory<AllocT>(
As_multi_ptr = sycl::ext::oneapi::group_local_memory_for_overwrite<AllocT>(
sycl::ext::oneapi::experimental::this_nd_item<3>().get_group());
auto *As = *As_multi_ptr;
return As;
Expand Down

0 comments on commit d7fb328

Please sign in to comment.