15 #if defined(SharedTBBExtension) and !defined(TBB_PREVIEW_BLOCKED_RANGE_ND)
18 #include <oneapi/tbb/blocked_range.h>
21 #include <oneapi/tbb/blocked_range2d.h>
22 #include <oneapi/tbb/blocked_range3d.h>
23 #include <oneapi/tbb/parallel_for.h>
27#if defined(SharedSYCL)
33#define CPUGPUMethod SYCL_EXTERNAL
313#define dfor(counter, max) \
314 for (tarch::la::Vector<Dimensions, int> counter = peano4::utils::dStartVector(); peano4::utils::dCmp(counter, max); \
315 peano4::utils::dInc(counter, max))
446#define parallelFor(counter, max) \
447 parallelForWithSchedulerInstructions(counter, max, ::peano4::utils::LoopPlacement::SpreadOut)
449#define simtFor(counter, max) \
450 simtForWithSchedulerInstructions(counter, max, ::peano4::utils::LoopPlacement::SpreadOut)
452#define parallelDfor(counter, max) \
453 parallelDforWithSchedulerInstructions(counter, max, ::peano4::utils::LoopPlacement::SpreadOut)
456#define parallelDforWithSchedulerInstructions(counter, max, loopPlacement) \
457 parallelDforWithSchedulerInstructions2d(counter, max, loopPlacement)
459#define parallelDPlusOneForWithSchedulerInstructions(counter, max, loopPlacement) \
460 parallelDforWithSchedulerInstructions3d(counter, max, loopPlacement)
462#define parallelDPlusTwoForWithSchedulerInstructions(counter, max, loopPlacement) \
463 parallelDforWithSchedulerInstructions4d(counter, max, loopPlacement)
465#define simtDforWithSchedulerInstructions(counter, max, loopPlacement) \
466 simtDforWithSchedulerInstructions2d(counter, max, loopPlacement)
468#define simtDPlusOneForWithSchedulerInstructions(counter, max, loopPlacement) \
469 simtDforWithSchedulerInstructions3d(counter, max, loopPlacement)
471#define simtDPlusTwoForWithSchedulerInstructions(counter, max, loopPlacement) \
472 simtDforWithSchedulerInstructions4d(counter, max, loopPlacement)
474#define parallelDforWithSchedulerInstructions(counter, max, loopPlacement) \
475 parallelDforWithSchedulerInstructions3d(counter, max, loopPlacement)
477#define parallelDPlusOneForWithSchedulerInstructions(counter, max, loopPlacement) \
478 parallelDforWithSchedulerInstructions4d(counter, max, loopPlacement)
480#define parallelDPlusTwoForWithSchedulerInstructions(counter, max, loopPlacement) \
481 parallelDforWithSchedulerInstructions5d(counter, max, loopPlacement)
483#define simtDforWithSchedulerInstructions(counter, max, loopPlacement) \
484 simtDforWithSchedulerInstructions3d(counter, max, loopPlacement)
486#define simtDPlusOneForWithSchedulerInstructions(counter, max, loopPlacement) \
487 simtDforWithSchedulerInstructions4d(counter, max, loopPlacement)
489#define simtDPlusTwoForWithSchedulerInstructions(counter, max, loopPlacement) \
490 simtDforWithSchedulerInstructions5d(counter, max, loopPlacement)
494#if defined(SharedOMP) and defined(OpenMPTaskGroup)
496#elif defined(SharedOMP) and !defined(OpenMPTaskGroup)
498#elif defined(SharedTBB)
500#elif defined(SharedCPP)
503#elif defined(SharedSYCL)
506#define parallelForWithSchedulerInstructions(counter, max, loopPlacement) \
507 for (int counter = 0; counter < max; counter++) {
509#define parallelDforWithSchedulerInstructions2d(counter, max, loopPlacement) \
511 tarch::la::Vector<2, int> counter##Max(max); \
512 for (int counter##0 = 0; counter##0 < counter##Max(0); counter##0 ++) \
513 for (int counter##1 = 0; counter##1 < counter##Max(1); counter##1 ++) { \
514 tarch::la::Vector<2, int> counter = {counter##0, counter##1};
516#define parallelDforWithSchedulerInstructions3d(counter, max, loopPlacement) \
518 tarch::la::Vector<3, int> counter##Max(max); \
519 for (int counter##0 = 0; counter##0 < counter##Max(0); counter##0 ++) \
520 for (int counter##1 = 0; counter##1 < counter##Max(1); counter##1 ++) \
521 for (int counter##2 = 0; counter##2 < counter##Max(2); counter##2 ++) { \
522 tarch::la::Vector<3, int> counter = {counter##0, counter##1, counter##2};
524#define parallelDforWithSchedulerInstructions4d(counter, max, loopPlacement) \
526 tarch::la::Vector<4, int> counter##Max(max); \
527 for (int counter##0 = 0; counter##0 < counter##Max(0); counter##0 ++) \
528 for (int counter##1 = 0; counter##1 < counter##Max(1); counter##1 ++) \
529 for (int counter##2 = 0; counter##2 < counter##Max(2); counter##2 ++) \
530 for (int counter##3 = 0; counter##3 < counter##Max(3); counter##3 ++) { \
531 tarch::la::Vector<4, int> counter = {counter##0, counter##1, counter##2, counter##3};
533#define parallelDforWithSchedulerInstructions5d(counter, max, loopPlacement) \
535 tarch::la::Vector<5, int> counter##Max(max); \
536 for (int counter##0 = 0; counter##0 < counter##Max(0); counter##0 ++) \
537 for (int counter##1 = 0; counter##1 < counter##Max(1); counter##1 ++) \
538 for (int counter##2 = 0; counter##2 < counter##Max(2); counter##2 ++) \
539 for (int counter##3 = 0; counter##3 < counter##Max(3); counter##3 ++) \
540 for (int counter##4 = 0; counter##4 < counter##Max(4); counter##4 ++) { \
541 tarch::la::Vector<5, int> counter = {counter##0, counter##1, counter##2, counter##3, counter##4};
543#define endParallelFor }
544#define endParallelDfor \
549#define simtForWithSchedulerInstructions(counter, max, loopPlacement) \
550 for (int counter = 0; counter < max; counter++) {
552#define endSimtFor endParallelFor
554#define simtDforWithSchedulerInstructions2d(counter, max, loopPlacement) \
555 parallelDforWithSchedulerInstructions2d(counter, max, loopPlacement)
557#define simtDforWithSchedulerInstructions3d(counter, max, loopPlacement) \
558 parallelDforWithSchedulerInstructions3d(counter, max, loopPlacement)
560#define simtDforWithSchedulerInstructions4d(counter, max, loopPlacement) \
561 parallelDforWithSchedulerInstructions4d(counter, max, loopPlacement)
563#define simtDforWithSchedulerInstructions5d(counter, max, loopPlacement) \
564 parallelDforWithSchedulerInstructions5d(counter, max, loopPlacement)
566#define endSimtDfor endParallelDfor
601#define dfor4(counter) \
602 for (int counter##Scalar = 0; counter##Scalar < FOUR_POWER_D; counter##Scalar++) { \
603 tarch::la::Vector<Dimensions, int> counter; \
605 int copy##counter##Scalar = counter##Scalar; \
606 for (int counter##ddd = Dimensions - 1; counter##ddd >= 0; counter##ddd--) { \
607 int counter##aPowI = 1; \
608 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
609 counter##aPowI *= 4; \
611 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
612 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
647#define dfor3(counter) \
648 for (int counter##Scalar = 0; counter##Scalar < ThreePowerD; counter##Scalar++) { \
649 tarch::la::Vector<Dimensions, int> counter; \
651 int copy##counter##Scalar = counter##Scalar; \
652 for (int counter##ddd = Dimensions - 1; counter##ddd >= 0; counter##ddd--) { \
653 int counter##aPowI = 1; \
654 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
655 counter##aPowI *= 3; \
657 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
658 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
663#define dfor5(counter) \
664 for (int counter##Scalar = 0; counter##Scalar < FIVE_POWER_D; counter##Scalar++) { \
665 tarch::la::Vector<Dimensions, int> counter; \
667 int copy##counter##Scalar = counter##Scalar; \
668 for (int counter##ddd = Dimensions - 1; counter##ddd >= 0; counter##ddd--) { \
669 int counter##aPowI = 1; \
670 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
671 counter##aPowI *= 5; \
673 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
674 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
678#define dfor7(counter) \
679 for (int counter##Scalar = 0; counter##Scalar < SEVEN_POWER_D; counter##Scalar++) { \
680 tarch::la::Vector<Dimensions, int> counter; \
682 int copy##counter##Scalar = counter##Scalar; \
683 for (int counter##ddd = Dimensions - 1; counter##ddd >= 0; counter##ddd--) { \
684 int counter##aPowI = 1; \
685 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
686 counter##aPowI *= 7; \
688 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
689 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
694#define dfor9(counter) \
695 for (int counter##Scalar = 0; counter##Scalar < NINE_POWER_D; counter##Scalar++) { \
696 tarch::la::Vector<Dimensions, int> counter; \
698 int copy##counter##Scalar = counter##Scalar; \
699 for (int counter##ddd = Dimensions - 1; counter##ddd >= 0; counter##ddd--) { \
700 int counter##aPowI = 1; \
701 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
702 counter##aPowI *= 9; \
704 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
705 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
723#define d2for(counter, max) \
724 for (int counter##Scalar = 0; counter##Scalar < tarch::la::aPowI(2, max); counter##Scalar++) { \
725 tarch::la::Vector<2, int> counter; \
727 int copy##counter##Scalar = counter##Scalar; \
728 for (int counter##ddd = 2 - 1; counter##ddd >= 0; counter##ddd--) { \
729 int counter##aPowI = 1; \
730 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
731 counter##aPowI *= max; \
733 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
734 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
744#define d2for2(counter) \
745 for (int counter##Scalar = 0; counter##Scalar < tarch::la::aPowI(2, 2); counter##Scalar++) { \
746 tarch::la::Vector<2, int> counter; \
748 int copy##counter##Scalar = counter##Scalar; \
749 for (int counter##ddd = 2 - 1; counter##ddd >= 0; counter##ddd--) { \
750 int counter##aPowI = 1; \
751 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
752 counter##aPowI *= 2; \
754 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
755 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
765#define d3for2(counter) \
766 for (int counter##Scalar = 0; counter##Scalar < tarch::la::aPowI(3, 2); counter##Scalar++) { \
767 tarch::la::Vector<3, int> counter; \
769 int copy##counter##Scalar = counter##Scalar; \
770 for (int counter##ddd = 3 - 1; counter##ddd >= 0; counter##ddd--) { \
771 int counter##aPowI = 1; \
772 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
773 counter##aPowI *= 2; \
775 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
776 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
795#define d3for(counter, max) \
796 for (int counter##Scalar = 0; counter##Scalar < tarch::la::aPowI(3, max); counter##Scalar++) { \
797 tarch::la::Vector<3, int> counter; \
799 int copy##counter##Scalar = counter##Scalar; \
800 for (int counter##ddd = 3 - 1; counter##ddd >= 0; counter##ddd--) { \
801 int counter##aPowI = 1; \
802 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
803 counter##aPowI *= max; \
805 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
806 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
817#define d2for3(counter) \
818 for (int counter##Scalar = 0; counter##Scalar < tarch::la::aPowI(2, 3); counter##Scalar++) { \
819 tarch::la::Vector<2, int> counter; \
821 int copy##counter##Scalar = counter##Scalar; \
822 for (int counter##ddd = 2 - 1; counter##ddd >= 0; counter##ddd--) { \
823 int counter##aPowI = 1; \
824 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
825 counter##aPowI *= 3; \
827 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
828 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
838#define d3for3(counter) \
839 for (int counter##Scalar = 0; counter##Scalar < tarch::la::aPowI(3, 3); counter##Scalar++) { \
840 tarch::la::Vector<3, int> counter; \
842 int copy##counter##Scalar = counter##Scalar; \
843 for (int counter##ddd = 3 - 1; counter##ddd >= 0; counter##ddd--) { \
844 int counter##aPowI = 1; \
845 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
846 counter##aPowI *= 3; \
848 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
849 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
890#define dfor2(counter) \
891 for (int counter##Scalar = 0, AA##counter = 0, BB##counter = 0; counter##Scalar < TwoPowerD; counter##Scalar++) { \
892 tarch::la::Vector<Dimensions, int> counter; \
893 counter(0) = AA##counter; \
894 counter(1) = BB##counter; \
895 AA##counter = !AA##counter; \
896 BB##counter = !(AA##counter ^ BB##counter);
899#define dfor2(counter) \
900 for (int counter##Scalar = 0, AA##counter = 0, BB##counter = 0, CC##counter = 0; counter##Scalar < TwoPowerD; \
901 counter##Scalar++) { \
902 tarch::la::Vector<Dimensions, int> counter; \
903 counter(0) = AA##counter; \
904 counter(1) = BB##counter; \
905 counter(2) = CC##counter; \
906 AA##counter = !AA##counter; \
907 BB##counter = !(AA##counter ^ BB##counter); \
908 CC##counter = CC##counter || (!AA##counter && !BB##counter && !CC##counter);
911#define dfor2(counter) \
912 for (int counter##Scalar = 0; counter##Scalar < TwoPowerD; counter##Scalar++) { \
913 tarch::la::Vector<Dimensions, int> counter; \
915 int copy##counter##Scalar = counter##Scalar; \
916 for (int counter##ddd = Dimensions - 1; counter##ddd >= 0; counter##ddd--) { \
917 int counter##aPowI = 1; \
918 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
919 counter##aPowI *= 2; \
921 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
922 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
942#define dfore(counter, max, dim, value) \
943 for (tarch::la::Vector<Dimensions, int> counter = peano4::utils::dStartVector(dim, value); \
944 peano4::utils::dCmp(counter, max); \
945 peano4::utils::dInc(counter, max, dim))
979#define zfor(counter, max, direction) \
981 for (tarch::la::Vector<Dimensions, int> counter = peano4::utils::dStartVector(max, direction); \
982 peano4::utils::dCmp(counter, max); \
983 peano4::utils::dInc(counter, max, direction)) {
993static const int lookupzfor3[4][9][2] = {
994 {{2, 2}, {1, 2}, {0, 2}, {0, 1}, {1, 1}, {2, 1}, {2, 0}, {1, 0}, {0, 0}},
995 {{0, 2}, {1, 2}, {2, 2}, {2, 1}, {1, 1}, {0, 1}, {0, 0}, {1, 0}, {2, 0}},
996 {{2, 0}, {1, 0}, {0, 0}, {0, 1}, {1, 1}, {2, 1}, {2, 2}, {1, 2}, {0, 2}},
997 {{0, 0}, {1, 0}, {2, 0}, {2, 1}, {1, 1}, {0, 1}, {0, 2}, {1, 2}, {2, 2}}};
999#define zfor3(counter, direction) \
1001 tarch::la::Vector<Dimensions, int> counter; \
1002 int counter##initDir = static_cast<int>(direction.to_ulong()); \
1003 for (int counter##i = 0; counter##i < 9; ++counter##i) { \
1004 counter(0) = lookupzfor3[counter##initDir][counter##i][0]; \
1005 counter(1) = lookupzfor3[counter##initDir][counter##i][1];
1007#elif Dimensions == 3
1008static const int lookupzfor3[8][27][3] = {
1009 {{2, 2, 2}, {1, 2, 2}, {0, 2, 2}, {0, 1, 2}, {1, 1, 2}, {2, 1, 2}, {2, 0, 2}, {1, 0, 2}, {0, 0, 2},
1010 {0, 0, 1}, {1, 0, 1}, {2, 0, 1}, {2, 1, 1}, {1, 1, 1}, {0, 1, 1}, {0, 2, 1}, {1, 2, 1}, {2, 2, 1},
1011 {2, 2, 0}, {1, 2, 0}, {0, 2, 0}, {0, 1, 0}, {1, 1, 0}, {2, 1, 0}, {2, 0, 0}, {1, 0, 0}, {0, 0, 0}},
1012 {{0, 2, 2}, {1, 2, 2}, {2, 2, 2}, {2, 1, 2}, {1, 1, 2}, {0, 1, 2}, {0, 0, 2}, {1, 0, 2}, {2, 0, 2},
1013 {2, 0, 1}, {1, 0, 1}, {0, 0, 1}, {0, 1, 1}, {1, 1, 1}, {2, 1, 1}, {2, 2, 1}, {1, 2, 1}, {0, 2, 1},
1014 {0, 2, 0}, {1, 2, 0}, {2, 2, 0}, {2, 1, 0}, {1, 1, 0}, {0, 1, 0}, {0, 0, 0}, {1, 0, 0}, {2, 0, 0}},
1015 {{2, 0, 2}, {1, 0, 2}, {0, 0, 2}, {0, 1, 2}, {1, 1, 2}, {2, 1, 2}, {2, 2, 2}, {1, 2, 2}, {0, 2, 2},
1016 {0, 2, 1}, {1, 2, 1}, {2, 2, 1}, {2, 1, 1}, {1, 1, 1}, {0, 1, 1}, {0, 0, 1}, {1, 0, 1}, {2, 0, 1},
1017 {2, 0, 0}, {1, 0, 0}, {0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {2, 1, 0}, {2, 2, 0}, {1, 2, 0}, {0, 2, 0}},
1018 {{0, 0, 2}, {1, 0, 2}, {2, 0, 2}, {2, 1, 2}, {1, 1, 2}, {0, 1, 2}, {0, 2, 2}, {1, 2, 2}, {2, 2, 2},
1019 {2, 2, 1}, {1, 2, 1}, {0, 2, 1}, {0, 1, 1}, {1, 1, 1}, {2, 1, 1}, {2, 0, 1}, {1, 0, 1}, {0, 0, 1},
1020 {0, 0, 0}, {1, 0, 0}, {2, 0, 0}, {2, 1, 0}, {1, 1, 0}, {0, 1, 0}, {0, 2, 0}, {1, 2, 0}, {2, 2, 0}},
1021 {{2, 2, 0}, {1, 2, 0}, {0, 2, 0}, {0, 1, 0}, {1, 1, 0}, {2, 1, 0}, {2, 0, 0}, {1, 0, 0}, {0, 0, 0},
1022 {0, 0, 1}, {1, 0, 1}, {2, 0, 1}, {2, 1, 1}, {1, 1, 1}, {0, 1, 1}, {0, 2, 1}, {1, 2, 1}, {2, 2, 1},
1023 {2, 2, 2}, {1, 2, 2}, {0, 2, 2}, {0, 1, 2}, {1, 1, 2}, {2, 1, 2}, {2, 0, 2}, {1, 0, 2}, {0, 0, 2}},
1024 {{0, 2, 0}, {1, 2, 0}, {2, 2, 0}, {2, 1, 0}, {1, 1, 0}, {0, 1, 0}, {0, 0, 0}, {1, 0, 0}, {2, 0, 0},
1025 {2, 0, 1}, {1, 0, 1}, {0, 0, 1}, {0, 1, 1}, {1, 1, 1}, {2, 1, 1}, {2, 2, 1}, {1, 2, 1}, {0, 2, 1},
1026 {0, 2, 2}, {1, 2, 2}, {2, 2, 2}, {2, 1, 2}, {1, 1, 2}, {0, 1, 2}, {0, 0, 2}, {1, 0, 2}, {2, 0, 2}},
1027 {{2, 0, 0}, {1, 0, 0}, {0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {2, 1, 0}, {2, 2, 0}, {1, 2, 0}, {0, 2, 0},
1028 {0, 2, 1}, {1, 2, 1}, {2, 2, 1}, {2, 1, 1}, {1, 1, 1}, {0, 1, 1}, {0, 0, 1}, {1, 0, 1}, {2, 0, 1},
1029 {2, 0, 2}, {1, 0, 2}, {0, 0, 2}, {0, 1, 2}, {1, 1, 2}, {2, 1, 2}, {2, 2, 2}, {1, 2, 2}, {0, 2, 2}},
1030 {{0, 0, 0}, {1, 0, 0}, {2, 0, 0}, {2, 1, 0}, {1, 1, 0}, {0, 1, 0}, {0, 2, 0}, {1, 2, 0}, {2, 2, 0},
1031 {2, 2, 1}, {1, 2, 1}, {0, 2, 1}, {0, 1, 1}, {1, 1, 1}, {2, 1, 1}, {2, 0, 1}, {1, 0, 1}, {0, 0, 1},
1032 {0, 0, 2}, {1, 0, 2}, {2, 0, 2}, {2, 1, 2}, {1, 1, 2}, {0, 1, 2}, {0, 2, 2}, {1, 2, 2}, {2, 2, 2}}};
1034#define zfor3(counter, direction) \
1036 tarch::la::Vector<Dimensions, int> counter; \
1037 int counter##initDir = static_cast<int>(direction.to_ulong()); \
1038 for (int counter##i = 0; counter##i < 27; ++counter##i) { \
1039 counter(0) = lookupzfor3[counter##initDir][counter##i][0]; \
1040 counter(1) = lookupzfor3[counter##initDir][counter##i][1]; \
1041 counter(2) = lookupzfor3[counter##initDir][counter##i][2];
1044#define zfor3(counter, direction) zfor(counter, 3, direction)
std::string toString(peano4::utils::LoopPlacement)
int d2Linearised(const tarch::la::Vector< 2, int > &counter, int max)
Special 2d variant of dLinearised that works also if you compile with other dimensions.
bool dCmpLinearOrder(const tarch::la::Vector< Dimensions, int > &counter, const tarch::la::Vector< Dimensions, int > &max)
Compares two vectors with regards to their linearised value.
CPUGPUMethod void dInc(tarch::la::Vector< Dimensions, int > &counter, int max)
d-dimensional counterpart of increment operator
std::bitset< Dimensions > LoopDirection
Is used by the z-loop.
LoopPlacement
Guide loop-level parallelism.
CPUGPUMethod tarch::la::Vector< Dimensions, int > dStartVector()
Construct start vector (0,0,....) for d-dimensional loop.
void dIncByScalar(tarch::la::Vector< Dimensions, int > &counter, int max, int increment)
Perform a scalar increment of a vector: The operation equals a sequence of increment calls to dInc().
void dIncByVector(tarch::la::Vector< Dimensions, int > &counter, int max, int increment)
Perform a d-dimensional increment by value increment: The first component of the counter is increment...
void setupLookupTableForDLinearised()
CPUGPUMethod int dLinearised(const tarch::la::Vector< Dimensions, int > &counter, int max)
Map d-dimensional vector onto integer index.
tarch::la::Vector< Dimensions, int > dDelinearised(int value, int max)
Counterpart of dLinearised().
int dLinearisedWithoutLookup(const tarch::la::Vector< Dimensions, int > &counter, int max)
Linearisation not Optimised.
void dDec(tarch::la::Vector< Dimensions, int > &counter, int max)
d-dimensional counterpart of decrement operator
CPUGPUMethod int dCmp(const tarch::la::Vector< Dimensions, int > &counter, int max)
Element-wise comparison for the for d-dimensional for loops.
int d3Linearised(const tarch::la::Vector< 3, int > &counter, int max)
Special 3d variant of dLinearised that works also if you compile with other dimensions.
void setupLookupTableForDDelinearised()
tarch::la::Vector< Dimensions, int > dDelinearisedWithoutLookup(int value, int max)
Delinearization not optimised.