22 template<
typename TDev,
typename TElem,
typename TDim,
typename TIdx,
typename TSfinae =
void>
26 template<
typename TDev,
typename TElem,
typename TDim,
typename TIdx,
typename TSfinae =
void>
30 template<
typename TElem,
typename TDim,
typename TIdx,
typename TDev,
typename TSfinae =
void>
34 template<
typename TElem,
typename TDim,
typename TIdx,
typename TDev,
typename TSfinae =
void>
38 template<
typename TDim,
typename TDev>
44 template<
typename TPlatform,
typename TElem,
typename TDim,
typename TIdx>
48 template<
typename TPlatform>
54 template<
typename TPlatform,
typename TElem,
typename TDim,
typename TIdx>
58 template<
typename TBuf>
64 template<
typename TDev,
typename TElem,
typename TDim,
typename TIdx>
68 template<
typename TDev,
typename TElem,
typename TDim,
typename TIdx>
80 template<
typename TElem,
typename TIdx,
typename TExtent,
typename TDev>
95 template<
typename TElem,
typename TIdx,
typename TExtent,
typename TQueue>
104# pragma clang diagnostic push
105# pragma clang diagnostic ignored "-Wdocumentation"
111 template<
typename TDev,
typename TDim>
114# pragma clang diagnostic pop
130 template<
typename TElem,
typename TIdx,
typename TExtent,
typename TQueue>
133 if constexpr(hasAsyncBufSupport<alpaka::Dev<TQueue>,
Dim<TExtent>>)
135 return allocAsyncBuf<TElem, TIdx>(queue, extent);
139 return allocBuf<TElem, TIdx>(
getDev(queue), extent);
154 template<
typename TElem,
typename TIdx,
typename TExtent,
typename TPlatform>
157 TPlatform
const& platform,
158 TExtent
const& extent = TExtent())
172 template<
typename TElem,
typename TIdx,
typename TExtent,
typename TPlatform>
175 TPlatform
const& platform,
176 TExtent
const& extent = TExtent())
184# pragma clang diagnostic push
185# pragma clang diagnostic ignored "-Wdocumentation"
190 template<
typename TPlatform>
193# pragma clang diagnostic pop
209 template<
typename TElem,
typename TIdx,
typename TExtent,
typename TPlatform>
212 TPlatform
const& platform,
213 TExtent
const& extent = TExtent())
216 if constexpr(hasMappedBufSupport<Platform>)
218 return allocMappedBuf<TElem, TIdx>(host, platform, extent);
222 return allocBuf<TElem, TIdx>(host, extent);
233 template<
typename TBuf>
239 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::DevType< T >::type Dev
The device type trait alias template to remove the ::type.
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.
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::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::ConstBufType< alpaka::Dev< TDev >, TElem, TDim, TIdx >::type ConstBuf
The memory buffer type trait alias template to remove the ::type for a ConstBuffer type.
ALPAKA_FN_HOST auto allocAsyncBuf(TQueue queue, TExtent const &extent=TExtent())
Allocates stream-ordered memory on the given device.
typename trait::PlatformType< T >::type Platform
The platform type trait alias template to remove the ::type.
typename trait::DimType< T >::type Dim
The dimension type trait alias template to remove the ::type.
The stream-ordered memory allocator trait.
The managed (unified) memory allocator trait.
The pinned/mapped 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.