113 class const_iterator;
131 : elements_{elements}
135 stride_{stride - elements}
137 , index_{
std::min(first, extent)}
153 if(indexElem_ >= elements_)
158 if(index_ >= extent_)
174 return (*(*
this) == *other);
179 return not(*
this == other);
365 class UniformElementsND
380 ALPAKA_FN_ACC inline UniformElementsND(TAcc
const& acc, Vec extent)
399 if((thread_ < extent_).all())
407 return const_iterator{
this, at_end_t{}};
414 return const_iterator{
this, at_end_t{}};
444 return (index_ == other.index_);
449 return not(*
this == other);
465 , first_{loop_->extent_}
466 , range_{loop_->extent_}
467 , index_{loop_->extent_}
474 bool overflow =
false;
476 if(index_[I] >= range_[I])
478 index_[I] = first_[I];
494 if(not nth_elements_loop<N - 1>())
500 return do_elements_loops<N - 1>();
509 bool overflow =
false;
510 first_[I] += loop_->stride_[I];
511 if(first_[I] >= loop_->extent_[I])
513 first_[I] = loop_->thread_[I];
516 index_[I] = first_[I];
517 range_[I] = std::min(first_[I] + loop_->elements_[I], loop_->extent_[I]);
531 if(not nth_strided_loop<N - 1>())
537 return do_strided_loops<N - 1>();
548 if(not do_elements_loops<Dim::value>())
556 if(not do_strided_loops<Dim::value>())
563 first_ = loop_->extent_;
564 range_ = loop_->extent_;
565 index_ = loop_->extent_;
596 return detail::UniformElementsND<TAcc>(acc);
606 return detail::UniformElementsND<TAcc>(acc, extent);
669 class UniformGroupsAlong
682 ALPAKA_FN_ACC inline UniformGroupsAlong(TAcc
const& acc, Idx extent)
689 class const_iterator;
690 using iterator = const_iterator;
694 return const_iterator(stride_, extent_, first_);
699 return const_iterator(stride_, extent_, extent_);
709 , first_{
std::min(first, extent)}
742 return (first_ == other.first_);
747 return not(*
this == other);
821 return detail::UniformGroupsAlong<TAcc, 0>(acc,
static_cast<Idx>(args)...);
838 return detail::UniformGroupsAlong<TAcc, Dim>(acc,
static_cast<Idx>(args)...);
854 return detail::UniformGroupsAlong<TAcc, alpaka::Dim<TAcc>::value - 1>(acc,
static_cast<Idx>(args)...);
864 return detail::UniformGroupsAlong<TAcc, alpaka::Dim<TAcc>::value - 2>(acc,
static_cast<Idx>(args)...);
874 return detail::UniformGroupsAlong<TAcc, alpaka::Dim<TAcc>::value - 3>(acc,
static_cast<Idx>(args)...);
935 class UniformGroupElementsAlong
940 ALPAKA_FN_ACC inline UniformGroupElementsAlong(TAcc
const& acc, Idx block)
947 ALPAKA_FN_ACC inline UniformGroupElementsAlong(TAcc
const& acc, Idx block, Idx extent)
958 class const_iterator;
959 using iterator = const_iterator;
963 return const_iterator(local_, first_, range_);
968 return const_iterator(range_, first_, range_);
1011 return (index_ == other.index_);
1016 return not(*
this == other);
1088 return detail::UniformGroupElementsAlong<TAcc, 0>(acc,
static_cast<Idx>(args)...);
1105 return detail::UniformGroupElementsAlong<TAcc, Dim>(acc,
static_cast<Idx>(args)...);
1121 return detail::UniformGroupElementsAlong<TAcc, alpaka::Dim<TAcc>::value - 1>(acc,
static_cast<Idx>(args)...);
1131 return detail::UniformGroupElementsAlong<TAcc, alpaka::Dim<TAcc>::value - 2>(acc,
static_cast<Idx>(args)...);
1141 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)