14#include "arccore/accelerator/WorkGroupLoopRange.h"
16#include "arccore/base/FatalErrorException.h"
17#include "arccore/base/ParallelLoopOptions.h"
19#include "arccore/common/accelerator/RunCommand.h"
30template <
bool IsCooperativeLaunch,
typename IndexType_> ARCCORE_ACCELERATOR_EXPORT
void
34 if ((block_size <= 0) || ((block_size % 32) != 0))
35 ARCCORE_FATAL(
"Invalid value '{0}' for block size: should be a multiple of 32", block_size);
36 m_block_size = block_size;
43template <
bool IsCooperativeLaunch,
typename IndexType_> ARCCORE_ACCELERATOR_EXPORT
void
49 IndexType block_size = 1024;
58 m_nb_block = nb_thread;
59 m_block_size = (m_nb_element + (nb_thread - 1)) / nb_thread;
64 else if (IsCooperativeLaunch) {
68 m_block_size = m_nb_element;
78template <
bool IsCooperativeLaunch,
typename IndexType_>
void
82 m_nb_block =
static_cast<Int32>((m_nb_element + (m_block_size - 1)) / m_block_size);
#define ARCCORE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Gestion d'une commande sur accélérateur.
const ParallelLoopOptions & parallelLoopOptions() const
Configuration des boucles multi-thread.
void setParallelLoopOptions(const ParallelLoopOptions &opt)
Positionne la configuration des boucles multi-thread.
eExecutionPolicy executionPolicy() const
Politique d'exécution de la commande.
Intervalle d'itération d'une boucle utilisant le parallélisme hiérarchique.
void setBlockSize(IndexType nb_block)
Positionne la taille d'un bloc.
Options d'exécution d'une boucle parallèle en multi-thread.
Int32 maxThread() const
Nombre maximal de threads autorisés.
void setGrainSize(Integer v)
Positionne la taille (approximative) d'un intervalle d'itération.
Espace de nom pour l'utilisation des accélérateurs.
eExecutionPolicy
Politique d'exécution pour un Runner.
@ Thread
Politique d'exécution multi-thread.
bool isAcceleratorPolicy(eExecutionPolicy exec_policy)
Indique si exec_policy correspond à un accélérateur.
std::int32_t Int32
Type entier signé sur 32 bits.