Peano
Loading...
Searching...
No Matches
Loop.h File Reference
#include <algorithm>
#include <execution>
#include <ranges>
#include <numeric>
Include dependency graph for Loop.h:

Go to the source code of this file.

Macros

#define translateIntoCPPExecutionPolicyForParallelLoop(placement)    placement==peano4::utils::LoopPlacement::Serial ? std::execution::seq : std::execution::par
 As the.
 
#define translateIntoCPPExecutionPolicyForSimtLoop(placement)    std::execution::seq;
 
#define parallelForWithSchedulerInstructions(counter, max, loopParallelism)
 
#define endParallelFor
 
#define parallelDforWithSchedulerInstructions2d(counter, max, loopParallelism)
 
#define parallelDforWithSchedulerInstructions3d(counter, max, loopParallelism)
 
#define parallelDforWithSchedulerInstructions4d(counter, max, loopParallelism)
 
#define parallelDforWithSchedulerInstructions5d(counter, max, loopParallelism)
 
#define endParallelDfor
 
#define simtForWithSchedulerInstructions(counter, max, loopParallelism)
 
#define endSimtFor
 
#define simtDforWithSchedulerInstructions2d(counter, max, loopParallelism)
 
#define simtDforWithSchedulerInstructions3d(counter, max, loopParallelism)
 
#define simtDforWithSchedulerInstructions4d(counter, max, loopParallelism)
 
#define simtDforWithSchedulerInstructions5d(counter, max, loopParallelism)
 
#define endSimtDfor
 

Macro Definition Documentation

◆ endParallelDfor

#define endParallelDfor
Value:
}); \
}
  • Close functor body
  • Close for each and add semicolon
  • Close helper scope for ranges

Definition at line 115 of file Loop.h.

Referenced by peano4::utils::tests::ParallelDForTest::testParallelDFor(), exahype2::fv::rusanov::internal::timeStepWithRusanovBatchedFunctors(), and exahype2::fv::rusanov::internal::timeStepWithRusanovPatchwiseFunctors().

◆ endParallelFor

#define endParallelFor
Value:
})); \
}
  • the first curly bracket closes the functor
  • the second round bracket closes the tbb::parallel_for call

Definition at line 63 of file Loop.h.

Referenced by runBenchmarks(), runBenchmarks(), exahype2::fv::rusanov::internal::timeStepWithRusanovBatchedFunctors(), exahype2::fv::rusanov::internal::timeStepWithRusanovPatchwiseFunctors(), and exahype2::fv::rusanov::internal::timeStepWithRusanovPatchwiseStateless().

◆ endSimtDfor

◆ endSimtFor

#define endSimtFor
Value:
}); \
}
  • the first curly bracket closes the functor
  • the second round bracket closes the tbb::parallel_for call

Definition at line 129 of file Loop.h.

Referenced by exahype2::fv::rusanov::internal::timeStepWithRusanovBatchedStateless().

◆ parallelDforWithSchedulerInstructions2d

#define parallelDforWithSchedulerInstructions2d ( counter,
max,
loopParallelism )
Value:
{ \
tarch::la::Vector<2, int> counter##Max(max); \
auto counter##Range0 = iota(0, counter##Max(0)); \
auto counter##Range1 = iota(0, counter##Max(1)); \
std::for_each( std::execution::par, cartesian_product( counter##Range0, counter##Range1 ), [&]( auto counter##Native ) { \
tarch::la::Vector<2, int> counter = { counter##Native[0], counter##Native[1] };
Simple vector class.
Definition Vector.h:134

Definition at line 68 of file Loop.h.

◆ parallelDforWithSchedulerInstructions3d

#define parallelDforWithSchedulerInstructions3d ( counter,
max,
loopParallelism )
Value:
{ \
tarch::la::Vector<3, int> counter##Max(max); \
auto counter##Range0 = iota(0, counter##Max(0)); \
auto counter##Range1 = iota(0, counter##Max(1)); \
auto counter##Range2 = iota(0, counter##Max(2)); \
std::for_each( std::execution::par, cartesian_product( counter##Range0, counter##Range1, counter##Range2 ), [&]( auto counter##Native ) { \
tarch::la::Vector<3, int> counter = { counter##Native[0], counter##Native[1], counter##Native[2] };

Definition at line 77 of file Loop.h.

◆ parallelDforWithSchedulerInstructions4d

#define parallelDforWithSchedulerInstructions4d ( counter,
max,
loopParallelism )
Value:
{ \
tarch::la::Vector<4, int> counter##Max(max); \
auto counter##Range0 = iota(0, counter##Max(0)); \
auto counter##Range1 = iota(0, counter##Max(1)); \
auto counter##Range2 = iota(0, counter##Max(2)); \
auto counter##Range3 = iota(0, counter##Max(3)); \
std::for_each( std::execution::par, cartesian_product( counter##Range0, counter##Range1, counter##Range2, counter##Range3 ), [&]( auto counter##Native ) { \
tarch::la::Vector<4, int> counter = { counter##Native[0], counter##Native[1], counter##Native[2], counter##Native[3] };

Definition at line 87 of file Loop.h.

◆ parallelDforWithSchedulerInstructions5d

#define parallelDforWithSchedulerInstructions5d ( counter,
max,
loopParallelism )
Value:
{ \
tarch::la::Vector<5, int> counter##Max(max); \
auto counter##Range0 = iota(0, counter##Max(0)); \
auto counter##Range1 = iota(0, counter##Max(1)); \
auto counter##Range2 = iota(0, counter##Max(2)); \
auto counter##Range3 = iota(0, counter##Max(3)); \
auto counter##Range4 = iota(0, counter##Max(4)); \
std::for_each( std::execution::par, cartesian_product( counter##Range0, counter##Range1, counter##Range2, counter##Range3, counter##Range4 ), [&]( auto counter##Native ) { \
tarch::la::Vector<5, int> counter = { counter##Native[0], counter##Native[1], counter##Native[2], counter##Native[3], counter##Native[4] };

Definition at line 98 of file Loop.h.

◆ parallelForWithSchedulerInstructions

#define parallelForWithSchedulerInstructions ( counter,
max,
loopParallelism )
Value:
{ \
auto counter##Range = iota(0, max); \
std::for_each( std::execution::par_unseq, counter##Range, [&]( const int counter ) {

Definition at line 53 of file Loop.h.

Referenced by exahype2::fv::rusanov::internal::timeStepWithRusanovBatchedFunctors(), exahype2::fv::rusanov::internal::timeStepWithRusanovPatchwiseFunctors(), and exahype2::fv::rusanov::internal::timeStepWithRusanovPatchwiseStateless().

◆ simtDforWithSchedulerInstructions2d

#define simtDforWithSchedulerInstructions2d ( counter,
max,
loopParallelism )
Value:
{ \
tarch::la::Vector<2, int> counter##Max(max); \
auto counter##Range0 = iota(0, counter##Max(0)); \
auto counter##Range1 = iota(0, counter##Max(1)); \
std::for_each( std::execution::par_unseq, cartesian_product( counter##Range0, counter##Range1 ), [&]( auto counter##Native ) { \
tarch::la::Vector<2, int> counter = { counter##Native[0], counter##Native[1] };

Definition at line 134 of file Loop.h.

◆ simtDforWithSchedulerInstructions3d

#define simtDforWithSchedulerInstructions3d ( counter,
max,
loopParallelism )
Value:
{ \
tarch::la::Vector<3, int> counter##Max(max); \
auto counter##Range0 = iota(0, counter##Max(0)); \
auto counter##Range1 = iota(0, counter##Max(1)); \
auto counter##Range2 = iota(0, counter##Max(2)); \
std::for_each( std::execution::par_unseq, cartesian_product( counter##Range0, counter##Range1, counter##Range2 ), [&]( auto counter##Native ) { \
tarch::la::Vector<3, int> counter = { counter##Native[0], counter##Native[1], counter##Native[2] };

Definition at line 143 of file Loop.h.

◆ simtDforWithSchedulerInstructions4d

#define simtDforWithSchedulerInstructions4d ( counter,
max,
loopParallelism )
Value:
{ \
tarch::la::Vector<4, int> counter##Max(max); \
auto counter##Range0 = iota(0, counter##Max(0)); \
auto counter##Range1 = iota(0, counter##Max(1)); \
auto counter##Range2 = iota(0, counter##Max(2)); \
auto counter##Range3 = iota(0, counter##Max(3)); \
std::for_each( std::execution::par_unseq, cartesian_product( counter##Range0, counter##Range1, counter##Range2, counter##Range3 ), [&]( auto counter##Native ) { \
tarch::la::Vector<4, int> counter = { counter##Native[0], counter##Native[1], counter##Native[2], counter##Native[3] };

Definition at line 153 of file Loop.h.

◆ simtDforWithSchedulerInstructions5d

#define simtDforWithSchedulerInstructions5d ( counter,
max,
loopParallelism )
Value:
{ \
tarch::la::Vector<5, int> counter##Max(max); \
auto counter##Range0 = iota(0, counter##Max(0)); \
auto counter##Range1 = iota(0, counter##Max(1)); \
auto counter##Range2 = iota(0, counter##Max(2)); \
auto counter##Range3 = iota(0, counter##Max(3)); \
auto counter##Range4 = iota(0, counter##Max(4)); \
std::for_each( std::execution::par_unseq, cartesian_product( counter##Range0, counter##Range1, counter##Range2, counter##Range3, counter##Range4 ), [&]( auto counter##Native ) { \
tarch::la::Vector<5, int> counter = { counter##Native[0], counter##Native[1], counter##Native[2], counter##Native[3], counter##Native[4] };

Definition at line 164 of file Loop.h.

◆ simtForWithSchedulerInstructions

#define simtForWithSchedulerInstructions ( counter,
max,
loopParallelism )
Value:
{ \
std::for_each( std::execution::par_unseq, iota(0, max), [&]( const int counter ) {

Definition at line 120 of file Loop.h.

Referenced by exahype2::fv::rusanov::internal::timeStepWithRusanovBatchedStateless().

◆ translateIntoCPPExecutionPolicyForParallelLoop

#define translateIntoCPPExecutionPolicyForParallelLoop ( placement)     placement==peano4::utils::LoopPlacement::Serial ? std::execution::seq : std::execution::par

As the.

Definition at line 35 of file Loop.h.

◆ translateIntoCPPExecutionPolicyForSimtLoop

#define translateIntoCPPExecutionPolicyForSimtLoop ( placement)     std::execution::seq;

Definition at line 38 of file Loop.h.