 |
Peano
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
11#define parallelForWithSchedulerInstructions(counter, max, loopParallelism) \
13 auto __loopParallelismUsedWithinMacroWithUniqueName = loopParallelism; \
14 _Pragma( "omp taskloop default(shared) if ( __loopParallelismUsedWithinMacroWithUniqueName==::peano4::utils::LoopPlacement::SpreadOut)" ) \
15 for( int counter = 0; counter < max; counter++ ) {
17#define endParallelFor }}
20#define parallelDforWithSchedulerInstructions2d(counter, max, loopParallelism) \
22 tarch::la::Vector<2,int> counter##Max(max); \
23 auto __loopParallelismUsedWithinMacroWithUniqueName = loopParallelism; \
24 _Pragma( "omp taskloop collapse(2) default(shared) if (__loopParallelismUsedWithinMacroWithUniqueName==::peano4::utils::LoopPlacement::SpreadOut)" ) \
25 for( int counter##0 = 0; counter##0 < counter##Max(0); counter##0++ ) \
26 for( int counter##1 = 0; counter##1 < counter##Max(1); counter##1++ ) { \
27 tarch::la::Vector<2, int> counter = { counter##0, counter##1 };
29#define parallelDforWithSchedulerInstructions3d(counter, max, loopParallelism) \
31 tarch::la::Vector<3,int> counter##Max(max); \
32 auto __loopParallelismUsedWithinMacroWithUniqueName = loopParallelism; \
33 _Pragma( "omp taskloop collapse(3) default(shared) if (__loopParallelismUsedWithinMacroWithUniqueName==::peano4::utils::LoopPlacement::SpreadOut)" ) \
34 for( int counter##0 = 0; counter##0 < counter##Max(0); counter##0++ ) \
35 for( int counter##1 = 0; counter##1 < counter##Max(1); counter##1++ ) \
36 for( int counter##2 = 0; counter##2 < counter##Max(2); counter##2++ ) { \
37 tarch::la::Vector<3, int> counter = { counter##0, counter##1, counter##2 };
39#define parallelDforWithSchedulerInstructions4d(counter, max, loopParallelism) \
41 tarch::la::Vector<4,int> counter##Max(max); \
42 auto __loopParallelismUsedWithinMacroWithUniqueName = loopParallelism; \
43 _Pragma( "omp taskloop collapse(4) default(shared) if (__loopParallelismUsedWithinMacroWithUniqueName==::peano4::utils::LoopPlacement::SpreadOut)" ) \
44 for( int counter##0 = 0; counter##0 < counter##Max(0); counter##0++ ) \
45 for( int counter##1 = 0; counter##1 < counter##Max(1); counter##1++ ) \
46 for( int counter##2 = 0; counter##2 < counter##Max(2); counter##2++ ) \
47 for( int counter##3 = 0; counter##3 < counter##Max(3); counter##3++ ) { \
48 tarch::la::Vector<4, int> counter = { counter##0, counter##1, counter##2, counter##3 };
50#define parallelDforWithSchedulerInstructions5d(counter, max, loopParallelism) \
52 tarch::la::Vector<5,int> counter##Max(max); \
53 auto __loopParallelismUsedWithinMacroWithUniqueName = loopParallelism; \
54 _Pragma( "omp taskloop collapse(5) default(shared) if (__loopParallelismUsedWithinMacroWithUniqueName==::peano4::utils::LoopPlacement::SpreadOut)" ) \
55 for( int counter##0 = 0; counter##0 < counter##Max(0); counter##0++ ) \
56 for( int counter##1 = 0; counter##1 < counter##Max(1); counter##1++ ) \
57 for( int counter##2 = 0; counter##2 < counter##Max(2); counter##2++ ) \
58 for( int counter##3 = 0; counter##3 < counter##Max(3); counter##3++ ) \
59 for( int counter##4 = 0; counter##4 < counter##Max(4); counter##4++ ) { \
60 tarch::la::Vector<5, int> counter = { counter##0, counter##1, counter##2, counter##3, counter##4 };
62#define endParallelDfor }}
65#define simtForWithSchedulerInstructions(counter, max, loopParallelism) \
67 auto __loopParallelismUsedWithinMacroWithUniqueName = loopParallelism; \
68 _Pragma( "omp taskloop simd default(shared) if ( __loopParallelismUsedWithinMacroWithUniqueName!=::peano4::utils::LoopPlacement::Serial)" ) \
69 for( int counter = 0; counter < max; counter++ ) {
113#define simtDforWithSchedulerInstructions2d(counter, max, loopParallelism) \
115 tarch::la::Vector<2,int> counter##Max(max); \
116 auto __loopParallelismUsedWithinMacroWithUniqueName = loopParallelism; \
117 _Pragma( "omp parallel for if (__loopParallelismUsedWithinMacroWithUniqueName==::peano4::utils::LoopPlacement::SpreadOut)" ) \
118 for( int counter##0 = 0; counter##0 < counter##Max(0); counter##0++ ) { \
119 _Pragma( "omp simd if (__loopParallelismUsedWithinMacroWithUniqueName!=::peano4::utils::LoopPlacement::Serial)" ) \
120 for( int counter##1 = 0; counter##1 < counter##Max(1); counter##1++ ) { \
121 tarch::la::Vector<2, int> counter = { counter##0, counter##1 };
123#define simtDforWithSchedulerInstructions3d(counter, max, loopParallelism) \
125 tarch::la::Vector<3,int> counter##Max(max); \
126 auto __loopParallelismUsedWithinMacroWithUniqueName = loopParallelism; \
127 _Pragma( "omp parallel for if (__loopParallelismUsedWithinMacroWithUniqueName==::peano4::utils::LoopPlacement::SpreadOut)" ) \
128 for( int counter##0 = 0; counter##0 < counter##Max(0); counter##0++ ) \
129 for( int counter##1 = 0; counter##1 < counter##Max(1); counter##1++ ) { \
130 _Pragma( "omp simd if (__loopParallelismUsedWithinMacroWithUniqueName!=::peano4::utils::LoopPlacement::Serial)" ) \
131 for( int counter##2 = 0; counter##2 < counter##Max(2); counter##2++ ) { \
132 tarch::la::Vector<3, int> counter = { counter##0, counter##1, counter##2 };
134#define simtDforWithSchedulerInstructions4d(counter, max, loopParallelism) \
136 tarch::la::Vector<4,int> counter##Max(max); \
137 auto __loopParallelismUsedWithinMacroWithUniqueName = loopParallelism; \
138 _Pragma( "omp parallel for if (__loopParallelismUsedWithinMacroWithUniqueName==::peano4::utils::LoopPlacement::SpreadOut)" ) \
139 for( int counter##0 = 0; counter##0 < counter##Max(0); counter##0++ ) \
140 for( int counter##1 = 0; counter##1 < counter##Max(1); counter##1++ ) \
141 for( int counter##2 = 0; counter##2 < counter##Max(2); counter##2++ ) { \
142 _Pragma( "omp simd if (__loopParallelismUsedWithinMacroWithUniqueName!=::peano4::utils::LoopPlacement::Serial)" ) \
143 for( int counter##3 = 0; counter##3 < counter##Max(3); counter##3++ ) { \
144 tarch::la::Vector<4, int> counter = { counter##0, counter##1, counter##2, counter##3 };
146#define simtDforWithSchedulerInstructions5d(counter, max, loopParallelism) \
148 tarch::la::Vector<5,int> counter##Max(max); \
149 auto __loopParallelismUsedWithinMacroWithUniqueName = loopParallelism; \
150 _Pragma( "omp parallel for if (__loopParallelismUsedWithinMacroWithUniqueName==::peano4::utils::LoopPlacement::SpreadOut)" ) \
151 for( int counter##0 = 0; counter##0 < counter##Max(0); counter##0++ ) \
152 for( int counter##1 = 0; counter##1 < counter##Max(1); counter##1++ ) \
153 for( int counter##2 = 0; counter##2 < counter##Max(2); counter##2++ ) \
154 for( int counter##3 = 0; counter##3 < counter##Max(3); counter##3++ ) { \
155 _Pragma( "omp simd if (__loopParallelismUsedWithinMacroWithUniqueName!=::peano4::utils::LoopPlacement::Serial)" ) \
156 for( int counter##4 = 0; counter##4 < counter##Max(4); counter##4++ ) { \
157 tarch::la::Vector<5, int> counter = { counter##0, counter##1, counter##2, counter##3, counter##4 };
159#define endSimtDfor }}}