12#ifndef ARCCORE_BASE_PARALLELFOR_H
13#define ARCCORE_BASE_PARALLELFOR_H
17#include "arccore/concurrency/TaskFactory.h"
34class ARCCORE_CONCURRENCY_EXPORT ParallelFor1DLoopInfo
38 using ThatClass = ParallelFor1DLoopInfo;
48 : m_run_info(run_info)
60 m_run_info.addOptions(opts);
65 Int32 beginIndex()
const {
return m_begin; }
66 Int32 size()
const {
return m_size; }
85template <
int RankValue,
typename IndexType_,
typename LambdaType,
typename... ReducerArgs>
inline void
88 const LambdaType& lambda_function,
89 const ReducerArgs&... reducer_args)
109 using Type =
typename std::remove_reference<LambdaType>::type;
110 Type private_lambda(lambda_function);
124template <
int RankValue,
typename IndexType_,
typename LambdaType,
typename... ReducerArgs>
inline void
127 const LambdaType& lambda_function,
128 const ReducerArgs&... reducer_args)
139template <
int RankValue,
typename IndexType_,
typename LambdaType,
typename... ReducerArgs>
inline void
142 const LambdaType& lambda_function,
143 const ReducerArgs&... reducer_args)
155template <
int RankValue,
typename IndexType_,
typename LambdaType,
typename... ReducerArgs>
inline void
158 const LambdaType& lambda_function,
159 const ReducerArgs&... reducer_args)
171template <
int RankValue,
typename IndexType_,
typename LambdaType>
inline void
173 const LambdaType& lambda_function)
185template <
int RankValue,
typename IndexType_,
typename LambdaType>
inline void
187 const LambdaType& lambda_function)
201template <
typename LambdaType>
inline void
203 const LambdaType& lambda_function)
Loop execution information.
Interface of a functor on an iteration interval.
Functor over an iteration interval instantiated via a lambda function.
Functor over an iteration interval instantiated via a lambda function.
Characteristics of a multi-thread 1D loop.
Execution options for a parallel loop in multi-threading.
void setGrainSize(Integer v)
Sets the size (approximate) of an iteration interval.
static const ParallelLoopOptions & defaultParallelLoopOptions()
Default parallel loop execution options.
static void executeParallelFor(Integer begin, Integer size, const ParallelLoopOptions &options, IRangeFunctor *f)
Executes the functor f in parallel.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
void arccoreParallelFor(const ComplexForLoopRanges< RankValue, IndexType_ > &loop_ranges, const ForLoopRunInfo &run_info, const LambdaType &lambda_function, const ReducerArgs &... reducer_args)
Applies the lambda function lambda_function concurrently over the iteration interval given by loop_ra...
Int32 Integer
Type representing an integer.
void arccoreSequentialFor(LoopBoundType< 1, IndexType > bounds, Lambda func, RemainingArgs... remaining_args)
Applies the functor func over a 1D loop.
std::int32_t Int32
Signed integer type of 32 bits.