 |
Peano
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
6#define parallelForWithSchedulerInstructions(counter, max, loopParallelism) \
8 tbb::blocked_range<int>( \
9 0, max, loopParallelism==::peano4::utils::LoopPlacement::Serial ? max : 1 \
11 [&]( const tbb::blocked_range<int>& range ) { \
12 for( int counter = range.begin(); counter < range.end(); counter++ ) \
19#define endParallelFor \
24#define parallelDforWithSchedulerInstructions2d(counter, max, loopParallelism) \
26 tarch::la::Vector<2,int> counter##Max(max); \
27 int counter##Size[] = {counter##Max(0),counter##Max(1)}; \
29 tbb::blocked_rangeNd<int,2>( \
31 loopParallelism==::peano4::utils::LoopPlacement::Serial ? counter##Max(0) : 1 \
33 [&]( const tbb::blocked_rangeNd<int,2>& range ) { \
34 for( int counter##1 = range.dim(0).begin(); counter##1 < range.dim(0).end(); counter##1++ ) \
35 for( int counter##2 = range.dim(1).begin(); counter##2 < range.dim(1).end(); counter##2++ ) { \
36 tarch::la::Vector<2, int> counter = { counter##1, counter##2 };
39#define parallelDforWithSchedulerInstructions3d(counter, max, loopParallelism) \
41 tarch::la::Vector<3,int> counter##Max(max); \
42 int counter##Size[] = {counter##Max(0),counter##Max(1),counter##Max(2)}; \
44 tbb::blocked_rangeNd<int,3>( \
46 loopParallelism==::peano4::utils::LoopPlacement::Serial ? counter##Max(0) : 1 \
48 [&]( const tbb::blocked_rangeNd<int,3>& range ) { \
49 for( int counter##1 = range.dim(0).begin(); counter##1 < range.dim(0).end(); counter##1++ ) \
50 for( int counter##2 = range.dim(1).begin(); counter##2 < range.dim(1).end(); counter##2++ ) \
51 for( int counter##3 = range.dim(2).begin(); counter##3 < range.dim(2).end(); counter##3++ ) {\
52 tarch::la::Vector<3, int> counter = { counter##1, counter##2, counter##3 };
55#define parallelDforWithSchedulerInstructions4d(counter, max, loopParallelism) \
57 tarch::la::Vector<4,int> counter##Max(max); \
58 int counter##Size[] = {counter##Max(0),counter##Max(1),counter##Max(2),counter##Max(3)}; \
60 tbb::blocked_rangeNd<int,4>( \
62 loopParallelism==::peano4::utils::LoopPlacement::Serial ? counter##Max(0) : 1 \
64 [&]( const tbb::blocked_rangeNd<int,4>& range ) { \
65 for( int counter##1 = range.dim(0).begin(); counter##1 < range.dim(0).end(); counter##1++ ) \
66 for( int counter##2 = range.dim(1).begin(); counter##2 < range.dim(1).end(); counter##2++ ) \
67 for( int counter##3 = range.dim(2).begin(); counter##3 < range.dim(2).end(); counter##3++ ) \
68 for( int counter##4 = range.dim(3).begin(); counter##4 < range.dim(3).end(); counter##4++ ) { \
69 tarch::la::Vector<4, int> counter = { counter##1, counter##2, counter##3, counter##4 };
72#define parallelDforWithSchedulerInstructions5d(counter, max, loopParallelism) \
74 tarch::la::Vector<5,int> counter##Max(max); \
75 int counter##Size[] = {counter##Max(0),counter##Max(1),counter##Max(2),counter##Max(3),counter##Max(4)}; \
77 tbb::blocked_rangeNd<int,5>( \
79 loopParallelism==::peano4::utils::LoopPlacement::Serial ? counter##Max(0) : 1 \
81 [&]( const tbb::blocked_rangeNd<int,5>& range ) { \
82 for( int counter##1 = range.dim(0).begin(); counter##1 < range.dim(0).end(); counter##1++ ) \
83 for( int counter##2 = range.dim(1).begin(); counter##2 < range.dim(1).end(); counter##2++ ) \
84 for( int counter##3 = range.dim(2).begin(); counter##3 < range.dim(2).end(); counter##3++ ) \
85 for( int counter##4 = range.dim(3).begin(); counter##4 < range.dim(3).end(); counter##4++ ) \
86 for( int counter##5 = range.dim(4).begin(); counter##5 < range.dim(4).end(); counter##5++ ) { \
87 tarch::la::Vector<5, int> counter = { counter##1, counter##2, counter##3, counter##4, counter##5 };
102#define endParallelDfor \
112#define simtForWithSchedulerInstructions(counter, max, loopParallelism) \
113 parallelForWithSchedulerInstructions(counter, max, (loopParallelism==::peano4::utils::LoopPlacement::Nested ? ::peano4::utils::LoopPlacement::Nested : ::peano4::utils::LoopPlacement::Serial))
118#define simtDforWithSchedulerInstructions2d(counter, max, loopParallelism) \
119 parallelDforWithSchedulerInstructions2d(counter, max, (loopParallelism==::peano4::utils::LoopPlacement::Nested ? ::peano4::utils::LoopPlacement::Nested : ::peano4::utils::LoopPlacement::Serial))
121#define simtDforWithSchedulerInstructions3d(counter, max, loopParallelism) \
122 parallelDforWithSchedulerInstructions3d(counter, max, (loopParallelism==::peano4::utils::LoopPlacement::Nested ? ::peano4::utils::LoopPlacement::Nested : ::peano4::utils::LoopPlacement::Serial))
124#define simtDforWithSchedulerInstructions4d(counter, max, loopParallelism) \
125 parallelDforWithSchedulerInstructions4d(counter, max, (loopParallelism==::peano4::utils::LoopPlacement::Nested ? ::peano4::utils::LoopPlacement::Nested : ::peano4::utils::LoopPlacement::Serial))
127#define simtDforWithSchedulerInstructions5d(counter, max, loopParallelism) \
128 parallelDforWithSchedulerInstructions5d(counter, max, (loopParallelism==::peano4::utils::LoopPlacement::Nested ? ::peano4::utils::LoopPlacement::Nested : ::peano4::utils::LoopPlacement::Serial))