17 #include <type_traits>
19 #ifdef __SYCL_DEVICE_ONLY__
22 __sycl_allocateLocalMemory(std::size_t Size, std::size_t
Alignment);
26 inline namespace _V1 {
27 namespace ext::oneapi {
28 template <
typename T,
typename Group>
30 std::is_trivially_destructible_v<T> && sycl::detail::is_group<Group>::value,
31 multi_ptr<T, access::address_space::local_space, access::decorated::legacy>>
34 #ifdef __SYCL_DEVICE_ONLY__
36 __sycl_allocateLocalMemory(
sizeof(T),
alignof(T));
38 if constexpr (!std::is_trivial_v<T>) {
39 if (g.get_local_linear_id() == 0)
43 return reinterpret_cast<__attribute__((opencl_local)) T *
>(AllocatedMem);
46 sycl::errc::feature_not_supported,
47 "sycl_ext_oneapi_local_memory extension is not supported on host");
51 template <
typename T,
typename Group,
typename... Args>
53 std::is_trivially_destructible_v<T> && sycl::detail::is_group<Group>::value,
56 #ifdef __SYCL_DEVICE_ONLY__
58 __sycl_allocateLocalMemory(
sizeof(T),
alignof(T));
59 if (g.get_local_linear_id() == 0)
60 new (AllocatedMem) T{std::forward<Args>(args)...};
62 return reinterpret_cast<__attribute__((opencl_local)) T *
>(AllocatedMem);
68 sycl::errc::feature_not_supported,
69 "sycl_ext_oneapi_local_memory extension is not supported on host");
#define __SYCL_ALWAYS_INLINE
#define __DPCPP_SYCL_EXTERNAL
__attribute__((always_inline)) auto invoke_simd(sycl
The invoke_simd free function invokes a SIMD function using all work-items in a sub_group.
std::enable_if_t< std::is_trivially_destructible_v< T > &&sycl::detail::is_group< Group >::value, multi_ptr< T, access::address_space::local_space, access::decorated::legacy > > __SYCL_ALWAYS_INLINE group_local_memory_for_overwrite(Group g)
std::enable_if_t< std::is_trivially_destructible_v< T > &&sycl::detail::is_group< Group >::value, multi_ptr< T, access::address_space::local_space, access::decorated::legacy > > __SYCL_ALWAYS_INLINE group_local_memory(Group g, Args &&...args)