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 template <Int32 I>
constexpr Int32 extent()
const {
return m_bounds.template
constExtent<I>(); }
108 constexpr Int64 nbElement()
const {
return m_bounds.nbElement(); }
109 constexpr ArrayIndexType getIndices(Int32 i)
const {
return m_bounds.getIndices(i); }
125template <
int N,
typename IndexType_>
131 using ArrayIndexType =
typename ArrayBoundsType::IndexType;
132 using IndexType = ArrayIndexType;
137 : m_lower_bounds(lower.asStdArray())
141 : m_extents(
bounds.m_bounds)
146 template <Int32 I>
constexpr Int32 lowerBound()
const {
return m_lower_bounds[I]; }
147 template <Int32 I>
constexpr Int32 upperBound()
const {
return m_lower_bounds[I] + m_extents.template
constExtent<I>(); }
148 template <Int32 I>
constexpr Int32 extent()
const {
return m_extents.template
constExtent<I>(); }
149 constexpr Int64 nbElement()
const {
return m_extents.nbElement(); }
150 constexpr ArrayIndexType getIndices(Int32 i)
const
152 auto x = m_extents.getIndices(i);
153 x.add(m_lower_bounds);
160 ArrayIndexType m_lower_bounds;
171 using ArrayExtentType =
typename BoundsType::ArrayExtentType;
177inline SimpleForLoopRanges<2>
181 using ArrayExtentType =
typename BoundsType::ArrayExtentType;
187inline SimpleForLoopRanges<3>
191 using ArrayExtentType =
typename BoundsType::ArrayExtentType;
197inline SimpleForLoopRanges<4>
201 using ArrayExtentType =
typename BoundsType::ArrayExtentType;
207inline ComplexForLoopRanges<1>
211 using ArrayExtentType =
typename BoundsType::ArrayExtentType;
219inline ComplexForLoopRanges<2>
223 using ArrayExtentType =
typename BoundsType::ArrayExtentType;
231inline ComplexForLoopRanges<3>
235 using ArrayExtentType =
typename BoundsType::ArrayExtentType;
243inline ComplexForLoopRanges<4>
247 using ArrayExtentType =
typename BoundsType::ArrayExtentType;
257template <
typename IndexType,
template <
int T,
typename>
class LoopBoundType,
258 typename Lambda,
typename... ReducerArgs>
268template <
typename IndexType,
template <
int T,
typename>
class LoopBoundType,
typename Lambda>
inline void
277template <
typename IndexType,
template <
int T,
typename>
class LoopBoundType,
typename Lambda>
inline void
287template <
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[.