12#ifndef ARCANE_ACCELERATOR_RUNCOMMANDLAUNCHIMPL_H
13#define ARCANE_ACCELERATOR_RUNCOMMANDLAUNCHIMPL_H
17#include "arcane/accelerator/WorkGroupLoopRange.h"
23#include "arccore/common/SequentialFor.h"
28namespace Arcane::Accelerator::Impl
40 template <
typename Lambda,
typename... RemainingArgs>
static void
42 const Lambda& func, RemainingArgs... remaining_args)
44 ::Arcane::Impl::HostKernelRemainingArgsHelper::applyRemainingArgsAtBegin(remaining_args...);
46 Int32 loop_index = begin_index * group_size;
47 for (
Int32 i = begin_index; i < (begin_index + nb_loop); ++i) {
53 loop_index += group_size;
56 ::Arcane::Impl::HostKernelRemainingArgsHelper::applyRemainingArgsAtEnd(remaining_args...);
77template <
typename Lambda,
typename... RemainingArgs>
void
89template <
typename Lambda,
typename... RemainingArgs>
void
90arccoreParallelFor(WorkGroupLoopRange bounds, ForLoopRunInfo run_info,
91 const Lambda& func,
const RemainingArgs&... remaining_args)
93 auto sub_func = [=](Int32 begin_index, Int32 nb_loop) {
Classes, Types et macros pour gérer la concurrence.
Types et macros pour gérer les boucles sur les accélérateurs.
static void apply(Int32 begin_index, Int32 nb_loop, WorkGroupLoopRange bounds, const Lambda &func, RemainingArgs... remaining_args)
Applique le fonctor func sur une boucle séqentielle.
Contexte d'exécution d'une commande sur un ensemble de blocs.
Intervalle d'itération d'une boucle utilisant le parallélisme hiérarchique.
constexpr Int32 nbActiveItem(Int32 i) const
Nombre d'éléments actifs pour le i-ème groupe.
constexpr Int32 nbGroup() const
Nombre de groupes.
constexpr Int32 groupSize() const
Taille d'un groupe.
void arcaneParallelFor(Integer i0, Integer size, InstanceType *itype, void(InstanceType::*lambda_function)(Integer i0, Integer size))
Applique en concurrence la fonction lambda lambda_function sur l'intervalle d'itération [i0,...
Espace de nom pour l'utilisation des accélérateurs.
void arcaneSequentialFor(LoopBoundType< 1, IndexType > bounds, const Lambda &func, RemainingArgs... remaining_args)
Applique le fonctor func sur une boucle 1D.
std::int32_t Int32
Type entier signé sur 32 bits.