19 #include <type_traits>
24 namespace ext::oneapi {
25 template <
typename T,
typename Group>
27 std::is_trivially_destructible<T>::value &&
28 sycl::detail::is_group<Group>::value,
29 multi_ptr<T, access::address_space::local_space, access::decorated::legacy>>
32 #ifdef __SYCL_DEVICE_ONLY__
34 __sycl_allocateLocalMemory(
sizeof(T),
alignof(T));
35 return reinterpret_cast<__attribute__((opencl_local)) T *
>(AllocatedMem);
38 "sycl_ext_oneapi_local_memory extension is not supported on host device",
39 PI_ERROR_INVALID_OPERATION);
43 template <
typename T,
typename Group,
typename... Args>
45 std::is_trivially_destructible<T>::value &&
46 sycl::detail::is_group<Group>::value,
50 #ifdef __SYCL_DEVICE_ONLY__
52 __sycl_allocateLocalMemory(
sizeof(T),
alignof(T));
55 id<3> Id = __spirv::initLocalInvocationId<3, id<3>>();
56 if (Id ==
id<3>(0, 0, 0))
57 new (AllocatedMem) T(std::forward<Args>(args)...);
59 return reinterpret_cast<__attribute__((opencl_local)) T *
>(AllocatedMem);
64 "sycl_ext_oneapi_local_memory extension is not supported on host device",
65 PI_ERROR_INVALID_OPERATION);
Provides constructors for address space qualified and non address space qualified pointers to allow i...
#define __SYCL_INLINE_VER_NAMESPACE(X)
#define __SYCL_ALWAYS_INLINE
typename std::enable_if< B, T >::type enable_if_t
static void workGroupBarrier()
__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< T >::value &&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< T >::value &&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)
---— Error handling, matching OpenCL plugin semantics.