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 throwing a FatalErrorException.
Management of an accelerator command.
const ParallelLoopOptions & parallelLoopOptions() const
Multi-thread loop configuration.
void setParallelLoopOptions(const ParallelLoopOptions &opt)
Sets the multi-thread loop configuration.
eExecutionPolicy executionPolicy() const
Command execution policy.
Iteration range of a loop using hierarchical parallelism.
void setBlockSize(IndexType nb_block)
Sets the block size.
Execution options for a parallel loop in multi-threading.
Int32 maxThread() const
Maximum number of allowed threads.
void setGrainSize(Integer v)
Sets the size (approximate) of an iteration interval.
Namespace for accelerator usage.
eExecutionPolicy
Execution policy for a Runner.
@ Thread
Multi-threaded execution policy.
bool isAcceleratorPolicy(eExecutionPolicy exec_policy)
Indicates if exec_policy corresponds to an accelerator.
std::int32_t Int32
Signed integer type of 32 bits.