12 #include <type_traits>
22 template<
typename TIdx,
typename TOffsets,
typename TSfinae =
void>
32 template<
typename TExtent,
typename TSfinae =
void>
38 template<std::
size_t T
idx,
typename TOffsets>
42 #if BOOST_COMP_CLANG || BOOST_COMP_GNUC
43 # pragma GCC diagnostic push
44 # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
47 #if BOOST_COMP_CLANG || BOOST_COMP_GNUC
48 # pragma GCC diagnostic pop
72 template<
typename TDim,
typename T>
75 static_assert(TDim::value <= Dim<T>::value,
"Cannot get more items than the offsets hold");
79 for(
unsigned i = 0; i < TDim::value; i++)
80 v[i] = o[(Dim<T>::value - TDim::value) + i];
86 template<
typename TOffsets>
94 template<
typename TOffsets>
102 template<
typename TOffsets>
111 template<
typename TDim,
typename TVal>
122 template<
typename TIntegral>
123 struct GetOffsets<TIntegral, std::enable_if_t<std::is_integral_v<TIntegral>>>
#define ALPAKA_FN_HOST_ACC
#define ALPAKA_NO_HOST_ACC_WARNING
Disable nvcc warning: 'calling a host function from host device function.' Usage: ALPAKA_NO_HOST_ACC_...
The alpaka accelerator library.
typename trait::IdxType< T >::type Idx
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto getOffsetX(TOffsets const &offsets=TOffsets()) -> Idx< TOffsets >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto getOffsetZ(TOffsets const &offsets=TOffsets()) -> Idx< TOffsets >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto getOffset(TOffsets const &offsets) -> Idx< TOffsets >
ALPAKA_NO_HOST_ACC_WARNING constexpr ALPAKA_FN_HOST_ACC auto getOffsetVec(T const &object={}) -> Vec< Dim< T >, Idx< T >>
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto getOffsetY(TOffsets const &offsets=TOffsets()) -> Idx< TOffsets >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto getOffsets(T const &object) -> Vec< Dim< T >, Idx< T >>
ALPAKA_NO_HOST_ACC_WARNING constexpr ALPAKA_FN_HOST_ACC auto getOffsetVecEnd(T const &object={}) -> Vec< TDim, Idx< T >>
ALPAKA_FN_HOST_ACC Vec(TFirstIndex &&, TRestIndices &&...) -> Vec< DimInt< 1+sizeof...(TRestIndices)>, std::decay_t< TFirstIndex >>
typename trait::DimType< T >::type Dim
The dimension type trait alias template to remove the ::type.
ALPAKA_NO_HOST_ACC_WARNING static ALPAKA_FN_HOST_ACC auto getOffset(TOffsets const &) -> Idx< TOffsets >
ALPAKA_NO_HOST_ACC_WARNING constexpr ALPAKA_FN_HOST_ACC auto operator()(TIntegral const &i) const
ALPAKA_NO_HOST_ACC_WARNING constexpr ALPAKA_FN_HOST_ACC auto operator()(Vec< TDim, TVal > const &offsets) const -> Vec< TDim, TVal >
The GetOffsets trait for getting the offsets of an object as an alpaka::Vec.