15 #include <type_traits>
26 template<
typename TIdxIntegralConst,
typename TExtent,
typename TSfinae =
void>
36 template<
typename TExtent,
typename TSfinae =
void>
42 template<std::
size_t T
idx,
typename TExtent>
46 #if BOOST_COMP_CLANG || BOOST_COMP_GNUC
47 # pragma GCC diagnostic push
48 # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
51 #if BOOST_COMP_CLANG || BOOST_COMP_GNUC
52 # pragma GCC diagnostic pop
69 ->
Vec<Dim<T>, Idx<T>>
77 template<
typename TDim,
typename T>
80 static_assert(TDim::value <= Dim<T>::value,
"Cannot get more items than the extent holds");
83 Vec<TDim, Idx<T>> v{};
84 if constexpr(TDim::value > 0)
86 for(
unsigned i = 0; i < TDim::value; i++)
87 v[i] =
e[(Dim<T>::value - TDim::value) + i];
94 template<
typename TExtent>
107 template<
typename TExtent>
120 template<
typename TExtent>
142 template<
typename TDim,
typename TVal>
152 template<
typename Integral>
153 struct GetExtents<Integral, std::enable_if_t<std::is_integral_v<Integral>>>
#define ALPAKA_UNREACHABLE(...)
Before CUDA 11.5 nvcc is unable to correctly identify return statements in 'if constexpr' branches....
#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 getExtentProduct(T const &object) -> Idx< T >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto getHeight(TExtent const &extent=TExtent()) -> Idx< TExtent >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto getExtent(TExtent const &extent=TExtent()) -> Idx< TExtent >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto getExtents(T const &object) -> Vec< Dim< T >, Idx< T >>
ALPAKA_NO_HOST_ACC_WARNING constexpr ALPAKA_FN_HOST_ACC auto getExtentVec(T const &object={}) -> Vec< Dim< T >, Idx< T >>
ALPAKA_FN_HOST_ACC Vec(TFirstIndex &&, TRestIndices &&...) -> Vec< DimInt< 1+sizeof...(TRestIndices)>, std::decay_t< TFirstIndex >>
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto getDepth(TExtent const &extent=TExtent()) -> Idx< TExtent >
typename trait::DimType< T >::type Dim
The dimension type trait alias template to remove the ::type.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto getWidth(TExtent const &extent=TExtent()) -> Idx< TExtent >
ALPAKA_NO_HOST_ACC_WARNING constexpr ALPAKA_FN_HOST_ACC auto getExtentVecEnd(T const &object={}) -> Vec< TDim, Idx< T >>
ALPAKA_NO_HOST_ACC_WARNING static ALPAKA_FN_HOST_ACC auto getExtent(TExtent const &) -> Idx< TExtent >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto operator()(Integral i) const
ALPAKA_NO_HOST_ACC_WARNING constexpr ALPAKA_FN_HOST_ACC auto operator()(Vec< TDim, TVal > const &extent) const -> Vec< TDim, TVal >
The GetExtents trait for getting the extents of an object as an alpaka::Vec.