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

Parallel for loop for two dimensional domain of indices. More...

#include <TNL/Algorithms/ParallelFor.h>

Static Public Member Functions

template<typename Index , typename Function , typename... FunctionArgs>
static void exec (Index startX, Index startY, Index endX, Index endY, Function f, FunctionArgs... args)
 Static method for the execution of the loop. More...
 
template<typename Index , typename Function , typename... FunctionArgs>
static void exec (Index startX, Index startY, Index endX, Index endY, 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::ParallelFor2D< Device >

Parallel for loop for two dimensional domain 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::ParallelFor2D< Device >::exec ( Index  startX,
Index  startY,
Index  endX,
Index  endY,
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
startXthe for-loop iterates over index domain [startX,endX) x [startY,endY).
startYthe for-loop iterates over index domain [startX,endX) x [startY,endY).
endXthe for-loop iterates over index domain [startX,endX) x [startY,endY).
endYthe for-loop iterates over index domain [startX,endX) x [startY,endY).
fis the function to be called in each iteration
argsare additional parameters to be passed to the function f.

The function f is called for each iteration as

f( i, j, args... )

where the first parameter is changing more often than the second one.


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