25 template<
typename TAllocator>
27 &&
requires(TAllocator alloc,
void* ptr, std::size_t bytes, std::size_t align) {
29 alloc.allocate(bytes, align)
30 } -> std::same_as<void*>;
31 alloc.deallocate(ptr);
40 template<
typename TDev,
typename TElem,
typename TDim,
typename TIdx,
typename TSfinae =
void>
44 template<
typename TDev,
typename TElem,
typename TDim,
typename TIdx,
typename TSfinae =
void>
48 template<
typename TElem,
typename TDim,
typename TIdx,
typename TDev,
typename TSfinae =
void>
52 template<
typename TElem,
typename TDim,
typename TIdx,
typename TDev,
typename TSfinae =
void>
56 template<
typename TDim,
typename TDev>
62 template<
typename TPlatform,
typename TElem,
typename TDim,
typename TIdx>
66 template<
typename TPlatform>
72 template<
typename TPlatform,
typename TElem,
typename TDim,
typename TIdx>
82 typename TSfinae =
void>
92 typename TSfinae =
void>
96 template<
typename TBuf>
102 template<
typename TDev,
typename TElem,
typename TDim,
typename TIdx>
106 template<
typename TDev,
typename TElem,
typename TDim,
typename TIdx>
118 template<
typename TElem,
typename TIdx =
void,
typename TExtent =
void,
typename TDev =
void>
121 using Idx = std::conditional_t<std::is_void_v<TIdx>,
Idx<TExtent>, TIdx>;
136 template<
typename TElem,
typename TIdx =
void,
typename TExtent =
void,
typename TDev =
void,
typename TAllocator>
137 requires concepts::Allocator<std::remove_cvref_t<TAllocator>>
140 using Idx = std::conditional_t<std::is_void_v<TIdx>,
Idx<TExtent>, TIdx>;
144 std::forward<TAllocator>(allocator));
156 template<
typename TElem,
typename TIdx =
void,
typename TExtent =
void,
typename TQueue =
void>
159 using Idx = std::conditional_t<std::is_void_v<TIdx>,
Idx<TExtent>, TIdx>;
167 typename TIdx = void,
168 typename TExtent = void,
169 typename TQueue = void,
171 requires concepts::Allocator<std::remove_cvref_t<TAllocator>>
174 using Idx = std::conditional_t<std::is_void_v<TIdx>,
Idx<TExtent>, TIdx>;
180 std::remove_cvref_t<TAllocator>>
::
181 allocAsyncBuf(std::move(queue), extent, std::forward<TAllocator>(allocator));
188 template<
typename TDev,
typename TDim>
204 template<
typename TElem,
typename TIdx =
void,
typename TExtent =
void,
typename TQueue =
void>
207 using Idx = std::conditional_t<std::is_void_v<TIdx>,
Idx<TExtent>, TIdx>;
225 typename TIdx = void,
226 typename TExtent = void,
227 typename TQueue = void,
229 requires concepts::Allocator<std::remove_cvref_t<TAllocator>>
232 using Idx = std::conditional_t<std::is_void_v<TIdx>,
Idx<TExtent>, TIdx>;
255 template<
typename TElem,
typename TIdx =
void,
typename TExtent =
void,
typename TPlatform =
void>
258 TPlatform
const& platform,
259 TExtent
const& extent = TExtent())
261 using Idx = std::conditional_t<std::is_void_v<TIdx>,
Idx<TExtent>, TIdx>;
275 template<
typename TElem,
typename TIdx =
void,
typename TExtent =
void,
typename TPlatform =
void>
278 TPlatform
const& platform,
279 TExtent
const& extent = TExtent())
281 using Idx = std::conditional_t<std::is_void_v<TIdx>,
Idx<TExtent>, TIdx>;
289 template<
typename TPlatform>
305 template<
typename TElem,
typename TIdx =
void,
typename TExtent =
void,
typename TPlatform =
void>
308 TPlatform
const& platform,
309 TExtent
const& extent = TExtent())
311 using Idx = std::conditional_t<std::is_void_v<TIdx>,
Idx<TExtent>, TIdx>;
331 template<
typename TBuf>
337 template<
typename TBuf>
#define ALPAKA_UNREACHABLE(...)
Before CUDA 11.5 nvcc is unable to correctly identify return statements in 'if constexpr' branches....
The alpaka accelerator library.
constexpr bool hasMappedBufSupport
Checks if the host can allocate a pinned/mapped host memory, accessible by all devices in the given p...
ALPAKA_FN_HOST auto allocManagedBuf(DevCpu const &host, TPlatform const &platform, TExtent const &extent=TExtent())
Allocates unified/managed memory, accessible by all devices in the given platform.
ALPAKA_FN_HOST auto allocAsyncBufIfSupported(TQueue queue, TExtent const &extent=TExtent())
If supported, allocates stream-ordered memory on the given queue and the associated device....
typename trait::BufType< alpaka::Dev< TDev >, TElem, TDim, TIdx >::type Buf
The memory buffer type trait alias template to remove the ::type for a Buffer type.
typename trait::IdxType< T >::type Idx
ALPAKA_FN_HOST auto makeConstBuf(TBuf const &buf)
Creates a constant buffer from the given mutable buffer.
ALPAKA_FN_HOST auto allocMappedBuf(DevCpu const &host, TPlatform const &platform, TExtent const &extent=TExtent())
Allocates pinned/mapped host memory, accessible by all devices in the given platform.
ALPAKA_FN_HOST auto allocBuf(TDev const &dev, TExtent const &extent=TExtent())
Allocates memory on the given device.
constexpr bool hasAsyncBufSupport
Checks if the given device can allocate a stream-ordered memory buffer of the given dimensionality.
typename trait::DevType< T >::type Dev
The device type trait alias template to remove the ::type.
ALPAKA_FN_HOST auto getDev(T const &t)
ALPAKA_FN_HOST auto allocMappedBufIfSupported(DevCpu const &host, TPlatform const &platform, TExtent const &extent=TExtent())
If supported, allocates pinned/mapped host memory, accessible by all devices in the given platform....
typename trait::PlatformType< T >::type Platform
The platform type trait alias template to remove the ::type.
ALPAKA_FN_HOST auto allocAsyncBuf(TQueue queue, TExtent const &extent=TExtent())
Allocates stream-ordered memory on the given device.
typename trait::ConstBufType< alpaka::Dev< TDev >, TElem, TDim, TIdx >::type ConstBuf
The memory buffer type trait alias template to remove the ::type for a ConstBuffer type.
typename trait::DimType< T >::type Dim
The dimension type trait alias template to remove the ::type.
The allocator-aware stream-ordered memory allocator trait.
The stream-ordered memory allocator trait.
The managed (unified) memory allocator trait.
The pinned/mapped memory allocator trait.
The allocator-aware memory allocator trait.
The memory allocator trait.
The memory buffer type trait.
The memory const-buffer type trait.
The stream-ordered memory allocation capability trait.
The pinned/mapped memory allocation capability trait.
The trait to transform a mutable buffer into a constant one.