Arcane  v3.16.4.0
Documentation développeur
Tout Classes Espaces de nommage Fichiers Fonctions Variables Définitions de type Énumérations Valeurs énumérées Amis Macros Groupes Pages Concepts
Référence du fichier RunCommandLoop.h

Types et macros pour gérer les boucles sur les accélérateurs. Plus de détails...

#include "arcane/utils/ArcaneCxx20.h"
#include "arcane/accelerator/RunCommand.h"
#include "arcane/accelerator/KernelLauncher.h"
+ Graphe des dépendances par inclusion de RunCommandLoop.h:
+ Ce graphe montre quels fichiers incluent directement ou indirectement ce fichier :

Aller au code source de ce fichier.

Classes

class  Arcane::Accelerator::impl::ExtendedArrayBoundLoop< LoopBoundType, RemainingArgs >
 
class  Arcane::Accelerator::ArrayBoundRunCommand< N, LoopBoundType, RemainingArgs >
 

Espaces de nommage

namespace  Arcane
 -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
 
namespace  Arcane::Accelerator
 Espace de nom pour l'utilisation des accélérateurs.
 

Macros

#define RUNCOMMAND_LOOP(iter_name, bounds)
 Boucle sur accélérateur.
 
#define RUNCOMMAND_LOOPN(iter_name, N, ...)
 Boucle sur accélérateur.
 
#define RUNCOMMAND_LOOP2(iter_name, x1, x2)
 Boucle sur accélérateur.
 
#define RUNCOMMAND_LOOP3(iter_name, x1, x2, x3)
 Boucle sur accélérateur.
 
#define RUNCOMMAND_LOOP4(iter_name, x1, x2, x3, x4)
 Boucle sur accélérateur.
 
#define RUNCOMMAND_LOOP1(iter_name, x1, ...)
 Boucle sur accélérateur avec arguments supplémentaires pour les réductions.
 
#define RUNCOMMAND_SINGLE(...)
 Boucle sur accélérateur pour exécution avec un seul thread.
 

Fonctions

template<int N, template< int T, typename > class LoopBoundType, typename Lambda, typename... RemainingArgs>
void Arcane::Accelerator::impl::_applyGenericLoop (RunCommand &command, LoopBoundType< N, Int32 > bounds, const Lambda &func, const RemainingArgs &... other_args)
 Applique la lambda func sur une boucle bounds.
 
template<typename ExtentType, typename... RemainingArgs>
auto Arcane::Accelerator::impl::makeExtendedArrayBoundLoop (const ArrayBounds< ExtentType > &bounds, RemainingArgs... args) -> ExtendedArrayBoundLoop< ArrayBounds< ExtentType >, RemainingArgs... >
 
template<typename ExtentType, typename Lambda>
void Arcane::Accelerator::run (RunCommand &command, ArrayBounds< ExtentType > bounds, const Lambda &func)
 Applique la lambda func sur l'intervalle d'itération donnée par bounds.
 
template<int N, typename Lambda>
void Arcane::Accelerator::run (RunCommand &command, SimpleForLoopRanges< N, Int32 > bounds, const Lambda &func)
 Applique la lambda func sur l'intervalle d'itération donnée par bounds.
 
template<int N, typename Lambda>
void Arcane::Accelerator::run (RunCommand &command, ComplexForLoopRanges< N, Int32 > bounds, const Lambda &func)
 Applique la lambda func sur l'intervalle d'itération donnée par bounds.
 
template<int N, template< int T, typename > class LoopBoundType, typename Lambda, typename... RemainingArgs>
void Arcane::Accelerator::runExtended (RunCommand &command, LoopBoundType< N, Int32 > bounds, const Lambda &func, const std::tuple< RemainingArgs... > &other_args)
 Applique la lambda func sur l'intervalle d'itération donnée par bounds.
 
template<typename ExtentType>
auto Arcane::Accelerator::operator<< (RunCommand &command, const ArrayBounds< ExtentType > &bounds) -> ArrayBoundRunCommand< ExtentType::rank(), SimpleForLoopRanges< ExtentType::rank(), Int32 > >
 
template<typename ExtentType, typename... RemainingArgs>
auto Arcane::Accelerator::operator<< (RunCommand &command, const impl::ExtendedArrayBoundLoop< ExtentType, RemainingArgs... > &ex_loop) -> ArrayBoundRunCommand< 1, SimpleForLoopRanges< 1, Int32 >, RemainingArgs... >
 
template<int N>
ArrayBoundRunCommand< N, SimpleForLoopRanges< N > > Arcane::Accelerator::operator<< (RunCommand &command, const SimpleForLoopRanges< N, Int32 > &bounds)
 
template<int N>
ArrayBoundRunCommand< N, ComplexForLoopRanges< N > > Arcane::Accelerator::operator<< (RunCommand &command, const ComplexForLoopRanges< N, Int32 > &bounds)
 
template<int N, template< int, typename > class ForLoopBoundType, typename Lambda, typename... RemainingArgs>
void Arcane::Accelerator::operator<< (ArrayBoundRunCommand< N, ForLoopBoundType< N, Int32 >, RemainingArgs... > &&nr, const Lambda &f)
 

Description détaillée

Types et macros pour gérer les boucles sur les accélérateurs.

Définition dans le fichier RunCommandLoop.h.

Documentation des macros

◆ RUNCOMMAND_LOOP

#define RUNCOMMAND_LOOP ( iter_name,
bounds )
Valeur :
1 A_FUNCINFO << bounds << [=] ARCCORE_HOST_DEVICE(typename decltype(bounds)::IndexType iter_name)

Boucle sur accélérateur.

Définition à la ligne 209 du fichier RunCommandLoop.h.

◆ RUNCOMMAND_LOOP1

#define RUNCOMMAND_LOOP1 ( iter_name,
x1,
... )
Valeur :
1 A_FUNCINFO << ::Arcane::Accelerator::impl::makeExtendedArrayBoundLoop(Arcane::ArrayBounds<MDDim1>(x1) __VA_OPT__(, __VA_ARGS__)) \
2 << [=] ARCCORE_HOST_DEVICE(Arcane::ArrayIndex<1> iter_name __VA_OPT__(ARCANE_RUNCOMMAND_REDUCER_FOR_EACH(__VA_ARGS__)))

Boucle sur accélérateur avec arguments supplémentaires pour les réductions.

Cette macro permet d'ajouter des arguments pour chaque valeur à réduire. Les arguments doivent être des instances des classes Arcane::Accelerator::ReducerSum2, Arcane::Accelerator::ReducerMax2 ou Arcane::Accelerator::ReducerMin2.

Définition à la ligne 235 du fichier RunCommandLoop.h.

Référencé par Arcane::Materials::IncrementalComponentModifier::_computeCellsToTransformForEnvironments(), Arcane::Materials::AllEnvData::_computeInfosForEnvCells(), Arcane::Materials::MeshEnvironment::_computeMaterialIndexesMonoMat(), Arcane::Accelerator::impl::AcceleratorSpecificMemoryCopy< DataType, Extent >::_fill(), Arcane::Materials::MeshMaterialVariableSynchronizer::_fillCellsAccelerator(), Arcane::Materials::MeshComponentPartData::_notifyValueIndexesChanged(), Arcane::Materials::ComponentItemInternalData::_resetItemsInternal(), Arcane::Accelerator::impl::GenericPartitionerIf::apply(), Arcane::Materials::ConstituentConnectivityList::fillCellsIsPartial(), Arcane::Materials::ConstituentConnectivityList::fillCellsNbMaterial(), Arcane::Materials::ConstituentConnectivityList::fillCellsToTransform(), et Arcane::Materials::ConstituentConnectivityList::fillModifiedConstituents().

◆ RUNCOMMAND_LOOP2

#define RUNCOMMAND_LOOP2 ( iter_name,
x1,
x2 )
Valeur :
1 A_FUNCINFO << Arcane::ArrayBounds<MDDim2>(x1, x2) << [=] ARCCORE_HOST_DEVICE(Arcane::MDIndex<2> iter_name)

Boucle sur accélérateur.

Définition à la ligne 217 du fichier RunCommandLoop.h.

Référencé par Arcane::Materials::IncrementalComponentModifier::_applyCopyBetweenPartialsAndGlobals(), et Arcane::Materials::IncrementalComponentModifier::_applyCopyVariableViews().

◆ RUNCOMMAND_LOOP3

#define RUNCOMMAND_LOOP3 ( iter_name,
x1,
x2,
x3 )
Valeur :
1 A_FUNCINFO << Arcane::ArrayBounds<MDDim3>(x1, x2, x3) << [=] ARCCORE_HOST_DEVICE(Arcane::MDIndex<3> iter_name)

Boucle sur accélérateur.

Définition à la ligne 221 du fichier RunCommandLoop.h.

◆ RUNCOMMAND_LOOP4

#define RUNCOMMAND_LOOP4 ( iter_name,
x1,
x2,
x3,
x4 )
Valeur :
1 A_FUNCINFO << Arcane::ArrayBounds<MDDim4>(x1, x2, x3, x4) << [=] ARCCORE_HOST_DEVICE(Arcane::MDIndex<4> iter_name)

Boucle sur accélérateur.

Définition à la ligne 225 du fichier RunCommandLoop.h.

◆ RUNCOMMAND_LOOPN

#define RUNCOMMAND_LOOPN ( iter_name,
N,
... )
Valeur :
1 A_FUNCINFO << Arcane::ArrayBounds<typename Arcane::MDDimType<N>::DimType>(__VA_ARGS__) << [=] ARCCORE_HOST_DEVICE(Arcane::ArrayIndex<N> iter_name)

Boucle sur accélérateur.

Définition à la ligne 213 du fichier RunCommandLoop.h.

◆ RUNCOMMAND_SINGLE

#define RUNCOMMAND_SINGLE ( ...)
Valeur :
1 A_FUNCINFO << ::Arcane::Accelerator::impl::makeExtendedArrayBoundLoop(Arcane::ArrayBounds<MDDim1>(1) __VA_OPT__(, __VA_ARGS__)) \
2 << [=] ARCCORE_HOST_DEVICE(Arcane::ArrayIndex<1> __VA_OPT__(ARCANE_RUNCOMMAND_REDUCER_FOR_EACH(__VA_ARGS__)))
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-

Boucle sur accélérateur pour exécution avec un seul thread.

Définition à la ligne 242 du fichier RunCommandLoop.h.

Documentation des fonctions

◆ _applyGenericLoop()

template<int N, template< int T, typename > class LoopBoundType, typename Lambda, typename... RemainingArgs>
void Arcane::Accelerator::impl::_applyGenericLoop ( RunCommand & command,
LoopBoundType< N, Int32 > bounds,
const Lambda & func,
const RemainingArgs &... other_args )

Applique la lambda func sur une boucle bounds.

N est la dimension de la boucle (actuellement 1, 2, 3 ou 4). La lambda func est appliqué à la commande command. Les arguments supplémentaires sont des fonctor supplémentaires (comme les réductions).

Définition à la ligne 38 du fichier RunCommandLoop.h.

Références ARCANE_FATAL, Arcane::arcaneParallelFor(), Arcane::arcaneSequentialFor(), Arcane::Accelerator::impl::RunCommandLaunchInfo::beginExecute(), Arcane::Accelerator::CUDA, Arcane::Accelerator::impl::RunCommandLaunchInfo::endExecute(), Arcane::Accelerator::HIP, Arcane::Accelerator::impl::RunCommandLaunchInfo::loopRunInfo(), Arcane::Accelerator::Sequential, Arcane::Accelerator::SYCL, et Arcane::Accelerator::Thread.

+ Voici le graphe d'appel pour cette fonction :

◆ makeExtendedArrayBoundLoop()

template<typename ExtentType, typename... RemainingArgs>
auto Arcane::Accelerator::impl::makeExtendedArrayBoundLoop ( const ArrayBounds< ExtentType > & bounds,
RemainingArgs... args ) -> ExtendedArrayBoundLoop<ArrayBounds<ExtentType>, RemainingArgs...>

Définition à la ligne 87 du fichier RunCommandLoop.h.