This file declares the primitive of the sycl backend of the generic-parallel interfaces.
- 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>
| int mfront::generic_parallel::sycl::apply |
( |
typename StatisticsHandler::OutputStatus & | s, |
|
|
const size_type | n, |
|
|
const BatchExecution< typename StatisticsHandler::Statistics > & | e, |
|
|
const StatisticsHandler & | h, |
|
|
const PointFunction & | f ) |
apply a function at the points of a batch and report the statistics of the batch.
If the computations are asynchronous, this function returns once they are submitted to the queue. Otherwise, it waits for their completion.
Without statistics given by the calling code, the statistics are held by a block of device memory of a pool of blocks (see StatusBlockPool): no memory is allocated per call. Local statistics are initialized on the host, copied to the block before the computations and copied back once they are completed: the host never accesses the block.
If the function never reports an event (see the hasEvents method of the handler), the statistics are neither combined nor reported, and no block of the pool is used.
- Template Parameters
-
| device_stack_size | minimal stack size, in bytes, of the threads of the device when the computations are performed on an NVIDIA GPU through the CUDA runtime (see 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 |
- Parameters
-
| [in,out] | s | output status, which must have been initialized |
| [in] | n | number of points |
| [in] | e | execution of the batch. The policy must be a SyclBackendExecutionPolicy. |
| [in] | h | handler of the statistics |
| [in] | f | function |
- Returns
- the status