114 class const_iterator;
132 : elements_{elements}
136 stride_{stride - elements}
138 , index_{
std::min(first, extent)}
154 if(indexElem_ >= elements_)
159 if(index_ >= extent_)
175 return (*(*
this) == *other);
180 return not(*
this == other);
366 class UniformElementsND
381 ALPAKA_FN_ACC inline UniformElementsND(TAcc
const& acc, Vec extent)
400 if((thread_ < extent_).all())
408 return const_iterator{
this, at_end_t{}};
415 return const_iterator{
this, at_end_t{}};
445 return (index_ == other.index_);
450 return not(*
this == other);
466 , first_{loop_->extent_}
467 , range_{loop_->extent_}
468 , index_{loop_->extent_}
475 bool overflow =
false;
477 if(index_[I] >= range_[I])
479 index_[I] = first_[I];
495 if(not nth_elements_loop<N - 1>())
501 return do_elements_loops<N - 1>();
510 bool overflow =
false;
511 first_[I] += loop_->stride_[I];
512 if(first_[I] >= loop_->extent_[I])
514 first_[I] = loop_->thread_[I];
517 index_[I] = first_[I];
518 range_[I] = std::min(first_[I] + loop_->elements_[I], loop_->extent_[I]);
532 if(not nth_strided_loop<N - 1>())
538 return do_strided_loops<N - 1>();
549 if(not do_elements_loops<Dim::value>())
557 if(not do_strided_loops<Dim::value>())
564 first_ = loop_->extent_;
565 range_ = loop_->extent_;
566 index_ = loop_->extent_;
597 return detail::UniformElementsND<TAcc>(acc);
607 return detail::UniformElementsND<TAcc>(acc, extent);
670 class UniformGroupsAlong
683 ALPAKA_FN_ACC inline UniformGroupsAlong(TAcc
const& acc, Idx extent)
690 class const_iterator;
691 using iterator = const_iterator;
695 return const_iterator(stride_, extent_, first_);
700 return const_iterator(stride_, extent_, extent_);
710 , first_{
std::min(first, extent)}
743 return (first_ == other.first_);
748 return not(*
this == other);
822 return detail::UniformGroupsAlong<TAcc, 0>(acc,
static_cast<Idx>(args)...);
839 return detail::UniformGroupsAlong<TAcc, Dim>(acc,
static_cast<Idx>(args)...);
855 return detail::UniformGroupsAlong<TAcc, alpaka::Dim<TAcc>::value - 1>(acc,
static_cast<Idx>(args)...);
865 return detail::UniformGroupsAlong<TAcc, alpaka::Dim<TAcc>::value - 2>(acc,
static_cast<Idx>(args)...);
875 return detail::UniformGroupsAlong<TAcc, alpaka::Dim<TAcc>::value - 3>(acc,
static_cast<Idx>(args)...);
936 class UniformGroupElementsAlong
941 ALPAKA_FN_ACC inline UniformGroupElementsAlong(TAcc
const& acc, Idx block)
948 ALPAKA_FN_ACC inline UniformGroupElementsAlong(TAcc
const& acc, Idx block, Idx extent)
959 class const_iterator;
960 using iterator = const_iterator;
964 return const_iterator(local_, first_, range_);
969 return const_iterator(range_, first_, range_);
1012 return (index_ == other.index_);
1017 return not(*
this == other);
1089 return detail::UniformGroupElementsAlong<TAcc, 0>(acc,
static_cast<Idx>(args)...);
1106 return detail::UniformGroupElementsAlong<TAcc, Dim>(acc,
static_cast<Idx>(args)...);
1122 return detail::UniformGroupElementsAlong<TAcc, alpaka::Dim<TAcc>::value - 1>(acc,
static_cast<Idx>(args)...);
1132 return detail::UniformGroupElementsAlong<TAcc, alpaka::Dim<TAcc>::value - 2>(acc,
static_cast<Idx>(args)...);
1142 return detail::UniformGroupElementsAlong<TAcc, alpaka::Dim<TAcc>::value - 3>(acc,
static_cast<Idx>(args)...);
#define ALPAKA_UNREACHABLE(...)
Before CUDA 11.5 nvcc is unable to correctly identify return statements in 'if constexpr' branches....
#define ALPAKA_FN_ACC
All functions that can be used on an accelerator have to be attributed with ALPAKA_FN_ACC or ALPAKA_F...
ALPAKA_FN_HOST_ACC constexpr auto divCeil(Integral a, Integral b) -> Integral
Returns the ceiling of a / b, as integer.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto min(T const &min_ctx, Tx const &x, Ty const &y)
Returns the smaller of two arguments. NaNs are treated as missing data (between a NaN and a numeric v...
ALPAKA_FN_HOST auto end(TView &view) -> Iterator< TView >
ALPAKA_FN_HOST auto begin(TView &view) -> Iterator< TView >
The alpaka accelerator library.
typename trait::IdxType< T >::type Idx
ALPAKA_FN_ACC auto uniformElementsAlongX(TAcc const &acc, TArgs... args)
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto getWorkDiv(TWorkDiv const &workDiv) -> Vec< Dim< TWorkDiv >, Idx< TWorkDiv > >
Get the extent requested.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto getIdx(TIdx const &idx, TWorkDiv const &workDiv) -> Vec< Dim< TWorkDiv >, Idx< TIdx > >
Get the indices requested.
ALPAKA_FN_ACC auto uniformGroupElementsAlongZ(TAcc const &acc, TArgs... args)
ALPAKA_FN_ACC auto uniformGroups(TAcc const &acc, TArgs... args)
ALPAKA_FN_ACC auto uniformGroupElementsAlong(TAcc const &acc, TArgs... args)
ALPAKA_FN_ACC auto uniformElements(TAcc const &acc, TArgs... args)
ALPAKA_FN_ACC auto uniformGroupsAlong(TAcc const &acc, TArgs... args)
ALPAKA_FN_ACC auto uniformElementsND(TAcc const &acc)
ALPAKA_FN_ACC auto uniformGroupsAlongZ(TAcc const &acc, TArgs... args)
ALPAKA_FN_ACC auto uniformGroupsAlongX(TAcc const &acc, TArgs... args)
ALPAKA_FN_ACC auto uniformGroupsAlongY(TAcc const &acc, TArgs... args)
ALPAKA_FN_ACC auto uniformElementsAlongY(TAcc const &acc, TArgs... args)
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC constexpr auto elementwise_min(Vec< TDim, TVal > const &p, Vecs const &... qs) -> Vec< TDim, TVal >
ALPAKA_FN_ACC auto uniformGroupElementsAlongX(TAcc const &acc, TArgs... args)
ALPAKA_FN_ACC auto uniformGroupElements(TAcc const &acc, TArgs... args)
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_FN_ACC auto uniformElementsAlongZ(TAcc const &acc, TArgs... args)
ALPAKA_FN_ACC auto uniformGroupElementsAlongY(TAcc const &acc, TArgs... args)
ALPAKA_FN_ACC auto uniformElementsAlong(TAcc const &acc, TArgs... args)