 |
Peano
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
6#define parallelForWithSchedulerInstructions(counter, max, loopParallelism) \
8 auto __loopParallelismUsedWithinMacroWithUniqueName = loopParallelism; \
9 _Pragma( "omp parallel for default(shared) if ( __loopParallelismUsedWithinMacroWithUniqueName==::peano4::utils::LoopPlacement::SpreadOut)" ) \
10 for( int counter = 0; counter < max; counter++ ) {
12#define endParallelFor }}
15#define parallelDforWithSchedulerInstructions2d(counter, max, loopParallelism) \
17 tarch::la::Vector<2,int> counter##Max(max); \
18 auto __loopParallelismUsedWithinMacroWithUniqueName = loopParallelism; \
19 _Pragma( "omp parallel for collapse(2) default(shared) if (__loopParallelismUsedWithinMacroWithUniqueName==::peano4::utils::LoopPlacement::SpreadOut)" ) \
20 for( int counter##0 = 0; counter##0 < counter##Max(0); counter##0++ ) \
21 for( int counter##1 = 0; counter##1 < counter##Max(1); counter##1++ ) { \
22 tarch::la::Vector<2, int> counter = { counter##0, counter##1 };
24#define parallelDforWithSchedulerInstructions3d(counter, max, loopParallelism) \
26 tarch::la::Vector<3,int> counter##Max(max); \
27 auto __loopParallelismUsedWithinMacroWithUniqueName = loopParallelism; \
28 _Pragma( "omp parallel for collapse(3) default(shared) if (__loopParallelismUsedWithinMacroWithUniqueName==::peano4::utils::LoopPlacement::SpreadOut)" ) \
29 for( int counter##0 = 0; counter##0 < counter##Max(0); counter##0++ ) \
30 for( int counter##1 = 0; counter##1 < counter##Max(1); counter##1++ ) \
31 for( int counter##2 = 0; counter##2 < counter##Max(2); counter##2++ ) { \
32 tarch::la::Vector<3, int> counter = { counter##0, counter##1, counter##2 };
34#define parallelDforWithSchedulerInstructions4d(counter, max, loopParallelism) \
36 tarch::la::Vector<4,int> counter##Max(max); \
37 auto __loopParallelismUsedWithinMacroWithUniqueName = loopParallelism; \
38 _Pragma( "omp parallel for collapse(4) default(shared) if (__loopParallelismUsedWithinMacroWithUniqueName==::peano4::utils::LoopPlacement::SpreadOut)" ) \
39 for( int counter##0 = 0; counter##0 < counter##Max(0); counter##0++ ) \
40 for( int counter##1 = 0; counter##1 < counter##Max(1); counter##1++ ) \
41 for( int counter##2 = 0; counter##2 < counter##Max(2); counter##2++ ) \
42 for( int counter##3 = 0; counter##3 < counter##Max(3); counter##3++ ) { \
43 tarch::la::Vector<4, int> counter = { counter##0, counter##1, counter##2, counter##3 };
45#define parallelDforWithSchedulerInstructions5d(counter, max, loopParallelism) \
47 tarch::la::Vector<5,int> counter##Max(max); \
48 auto __loopParallelismUsedWithinMacroWithUniqueName = loopParallelism; \
49 _Pragma( "omp parallel for collapse(5) default(shared) if (__loopParallelismUsedWithinMacroWithUniqueName==::peano4::utils::LoopPlacement::SpreadOut)" ) \
50 for( int counter##0 = 0; counter##0 < counter##Max(0); counter##0++ ) \
51 for( int counter##1 = 0; counter##1 < counter##Max(1); counter##1++ ) \
52 for( int counter##2 = 0; counter##2 < counter##Max(2); counter##2++ ) \
53 for( int counter##3 = 0; counter##3 < counter##Max(3); counter##3++ ) \
54 for( int counter##4 = 0; counter##4 < counter##Max(4); counter##4++ ) { \
55 tarch::la::Vector<5, int> counter = { counter##0, counter##1, counter##2, counter##3, counter##4 };
57#define endParallelDfor }}
60#define simtForWithSchedulerInstructions(counter, max, loopParallelism) \
62 auto __loopParallelismUsedWithinMacroWithUniqueName = loopParallelism; \
63 _Pragma( "omp simd if ( __loopParallelismUsedWithinMacroWithUniqueName!=::peano4::utils::LoopPlacement::Serial)" ) \
64 for( int counter = 0; counter < max; counter++ ) {
72#define simtDforWithSchedulerInstructions2d(counter, max, loopParallelism) \
74 tarch::la::Vector<2,int> counter##Max(max); \
75 auto __loopParallelismUsedWithinMacroWithUniqueName = loopParallelism; \
76 _Pragma( "omp parallel for collapse(1) default(shared) if (__loopParallelismUsedWithinMacroWithUniqueName==::peano4::utils::LoopPlacement::SpreadOut)" ) \
77 for( int counter##0 = 0; counter##0 < counter##Max(0); counter##0++ ) { \
78 _Pragma( "omp simd if (__loopParallelismUsedWithinMacroWithUniqueName!=::peano4::utils::LoopPlacement::Serial)" ) \
79 for( int counter##1 = 0; counter##1 < counter##Max(1); counter##1++ ) { \
80 tarch::la::Vector<2, int> counter = { counter##0, counter##1 };
82#define simtDforWithSchedulerInstructions3d(counter, max, loopParallelism) \
84 tarch::la::Vector<3,int> counter##Max(max); \
85 auto __loopParallelismUsedWithinMacroWithUniqueName = loopParallelism; \
86 _Pragma( "omp parallel for collapse(2) default(shared) if (__loopParallelismUsedWithinMacroWithUniqueName==::peano4::utils::LoopPlacement::SpreadOut)" ) \
87 for( int counter##0 = 0; counter##0 < counter##Max(0); counter##0++ ) \
88 for( int counter##1 = 0; counter##1 < counter##Max(1); counter##1++ ) { \
89 _Pragma( "omp simd if (__loopParallelismUsedWithinMacroWithUniqueName!=::peano4::utils::LoopPlacement::Serial)" ) \
90 for( int counter##2 = 0; counter##2 < counter##Max(2); counter##2++ ) { \
91 tarch::la::Vector<3, int> counter = { counter##0, counter##1, counter##2 };
93#define simtDforWithSchedulerInstructions4d(counter, max, loopParallelism) \
95 tarch::la::Vector<4,int> counter##Max(max); \
96 auto __loopParallelismUsedWithinMacroWithUniqueName = loopParallelism; \
97 _Pragma( "omp parallel for collapse(3) default(shared) if (__loopParallelismUsedWithinMacroWithUniqueName==::peano4::utils::LoopPlacement::SpreadOut)" ) \
98 for( int counter##0 = 0; counter##0 < counter##Max(0); counter##0++ ) \
99 for( int counter##1 = 0; counter##1 < counter##Max(1); counter##1++ ) \
100 for( int counter##2 = 0; counter##2 < counter##Max(2); counter##2++ ) { \
101 _Pragma( "omp simd if (__loopParallelismUsedWithinMacroWithUniqueName!=::peano4::utils::LoopPlacement::Serial)" ) \
102 for( int counter##3 = 0; counter##3 < counter##Max(3); counter##3++ ) { \
103 tarch::la::Vector<4, int> counter = { counter##0, counter##1, counter##2, counter##3 };
105#define simtDforWithSchedulerInstructions5d(counter, max, loopParallelism) \
107 tarch::la::Vector<5,int> counter##Max(max); \
108 auto __loopParallelismUsedWithinMacroWithUniqueName = loopParallelism; \
109 _Pragma( "omp parallel for collapse(4) default(shared) if (__loopParallelismUsedWithinMacroWithUniqueName==::peano4::utils::LoopPlacement::SpreadOut)" ) \
110 for( int counter##0 = 0; counter##0 < counter##Max(0); counter##0++ ) \
111 for( int counter##1 = 0; counter##1 < counter##Max(1); counter##1++ ) \
112 for( int counter##2 = 0; counter##2 < counter##Max(2); counter##2++ ) \
113 for( int counter##3 = 0; counter##3 < counter##Max(3); counter##3++ ) { \
114 _Pragma( "omp simd if (__loopParallelismUsedWithinMacroWithUniqueName!=::peano4::utils::LoopPlacement::Serial)" ) \
115 for( int counter##4 = 0; counter##4 < counter##Max(4); counter##4++ ) { \
116 tarch::la::Vector<5, int> counter = { counter##0, counter##1, counter##2, counter##3, counter##4 };
118#define endSimtDfor }}}