Arcane  v4.1.0.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
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/ConcurrencyUtils.h"
#include "arcane/accelerator/core/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::ArrayBoundRunCommand< LoopBoundType, RemainingArgs >
 Classe pour conserver les arguments d'une RunCommand. Plus de détails...
 
class  Arcane::Accelerator::impl::ExtendedArrayBoundLoop< LoopBoundType, RemainingArgs >
 Classe pour gérer les paramètres supplémentaires des commandes. Plus de détails...
 

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 2D sur accélérateur.
 
#define RUNCOMMAND_LOOP3(iter_name, x1, x2, x3)
 Boucle 3D sur accélérateur.
 
#define RUNCOMMAND_LOOP4(iter_name, x1, x2, x3, x4)
 Boucle 4D sur accélérateur.
 
#define RUNCOMMAND_LOOP1(iter_name, x1, ...)
 Boucle 1D sur accélérateur avec arguments supplémentaires.
 
#define RUNCOMMAND_SINGLE(...)
 Boucle sur accélérateur pour exécution avec un seul thread.
 

Fonctions

template<typename LoopBoundType, typename Lambda, typename... RemainingArgs>
void Arcane::Accelerator::impl::_applyGenericLoop (RunCommand &command, LoopBoundType bounds, const Lambda &func, const RemainingArgs &... other_args)
 Applique la lambda func sur une boucle bounds.
 
template<typename LoopBoundType, typename... RemainingArgs>
auto Arcane::Accelerator::impl::makeExtendedArrayBoundLoop (const LoopBoundType &bounds, RemainingArgs... args) -> ExtendedArrayBoundLoop< LoopBoundType, RemainingArgs... >
 
template<typename LoopBoundType, typename... RemainingArgs>
auto Arcane::Accelerator::impl::makeExtendedLoop (const LoopBoundType &bounds, RemainingArgs... args) -> ExtendedArrayBoundLoop< LoopBoundType, RemainingArgs... >
 
template<typename LoopBoundType, typename Lambda, typename... RemainingArgs>
void Arcane::Accelerator::impl::runExtended (RunCommand &command, LoopBoundType 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, 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<typename ExtentType>
auto Arcane::Accelerator::operator<< (RunCommand &command, const ArrayBounds< ExtentType > &bounds) -> impl::ArrayBoundRunCommand< SimpleForLoopRanges< ExtentType::rank(), Int32 > >
 
template<typename LoopBoundType, typename... RemainingArgs>
auto Arcane::Accelerator::operator<< (RunCommand &command, const impl::ExtendedArrayBoundLoop< LoopBoundType, RemainingArgs... > &ex_loop) -> impl::ArrayBoundRunCommand< LoopBoundType, RemainingArgs... >
 
template<int N>
impl::ArrayBoundRunCommand< SimpleForLoopRanges< N > > Arcane::Accelerator::operator<< (RunCommand &command, const SimpleForLoopRanges< N, Int32 > &bounds)
 
template<int N>
impl::ArrayBoundRunCommand< ComplexForLoopRanges< N > > Arcane::Accelerator::operator<< (RunCommand &command, const ComplexForLoopRanges< N, Int32 > &bounds)
 
template<typename LoopBoundType, typename Lambda, typename... RemainingArgs>
void Arcane::Accelerator::impl::operator<< (ArrayBoundRunCommand< LoopBoundType, 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 :
A_FUNCINFO << ::Arcane::Accelerator::impl::makeExtendedLoop(bounds __VA_OPT__(, __VA_ARGS__)) \
<< [=] ARCCORE_HOST_DEVICE(typename decltype(bounds)::LoopIndexType iter_name __VA_OPT__(ARCANE_RUNCOMMAND_REDUCER_FOR_EACH(__VA_ARGS__)))

Boucle sur accélérateur.

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

◆ RUNCOMMAND_LOOP1

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

Boucle 1D sur accélérateur avec arguments supplémentaires.

Cette macro permet d'ajouter des arguments. Ces arguments peuvent être des valeurs à réduire (telles que les classes Arcane::Accelerator::ReducerSum2, Arcane::Accelerator::ReducerMax2 ou Arcane::Accelerator::ReducerMin2) ou des données en mémoire locale (via la classe Arcane::Accelerator::RunCommandLocalMemory).

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

Référencé par Arcane::Accelerator::impl::AcceleratorSpecificMemoryCopy< DataType, Extent >::_fill(), et Arcane::Accelerator::impl::GenericPartitionerIf::apply().

◆ RUNCOMMAND_LOOP2

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

Boucle 2D sur accélérateur.

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

◆ RUNCOMMAND_LOOP3

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

Boucle 3D sur accélérateur.

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

◆ RUNCOMMAND_LOOP4

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

Boucle 4D sur accélérateur.

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

◆ RUNCOMMAND_LOOPN

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

Boucle sur accélérateur.

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

◆ RUNCOMMAND_SINGLE

#define RUNCOMMAND_SINGLE ( ...)
Valeur :
A_FUNCINFO << ::Arcane::Accelerator::impl::makeExtendedArrayBoundLoop(::Arcane::SimpleForLoopRanges<1>(1) __VA_OPT__(, __VA_ARGS__)) \
<< [=] ARCCORE_HOST_DEVICE(Arcane::MDIndex<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 289 du fichier RunCommandLoop.h.

Documentation des fonctions

◆ _applyGenericLoop()

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

Applique la lambda func sur une boucle bounds.

La lambda func est appliqué à la commande command. bound est le type de la boucle. Les types supportés sont:

  • SimpleForLoopRanges
  • ComplexForLoopRanges

Les arguments supplémentaires other_args sont utilisés pour supporter des fonctionnalités telles que les réductions (ReducerSum2, ReducerMax2, ...) ou la gestion de la mémoire locale (via LocalMemory).

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

Références ARCANE_FATAL, 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.

◆ makeExtendedArrayBoundLoop()

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

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

◆ makeExtendedLoop()

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

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

◆ operator<<()

template<typename LoopBoundType, typename Lambda, typename... RemainingArgs>
void Arcane::Accelerator::impl::operator<< ( ArrayBoundRunCommand< LoopBoundType, RemainingArgs... > && nr,
const Lambda & f )
inline

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

◆ runExtended()

template<typename LoopBoundType, typename Lambda, typename... RemainingArgs>
void Arcane::Accelerator::impl::runExtended ( RunCommand & command,
LoopBoundType bounds,
const Lambda & func,
const std::tuple< RemainingArgs... > & other_args )

Applique la lambda func sur l'intervalle d'itération donnée par bounds.

other_args contient les éventuels arguments supplémentaires passés à la lambda.

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