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; }
86template <
int RankValue,
typename LambdaType,
typename... ReducerArgs>
inline void
89 const LambdaType& lambda_function,
90 const ReducerArgs&... reducer_args)
103 using Type =
typename std::remove_reference<LambdaType>::type;
104 Type private_lambda(lambda_function);
118template <
int RankValue,
typename LambdaType,
typename... ReducerArgs>
inline void
121 const LambdaType& lambda_function,
122 const ReducerArgs&... reducer_args)
134template <
int RankValue,
typename LambdaType,
typename... ReducerArgs>
inline void
137 const LambdaType& lambda_function,
138 const ReducerArgs&... reducer_args)
151template <
int RankValue,
typename LambdaType,
typename... ReducerArgs>
inline void
154 const LambdaType& lambda_function,
155 const ReducerArgs&... reducer_args)
168template <
int RankValue,
typename LambdaType>
inline void
170 const LambdaType& lambda_function)
183template <
int RankValue,
typename LambdaType>
inline void
185 const LambdaType& lambda_function)
199template <
typename LambdaType>
inline void
201 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 --
Int32 Integer
Type representing an integer.
void arccoreSequentialFor(LoopBoundType< 1, IndexType > bounds, const Lambda &func, RemainingArgs... remaining_args)
Applies the functor func over a 1D loop.
void arccoreParallelFor(const ComplexForLoopRanges< RankValue > &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...
std::int32_t Int32
Signed integer type of 32 bits.