Template Numerical Library version\ main:8b8c8226
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
TNL::Algorithms::ParallelFor< Device > Struct Template Reference

Parallel for loop for one dimensional interval of indices. More...

#include <TNL/Algorithms/ParallelFor.h>

Static Public Member Functions

template<typename Index , typename Function , typename... FunctionArgs>
static void exec (Index start, Index end, Function f, FunctionArgs... args)
 Static method for the execution of the loop. More...
 
template<typename Index , typename Function , typename... FunctionArgs>
static void exec (Index start, Index end, typename Device::LaunchConfiguration launch_config, Function f, FunctionArgs... args)
 Overload with custom launch configuration (which is ignored for TNL::Devices::Sequential).
 

Detailed Description

template<typename Device = Devices::Sequential>
struct TNL::Algorithms::ParallelFor< Device >

Parallel for loop for one dimensional interval of indices.

Template Parameters
Devicespecifies the device where the for-loop will be executed. It can be TNL::Devices::Host, TNL::Devices::Cuda or TNL::Devices::Sequential.

Member Function Documentation

◆ exec()

template<typename Device = Devices::Sequential>
template<typename Index , typename Function , typename... FunctionArgs>
static void TNL::Algorithms::ParallelFor< Device >::exec ( Index  start,
Index  end,
Function  f,
FunctionArgs...  args 
)
inlinestatic

Static method for the execution of the loop.

Template Parameters
Indexis the type of the loop indices.
Functionis the type of the functor to be called in each iteration (it is usually deduced from the argument used in the function call).
FunctionArgsis a variadic pack of types for additional parameters that are forwarded to the functor in every iteration.
Parameters
startis the left bound of the iteration range [begin, end).
endis the right bound of the iteration range [begin, end).
fis the function to be called in each iteration.
argsare additional parameters to be passed to the function f.

The documentation for this struct was generated from the following file: