16 #include <type_traits>
22 template<
typename TDev,
typename TElem,
typename TDim,
typename TIdx>
25 static_assert(!std::is_const_v<TIdx>,
"The idx type of the view can not be const!");
27 template<
typename TExtent>
33 template<
typename TExtent,
typename TPitch>
36 ,
m_dev(std::move(dev))
52 template<
typename TDev,
typename TElem,
typename TDim,
typename TIdx>
59 template<
typename TDev,
typename TElem,
typename TDim,
typename TIdx>
69 template<
typename TDev,
typename TElem,
typename TDim,
typename TIdx>
76 template<
typename TDev,
typename TElem,
typename TDim,
typename TIdx>
85 template<
typename TDev,
typename TElem,
typename TDim,
typename TIdx>
95 template<
typename TDev,
typename TElem,
typename TDim,
typename TIdx>
109 template<
typename TDev,
typename TElem,
typename TDim,
typename TIdx>
122 template<
typename TElem,
typename TExtent,
typename TPitch>
133 #if defined(ALPAKA_ACC_GPU_CUDA_ENABLED) || defined(ALPAKA_ACC_GPU_HIP_ENABLED)
135 template<
typename TApi>
138 template<
typename TElem,
typename TExtent,
typename TPitch>
142 TExtent
const& extent,
155 #if defined(ALPAKA_ACC_SYCL_ENABLED)
157 template<concepts::Tag TTag>
158 struct CreateViewPlainPtr<DevGenericSycl<TTag>>
160 template<
typename TElem,
typename TExtent,
typename TPitch>
161 static auto createViewPlainPtr(
162 DevGenericSycl<TTag>
const& dev,
164 TExtent
const& extent,
176 template<
typename TDev,
typename TElem,
typename TDim,
typename TIdx>
186 template<
typename TDev,
typename TElem,
typename TDim,
typename TIdx>
ALPAKA_NO_HOST_ACC_WARNING static constexpr ALPAKA_FN_HOST_ACC auto zeros() -> Vec< TDim, TVal >
Zero value constructor.
constexpr ALPAKA_FN_HOST_ACC auto calculatePitchesFromExtents(Vec< TDim, TIdx > const &extent)
Calculate the pitches purely from the extents.
The alpaka accelerator library.
typename trait::IdxType< T >::type Idx
typename trait::DevType< T >::type Dev
The device 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 memory view to wrap plain pointers.
ALPAKA_FN_HOST ViewPlainPtr(TElem *pMem, TDev dev, TExtent const &extent=TExtent())
Vec< TDim, TIdx > m_extentElements
ALPAKA_FN_HOST ViewPlainPtr(TElem *pMem, TDev dev, TExtent const &extent, TPitch pitchBytes)
Vec< TDim, TIdx > m_pitchBytes
static auto createViewPlainPtr(DevCpu const &dev, TElem *pMem, TExtent const &extent, TPitch pitch)
The device memory view creation trait.
The dimension getter type trait.
static auto getDev(ViewPlainPtr< TDev, TElem, TDim, TIdx > const &view) -> alpaka::Dev< TDev >
ALPAKA_FN_HOST auto operator()(ViewPlainPtr< TDev, TElem, TDim, TIdx > const &view) const
The GetExtents trait for getting the extents of an object as an alpaka::Vec.
ALPAKA_FN_HOST auto operator()(ViewPlainPtr< TDev, TElem, TDim, TIdx > const &) const -> Vec< TDim, TIdx >
The GetOffsets trait for getting the offsets of an object as an alpaka::Vec.
ALPAKA_FN_HOST auto operator()(ViewPlainPtr< TDev, TElem, TDim, TIdx > const &view) const
Customization point for getPitchesInBytes. The default implementation uses the extent to calculate th...
static auto getPtrNative(ViewPlainPtr< TDev, TElem, TDim, TIdx > const &view) -> TElem const *
static auto getPtrNative(ViewPlainPtr< TDev, TElem, TDim, TIdx > &view) -> TElem *
The native pointer get trait.