|
| template<std::size_t device_stack_size, typename StatisticsHandler, typename PointFunction, typename ExecutionPolicy> |
| int | mfront::generic_parallel::stlpar::apply (typename StatisticsHandler::OutputStatus &s, const size_type n, const BatchExecution< typename StatisticsHandler::Statistics > &e, const StatisticsHandler &h, const PointFunction &f, ExecutionPolicy &&policy) |
| | apply a function at the points of a batch and report the statistics of the batch. This function waits for the completion of the computations. The statistics given by the calling code, if any, are accumulated on the host. If the function never reports an event (see the hasEvents method of the handler), the statistics are neither combined nor reported.
|
| template<std::size_t device_stack_size = 0, typename ExecutionPolicy> |
| auto | mfront::generic_parallel::stlpar::makeApply (const ExecutionPolicy policy) |
This file declares the primitive of the stlpar backend of the generic-parallel interfaces, based on the parallel algorithms of the C++ standard library.
- Date
- 05/10/2026
- Copyright
- Copyright (C) 2006-2025 CEA/DEN, EDF R&D. All rights reserved. This project is publicly released under either the GNU GPL Licence with linking exception or the CECILL-A licence. A copy of thoses licences are delivered with the sources of TFEL. CEA or EDF may also distribute this project under specific licensing conditions.
template<std::size_t device_stack_size, typename StatisticsHandler, typename PointFunction, typename ExecutionPolicy>
| int mfront::generic_parallel::stlpar::apply |
( |
typename StatisticsHandler::OutputStatus & | s, |
|
|
const size_type | n, |
|
|
const BatchExecution< typename StatisticsHandler::Statistics > & | e, |
|
|
const StatisticsHandler & | h, |
|
|
const PointFunction & | f, |
|
|
ExecutionPolicy && | policy ) |
apply a function at the points of a batch and report the statistics of the batch. This function waits for the completion of the computations. The statistics given by the calling code, if any, are accumulated on the host. If the function never reports an event (see the hasEvents method of the handler), the statistics are neither combined nor reported.
- Template Parameters
-
| device_stack_size | minimal stack size, in bytes, of the threads of the device when the parallel algorithms are offloaded to an NVIDIA GPU by nvc++ -stdpar=gpu (see mfront::generic_parallel::setMinimalCUDAStackSize). The stack size is not modified if this value is null. This value is a template argument so that the code setting the stack size, which looks for the CUDA runtime with the functions of the dynamic loader, is only compiled if required. |
| StatisticsHandler | handler of the statistics (see MFront/GenericParallel/Batch.hxx) |
| PointFunction | function object taking the index of a point and returning the statistics associated with this point |
| ExecutionPolicy | execution policy |
- Parameters
-
| [in,out] | s | output status, which must have been initialized |
| [in] | n | number of points |
| [in] | e | execution of the batch. The policy is a ParallelSTLBackendExecutionPolicy, or null for the default policy: only its common options are used, the computations being synchronous. |
| [in] | h | handler of the statistics |
| [in] | f | function |
| [in] | policy | execution policy |
- Returns
- the status