 |
Peano
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
14#define parallelForWithSchedulerInstructions(counter, max, loopParallelism) \
15 for( int counter = 0; counter < max; counter++ ) {
17#define endParallelFor }
20#define parallelDforWithDynamicScheduling2d(counter, max, loopParallelism) \
22 tarch::la::Vector<2,int> counter##Max(max); \
23 for( int counter##0 = 0; counter##0 < counter##Max(0); counter##0++ ) \
24 for( int counter##1 = 0; counter##1 < counter##Max(1); counter##1++ ) { \
25 tarch::la::Vector<2, int> counter = { counter##0, counter##1 };
27#define parallelDforWithDynamicScheduling3d(counter, max, loopParallelism) \
29 tarch::la::Vector<3,int> counter##Max(max); \
30 for( int counter##0 = 0; counter##0 < counter##Max(0); counter##0++ ) \
31 for( int counter##1 = 0; counter##1 < counter##Max(1); counter##1++ ) \
32 for( int counter##2 = 0; counter##2 < counter##Max(2); counter##2++ ) { \
33 tarch::la::Vector<3, int> counter = { counter##0, counter##1, counter##2 };
35#define parallelDforWithDynamicScheduling4d(counter, max, loopParallelism) \
37 tarch::la::Vector<4,int> counter##Max(max); \
38 for( int counter##0 = 0; counter##0 < counter##Max(0); counter##0++ ) \
39 for( int counter##1 = 0; counter##1 < counter##Max(1); counter##1++ ) \
40 for( int counter##2 = 0; counter##2 < counter##Max(2); counter##2++ ) \
41 for( int counter##3 = 0; counter##3 < counter##Max(3); counter##3++ ) { \
42 tarch::la::Vector<4, int> counter = { counter##0, counter##1, counter##2, counter##3 };
44#define parallelDforWithDynamicScheduling5d(counter, max, loopParallelism) \
46 tarch::la::Vector<5,int> counter##Max(max); \
47 for( int counter##0 = 0; counter##0 < counter##Max(0); counter##0++ ) \
48 for( int counter##1 = 0; counter##1 < counter##Max(1); counter##1++ ) \
49 for( int counter##2 = 0; counter##2 < counter##Max(2); counter##2++ ) \
50 for( int counter##3 = 0; counter##3 < counter##Max(3); counter##3++ ) \
51 for( int counter##4 = 0; counter##4 < counter##Max(4); counter##4++ ) { \
52 tarch::la::Vector<5, int> counter = { counter##0, counter##1, counter##2, counter##3, counter##4 };
54#define endParallelDfor }}
57#define simtForWithSchedulerInstructions(counter, max, loopParallelism) \
58 tarch::multicore::getHostSYCLQueue().submit([&](auto& handle) { \
59 handle.parallel_for( \
60 ::sycl::range<1>{static_cast<std::size_t>(max)}, \
61 [=](::sycl::id<1> counter##Iterator) { \
62 int counter = counter##Iterator[0];
84 #define simtDforWithDynamicScheduling2d(counter, max, loopParallelism) \
86 tarch::la::Vector<2,int> counter##Max(tarch::la::expandOrSlice<2>(max)); \
87 tarch::multicore::getHostSYCLQueue().submit([&](auto& handle) { \
88 handle.parallel_for( \
89 ::sycl::range<2>{static_cast<std::size_t>(counter##Max(0)),static_cast<std::size_t>(counter##Max(1))}, \
90 [=](::sycl::id<2> counter##Iterator) {{ \
91 tarch::la::Vector<2, int> counter = { static_cast<int>(counter##Iterator[0]), static_cast<int>(counter##Iterator[1]) };
94 #define simtDforWithDynamicScheduling3d(counter, max, loopParallelism) \
96 tarch::la::Vector<3,int> counter##Max(tarch::la::expandOrSlice<3>(max)); \
97 tarch::multicore::getHostSYCLQueue().submit([&](auto& handle) { \
98 handle.parallel_for( \
99 ::sycl::range<3>{static_cast<std::size_t>(counter##Max(0)),static_cast<std::size_t>(counter##Max(1)),static_cast<std::size_t>(counter##Max(2))}, \
100 [=](::sycl::id<3> counter##Iterator) {{ \
101 tarch::la::Vector<3, int> counter = { static_cast<int>(counter##Iterator[0]), static_cast<int>(counter##Iterator[1]), static_cast<int>(counter##Iterator[2]) };
104 #define simtDforWithDynamicScheduling4d(counter, max, loopParallelism) \
106 tarch::la::Vector<4,int> counter##Max(tarch::la::expandOrSlice<4>(max)); \
107 tarch::multicore::getHostSYCLQueue().submit([&](auto& handle) { \
108 handle.parallel_for( \
109 ::sycl::range<3>{static_cast<std::size_t>(counter##Max(0)),static_cast<std::size_t>(counter##Max(1)),static_cast<std::size_t>(counter##Max(2))}, \
110 [=](::sycl::id<3> counter##Iterator) { \
111 for (int counter##Iterator3 = 0; counter##Iterator3<counter##Max(3); counter##Iterator3++ ) { \
112 tarch::la::Vector<4, int> counter = { static_cast<int>(counter##Iterator[0]), static_cast<int>(counter##Iterator[1]), static_cast<int>(counter##Iterator[2]), static_cast<int>(counter##Iterator3) };
115 #define simtDforWithDynamicScheduling5d(counter, max, loopParallelism) \
117 tarch::la::Vector<5,int> counter##Max(tarch::la::expandOrSlice<5>(max)); \
118 tarch::multicore::getHostSYCLQueue().submit([&](auto& handle) { \
119 handle.parallel_for( \
120 ::sycl::range<3>{static_cast<std::size_t>(counter##Max(0)),static_cast<std::size_t>(counter##Max(1)),static_cast<std::size_t>(counter##Max(2))}, \
121 [=](::sycl::id<3> counter##Iterator) { \
122 for (int counter##Iterator3 = 0; counter##Iterator3<counter##Max(3); counter##Iterator3++ ) \
123 for (int counter##Iterator4 = 0; counter##Iterator4<counter##Max(4); counter##Iterator4++ ) { \
124 tarch::la::Vector<5, int> counter = { static_cast<int>(counter##Iterator[0]), static_cast<int>(counter##Iterator[1]), static_cast<int>(counter##Iterator[2]), static_cast<int>(counter##Iterator3), static_cast<int>(counter##Iterator4) };
139 #define endSimtDfor \