Arcane  v4.1.0.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
arcane/src/arcane/utils/ForLoopRanges.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* ForLoopRanges.h (C) 2000-2025 */
9/* */
10/* Intervalles d'itérations pour les boucles. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_UTILS_FORLOOPRANGES_H
13#define ARCANE_UTILS_FORLOOPRANGES_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/base/ForLoopRanges.h"
18#include "arccore/common/SequentialFor.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
29template <typename IndexType, template <int T, typename> class LoopBoundType,
30 typename Lambda, typename... RemainingArgs>
31void arcaneSequentialFor(LoopBoundType<1, IndexType> bounds, const Lambda& func, RemainingArgs... remaining_args)
32{
34 for (Int32 i0 = bounds.template lowerBound<0>(); i0 < bounds.template upperBound<0>(); ++i0)
35 func(MDIndex<1>(i0), remaining_args...);
37}
38
40template <typename IndexType, template <int T, typename> class LoopBoundType, typename Lambda> inline void
41arcaneSequentialFor(LoopBoundType<2, IndexType> bounds, const Lambda& func)
42{
43 arccoreSequentialFor(bounds,func);
44}
45
47template <typename IndexType, template <int T, typename> class LoopBoundType, typename Lambda> inline void
48arcaneSequentialFor(LoopBoundType<3, IndexType> bounds, const Lambda& func)
49{
50 arccoreSequentialFor(bounds,func);
51}
52
54template <typename IndexType, template <int, typename> class LoopBoundType, typename Lambda> inline void
55arcaneSequentialFor(LoopBoundType<4, IndexType> bounds, const Lambda& func)
56{
57 arccoreSequentialFor(bounds,func);
58}
59
60/*---------------------------------------------------------------------------*/
61/*---------------------------------------------------------------------------*/
62
63} // End namespace Arcane
64
65/*---------------------------------------------------------------------------*/
66/*---------------------------------------------------------------------------*/
67
68#endif
static void applyRemainingArgsAtEnd(RemainingArgs &... remaining_args)
Applique les functors des arguments additionnels à la fin de l'itération.
static void applyRemainingArgsAtBegin(RemainingArgs &... remaining_args)
Applique les functors des arguments additionnels au début de l'itération.
void arcaneSequentialFor(WorkGroupLoopRange bounds, const Lambda &func, const RemainingArgs &... remaining_args)
Applique le fonctor func sur une boucle séqentielle.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
void arccoreSequentialFor(LoopBoundType< 1, IndexType > bounds, const Lambda &func, RemainingArgs... remaining_args)
Applique le functor func sur une boucle 1D.
std::int32_t Int32
Type entier signé sur 32 bits.