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 TBuf>
60 template<
typename TDev,
typename TElem,
typename TDim,
typename TIdx>
64 template<
typename TDev,
typename TElem,
typename TDim,
typename TIdx>
76 template<
typename TElem,
typename TIdx,
typename TExtent,
typename TDev>
91 template<
typename TElem,
typename TIdx,
typename TExtent,
typename TQueue>
100# pragma clang diagnostic push
101# pragma clang diagnostic ignored "-Wdocumentation"
107 template<
typename TDev,
typename TDim>
110# pragma clang diagnostic pop
126 template<
typename TElem,
typename TIdx,
typename TExtent,
typename TQueue>
129 if constexpr(hasAsyncBufSupport<alpaka::Dev<TQueue>,
Dim<TExtent>>)
131 return allocAsyncBuf<TElem, TIdx>(queue, extent);
135 return allocBuf<TElem, TIdx>(
getDev(queue), extent);
150 template<
typename TElem,
typename TIdx,
typename TExtent,
typename TPlatform>
153 TPlatform
const& platform,
154 TExtent
const& extent = TExtent())
162# pragma clang diagnostic push
163# pragma clang diagnostic ignored "-Wdocumentation"
168 template<
typename TPlatform>
171# pragma clang diagnostic pop
187 template<
typename TElem,
typename TIdx,
typename TExtent,
typename TPlatform>
190 TPlatform
const& platform,
191 TExtent
const& extent = TExtent())
194 if constexpr(hasMappedBufSupport<Platform>)
196 return allocMappedBuf<TElem, TIdx>(host, platform, extent);
200 return allocBuf<TElem, TIdx>(host, extent);
211 template<
typename TBuf>
217 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 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 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.