12#ifndef ARCANE_UTILS_FORLOOPRANGES_H
13#define ARCANE_UTILS_FORLOOPRANGES_H
17#include "arcane/utils/ArrayBounds.h"
32 template <
typename...
ReducerArgs>
static inline void
66 constexpr Int32 lowerBound()
const {
return m_lower_bound; }
67 constexpr Int32 size()
const {
return m_size; }
68 constexpr Int32 upperBound()
const {
return m_lower_bound + m_size; }
83template <
int N,
typename IndexType_>
91 using ArrayIndexType =
typename ArrayBoundsType::IndexType;
92 using IndexType = ArrayIndexType;
105 template <Int32 I>
constexpr Int32 lowerBound()
const {
return 0; }
106 template <Int32 I>
constexpr Int32 upperBound()
const {
return m_bounds.template
constExtent<I>(); }
107 constexpr Int64 nbElement()
const {
return m_bounds.nbElement(); }
108 constexpr ArrayIndexType getIndices(Int32 i)
const {
return m_bounds.getIndices(i); }
124template <
int N,
typename IndexType_>
130 using ArrayIndexType =
typename ArrayBoundsType::IndexType;
131 using IndexType = ArrayIndexType;
136 : m_lower_bounds(lower.asStdArray())
140 : m_extents(
bounds.m_bounds)
145 template <Int32 I>
constexpr Int32 lowerBound()
const {
return m_lower_bounds[I]; }
146 template <Int32 I>
constexpr Int32 upperBound()
const {
return m_lower_bounds[I] + m_extents.template
constExtent<I>(); }
147 constexpr Int64 nbElement()
const {
return m_extents.nbElement(); }
148 constexpr ArrayIndexType getIndices(Int32 i)
const
150 auto x = m_extents.getIndices(i);
151 x.add(m_lower_bounds);
157 ArrayIndexType m_lower_bounds;
168 using ArrayExtentType =
typename BoundsType::ArrayExtentType;
174inline SimpleForLoopRanges<2>
178 using ArrayExtentType =
typename BoundsType::ArrayExtentType;
184inline SimpleForLoopRanges<3>
188 using ArrayExtentType =
typename BoundsType::ArrayExtentType;
194inline SimpleForLoopRanges<4>
198 using ArrayExtentType =
typename BoundsType::ArrayExtentType;
204inline ComplexForLoopRanges<1>
208 using ArrayExtentType =
typename BoundsType::ArrayExtentType;
216inline ComplexForLoopRanges<2>
220 using ArrayExtentType =
typename BoundsType::ArrayExtentType;
228inline ComplexForLoopRanges<3>
232 using ArrayExtentType =
typename BoundsType::ArrayExtentType;
240inline ComplexForLoopRanges<4>
244 using ArrayExtentType =
typename BoundsType::ArrayExtentType;
254template <
typename IndexType,
template <
int T,
typename>
class LoopBoundType,
255 typename Lambda,
typename... ReducerArgs>
265template <
typename IndexType,
template <
int T,
typename>
class LoopBoundType,
typename Lambda>
inline void
274template <
typename IndexType,
template <
int T,
typename>
class LoopBoundType,
typename Lambda>
inline void
284template <
typename IndexType,
template <
int,
typename>
class LoopBoundType,
typename Lambda>
inline void
Interval d'itération complexe.
Intervalle d'itération pour une boucle.
ForLoopRange(Int32 size)
Créé un interval entre *[0,size[*.
ForLoopRange(Int32 lower_bound, Int32 size)
Créé un interval entre *[lower_bound,lower_bound+size[*.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Interval d'itération simple.
Classe pour appliquer la finalisation des réductions.
static void applyReducerArgs(ReducerArgs &... reducer_args)
Applique les fonctors des arguments additionnels.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
void arcaneSequentialFor(LoopBoundType< 1, IndexType > bounds, const Lambda &func, ReducerArgs... reducer_args)
Applique le fonctor func sur une boucle 1D.
SimpleForLoopRanges< 1 > makeLoopRanges(Int32 n1)
Créé un intervalle d'itération [0,n1[.