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>
25 #ifdef TBB_OLD_BLOCKED_RANGE_ND
29 using blocked_nd_range = blocked_rangeNd;
34#if defined(SharedSYCL)
40#define CPUGPUMethod SYCL_EXTERNAL
320#define dfor(counter, max) \
321 for (tarch::la::Vector<Dimensions, int> counter = peano4::utils::dStartVector(); peano4::utils::dCmp(counter, max); \
322 peano4::utils::dInc(counter, max))
453#define parallelFor(counter, max) \
454 parallelForWithSchedulerInstructions(counter, max, ::peano4::utils::LoopPlacement::SpreadOut)
456#define simtFor(counter, max) \
457 simtForWithSchedulerInstructions(counter, max, ::peano4::utils::LoopPlacement::SpreadOut)
459#define parallelDfor(counter, max) \
460 parallelDforWithSchedulerInstructions(counter, max, ::peano4::utils::LoopPlacement::SpreadOut)
463#define parallelDforWithSchedulerInstructions(counter, max, loopPlacement) \
464 parallelDforWithSchedulerInstructions2d(counter, max, loopPlacement)
466#define parallelDPlusOneForWithSchedulerInstructions(counter, max, loopPlacement) \
467 parallelDforWithSchedulerInstructions3d(counter, max, loopPlacement)
469#define parallelDPlusTwoForWithSchedulerInstructions(counter, max, loopPlacement) \
470 parallelDforWithSchedulerInstructions4d(counter, max, loopPlacement)
472#define simtDforWithSchedulerInstructions(counter, max, loopPlacement) \
473 simtDforWithSchedulerInstructions2d(counter, max, loopPlacement)
475#define simtDPlusOneForWithSchedulerInstructions(counter, max, loopPlacement) \
476 simtDforWithSchedulerInstructions3d(counter, max, loopPlacement)
478#define simtDPlusTwoForWithSchedulerInstructions(counter, max, loopPlacement) \
479 simtDforWithSchedulerInstructions4d(counter, max, loopPlacement)
481#define parallelDforWithSchedulerInstructions(counter, max, loopPlacement) \
482 parallelDforWithSchedulerInstructions3d(counter, max, loopPlacement)
484#define parallelDPlusOneForWithSchedulerInstructions(counter, max, loopPlacement) \
485 parallelDforWithSchedulerInstructions4d(counter, max, loopPlacement)
487#define parallelDPlusTwoForWithSchedulerInstructions(counter, max, loopPlacement) \
488 parallelDforWithSchedulerInstructions5d(counter, max, loopPlacement)
490#define simtDforWithSchedulerInstructions(counter, max, loopPlacement) \
491 simtDforWithSchedulerInstructions3d(counter, max, loopPlacement)
493#define simtDPlusOneForWithSchedulerInstructions(counter, max, loopPlacement) \
494 simtDforWithSchedulerInstructions4d(counter, max, loopPlacement)
496#define simtDPlusTwoForWithSchedulerInstructions(counter, max, loopPlacement) \
497 simtDforWithSchedulerInstructions5d(counter, max, loopPlacement)
501#if defined(SharedOMP) and defined(OpenMPTaskGroup)
503#elif defined(SharedOMP) and !defined(OpenMPTaskGroup)
505#elif defined(SharedTBB)
507#elif defined(SharedCPP)
510#elif defined(SharedSYCL)
513#define parallelForWithSchedulerInstructions(counter, max, loopPlacement) \
514 for (int counter = 0; counter < max; counter++) {
516#define parallelDforWithSchedulerInstructions2d(counter, max, loopPlacement) \
518 tarch::la::Vector<2, 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 tarch::la::Vector<2, int> counter = {counter##0, counter##1};
523#define parallelDforWithSchedulerInstructions3d(counter, max, loopPlacement) \
525 tarch::la::Vector<3, int> counter##Max(max); \
526 for (int counter##0 = 0; counter##0 < counter##Max(0); counter##0 ++) \
527 for (int counter##1 = 0; counter##1 < counter##Max(1); counter##1 ++) \
528 for (int counter##2 = 0; counter##2 < counter##Max(2); counter##2 ++) { \
529 tarch::la::Vector<3, int> counter = {counter##0, counter##1, counter##2};
531#define parallelDforWithSchedulerInstructions4d(counter, max, loopPlacement) \
533 tarch::la::Vector<4, int> counter##Max(max); \
534 for (int counter##0 = 0; counter##0 < counter##Max(0); counter##0 ++) \
535 for (int counter##1 = 0; counter##1 < counter##Max(1); counter##1 ++) \
536 for (int counter##2 = 0; counter##2 < counter##Max(2); counter##2 ++) \
537 for (int counter##3 = 0; counter##3 < counter##Max(3); counter##3 ++) { \
538 tarch::la::Vector<4, int> counter = {counter##0, counter##1, counter##2, counter##3};
540#define parallelDforWithSchedulerInstructions5d(counter, max, loopPlacement) \
542 tarch::la::Vector<5, int> counter##Max(max); \
543 for (int counter##0 = 0; counter##0 < counter##Max(0); counter##0 ++) \
544 for (int counter##1 = 0; counter##1 < counter##Max(1); counter##1 ++) \
545 for (int counter##2 = 0; counter##2 < counter##Max(2); counter##2 ++) \
546 for (int counter##3 = 0; counter##3 < counter##Max(3); counter##3 ++) \
547 for (int counter##4 = 0; counter##4 < counter##Max(4); counter##4 ++) { \
548 tarch::la::Vector<5, int> counter = {counter##0, counter##1, counter##2, counter##3, counter##4};
550#define endParallelFor }
551#define endParallelDfor \
556#define simtForWithSchedulerInstructions(counter, max, loopPlacement) \
557 for (int counter = 0; counter < max; counter++) {
559#define endSimtFor endParallelFor
561#define simtDforWithSchedulerInstructions2d(counter, max, loopPlacement) \
562 parallelDforWithSchedulerInstructions2d(counter, max, loopPlacement)
564#define simtDforWithSchedulerInstructions3d(counter, max, loopPlacement) \
565 parallelDforWithSchedulerInstructions3d(counter, max, loopPlacement)
567#define simtDforWithSchedulerInstructions4d(counter, max, loopPlacement) \
568 parallelDforWithSchedulerInstructions4d(counter, max, loopPlacement)
570#define simtDforWithSchedulerInstructions5d(counter, max, loopPlacement) \
571 parallelDforWithSchedulerInstructions5d(counter, max, loopPlacement)
573#define endSimtDfor endParallelDfor
608#define dfor4(counter) \
609 for (int counter##Scalar = 0; counter##Scalar < FOUR_POWER_D; counter##Scalar++) { \
610 tarch::la::Vector<Dimensions, int> counter; \
612 int copy##counter##Scalar = counter##Scalar; \
613 for (int counter##ddd = Dimensions - 1; counter##ddd >= 0; counter##ddd--) { \
614 int counter##aPowI = 1; \
615 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
616 counter##aPowI *= 4; \
618 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
619 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
654#define dfor3(counter) \
655 for (int counter##Scalar = 0; counter##Scalar < ThreePowerD; counter##Scalar++) { \
656 tarch::la::Vector<Dimensions, int> counter; \
658 int copy##counter##Scalar = counter##Scalar; \
659 for (int counter##ddd = Dimensions - 1; counter##ddd >= 0; counter##ddd--) { \
660 int counter##aPowI = 1; \
661 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
662 counter##aPowI *= 3; \
664 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
665 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
670#define dfor5(counter) \
671 for (int counter##Scalar = 0; counter##Scalar < FIVE_POWER_D; counter##Scalar++) { \
672 tarch::la::Vector<Dimensions, int> counter; \
674 int copy##counter##Scalar = counter##Scalar; \
675 for (int counter##ddd = Dimensions - 1; counter##ddd >= 0; counter##ddd--) { \
676 int counter##aPowI = 1; \
677 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
678 counter##aPowI *= 5; \
680 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
681 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
685#define dfor7(counter) \
686 for (int counter##Scalar = 0; counter##Scalar < SEVEN_POWER_D; counter##Scalar++) { \
687 tarch::la::Vector<Dimensions, int> counter; \
689 int copy##counter##Scalar = counter##Scalar; \
690 for (int counter##ddd = Dimensions - 1; counter##ddd >= 0; counter##ddd--) { \
691 int counter##aPowI = 1; \
692 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
693 counter##aPowI *= 7; \
695 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
696 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
701#define dfor9(counter) \
702 for (int counter##Scalar = 0; counter##Scalar < NINE_POWER_D; counter##Scalar++) { \
703 tarch::la::Vector<Dimensions, int> counter; \
705 int copy##counter##Scalar = counter##Scalar; \
706 for (int counter##ddd = Dimensions - 1; counter##ddd >= 0; counter##ddd--) { \
707 int counter##aPowI = 1; \
708 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
709 counter##aPowI *= 9; \
711 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
712 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
730#define d2for(counter, max) \
731 for (int counter##Scalar = 0; counter##Scalar < tarch::la::aPowI(2, max); counter##Scalar++) { \
732 tarch::la::Vector<2, int> counter; \
734 int copy##counter##Scalar = counter##Scalar; \
735 for (int counter##ddd = 2 - 1; counter##ddd >= 0; counter##ddd--) { \
736 int counter##aPowI = 1; \
737 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
738 counter##aPowI *= max; \
740 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
741 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
751#define d2for2(counter) \
752 for (int counter##Scalar = 0; counter##Scalar < tarch::la::aPowI(2, 2); counter##Scalar++) { \
753 tarch::la::Vector<2, int> counter; \
755 int copy##counter##Scalar = counter##Scalar; \
756 for (int counter##ddd = 2 - 1; counter##ddd >= 0; counter##ddd--) { \
757 int counter##aPowI = 1; \
758 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
759 counter##aPowI *= 2; \
761 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
762 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
772#define d3for2(counter) \
773 for (int counter##Scalar = 0; counter##Scalar < tarch::la::aPowI(3, 2); counter##Scalar++) { \
774 tarch::la::Vector<3, int> counter; \
776 int copy##counter##Scalar = counter##Scalar; \
777 for (int counter##ddd = 3 - 1; counter##ddd >= 0; counter##ddd--) { \
778 int counter##aPowI = 1; \
779 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
780 counter##aPowI *= 2; \
782 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
783 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
802#define d3for(counter, max) \
803 for (int counter##Scalar = 0; counter##Scalar < tarch::la::aPowI(3, max); counter##Scalar++) { \
804 tarch::la::Vector<3, int> counter; \
806 int copy##counter##Scalar = counter##Scalar; \
807 for (int counter##ddd = 3 - 1; counter##ddd >= 0; counter##ddd--) { \
808 int counter##aPowI = 1; \
809 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
810 counter##aPowI *= max; \
812 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
813 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
824#define d2for3(counter) \
825 for (int counter##Scalar = 0; counter##Scalar < tarch::la::aPowI(2, 3); counter##Scalar++) { \
826 tarch::la::Vector<2, int> counter; \
828 int copy##counter##Scalar = counter##Scalar; \
829 for (int counter##ddd = 2 - 1; counter##ddd >= 0; counter##ddd--) { \
830 int counter##aPowI = 1; \
831 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
832 counter##aPowI *= 3; \
834 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
835 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
845#define d3for3(counter) \
846 for (int counter##Scalar = 0; counter##Scalar < tarch::la::aPowI(3, 3); counter##Scalar++) { \
847 tarch::la::Vector<3, int> counter; \
849 int copy##counter##Scalar = counter##Scalar; \
850 for (int counter##ddd = 3 - 1; counter##ddd >= 0; counter##ddd--) { \
851 int counter##aPowI = 1; \
852 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
853 counter##aPowI *= 3; \
855 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
856 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
897#define dfor2(counter) \
898 for (int counter##Scalar = 0, AA##counter = 0, BB##counter = 0; counter##Scalar < TwoPowerD; counter##Scalar++) { \
899 tarch::la::Vector<Dimensions, int> counter; \
900 counter(0) = AA##counter; \
901 counter(1) = BB##counter; \
902 AA##counter = !AA##counter; \
903 BB##counter = !(AA##counter ^ BB##counter);
906#define dfor2(counter) \
907 for (int counter##Scalar = 0, AA##counter = 0, BB##counter = 0, CC##counter = 0; counter##Scalar < TwoPowerD; \
908 counter##Scalar++) { \
909 tarch::la::Vector<Dimensions, int> counter; \
910 counter(0) = AA##counter; \
911 counter(1) = BB##counter; \
912 counter(2) = CC##counter; \
913 AA##counter = !AA##counter; \
914 BB##counter = !(AA##counter ^ BB##counter); \
915 CC##counter = CC##counter || (!AA##counter && !BB##counter && !CC##counter);
918#define dfor2(counter) \
919 for (int counter##Scalar = 0; counter##Scalar < TwoPowerD; counter##Scalar++) { \
920 tarch::la::Vector<Dimensions, int> counter; \
922 int copy##counter##Scalar = counter##Scalar; \
923 for (int counter##ddd = Dimensions - 1; counter##ddd >= 0; counter##ddd--) { \
924 int counter##aPowI = 1; \
925 for (int counter##jjj = 0; counter##jjj < counter##ddd; counter##jjj++) { \
926 counter##aPowI *= 2; \
928 counter(counter##ddd) = copy##counter##Scalar / counter##aPowI; \
929 copy##counter##Scalar -= counter(counter##ddd) * counter##aPowI; \
949#define dfore(counter, max, dim, value) \
950 for (tarch::la::Vector<Dimensions, int> counter = peano4::utils::dStartVector(dim, value); \
951 peano4::utils::dCmp(counter, max); \
952 peano4::utils::dInc(counter, max, dim))
986#define zfor(counter, max, direction) \
988 for (tarch::la::Vector<Dimensions, int> counter = peano4::utils::dStartVector(max, direction); \
989 peano4::utils::dCmp(counter, max); \
990 peano4::utils::dInc(counter, max, direction)) {
1000static const int lookupzfor3[4][9][2] = {
1001 {{2, 2}, {1, 2}, {0, 2}, {0, 1}, {1, 1}, {2, 1}, {2, 0}, {1, 0}, {0, 0}},
1002 {{0, 2}, {1, 2}, {2, 2}, {2, 1}, {1, 1}, {0, 1}, {0, 0}, {1, 0}, {2, 0}},
1003 {{2, 0}, {1, 0}, {0, 0}, {0, 1}, {1, 1}, {2, 1}, {2, 2}, {1, 2}, {0, 2}},
1004 {{0, 0}, {1, 0}, {2, 0}, {2, 1}, {1, 1}, {0, 1}, {0, 2}, {1, 2}, {2, 2}}};
1006#define zfor3(counter, direction) \
1008 tarch::la::Vector<Dimensions, int> counter; \
1009 int counter##initDir = static_cast<int>(direction.to_ulong()); \
1010 for (int counter##i = 0; counter##i < 9; ++counter##i) { \
1011 counter(0) = lookupzfor3[counter##initDir][counter##i][0]; \
1012 counter(1) = lookupzfor3[counter##initDir][counter##i][1];
1014#elif Dimensions == 3
1015static const int lookupzfor3[8][27][3] = {
1016 {{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},
1017 {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},
1018 {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}},
1019 {{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},
1020 {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},
1021 {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}},
1022 {{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},
1023 {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},
1024 {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}},
1025 {{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},
1026 {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},
1027 {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}},
1028 {{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},
1029 {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},
1030 {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}},
1031 {{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},
1032 {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},
1033 {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}},
1034 {{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},
1035 {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},
1036 {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}},
1037 {{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},
1038 {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},
1039 {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}}};
1041#define zfor3(counter, direction) \
1043 tarch::la::Vector<Dimensions, int> counter; \
1044 int counter##initDir = static_cast<int>(direction.to_ulong()); \
1045 for (int counter##i = 0; counter##i < 27; ++counter##i) { \
1046 counter(0) = lookupzfor3[counter##initDir][counter##i][0]; \
1047 counter(1) = lookupzfor3[counter##initDir][counter##i][1]; \
1048 counter(2) = lookupzfor3[counter##initDir][counter##i][2];
1051#define zfor3(counter, direction) zfor(counter, 3, direction)
std::string toString(peano4::utils::LoopPlacement)
CPUGPUMethod void dInc(tarch::la::Vector< Dimensions, int > &counter, int max)
d-dimensional counterpart of increment operator
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.
std::bitset< Dimensions > LoopDirection
Is used by the z-loop.
LoopPlacement
Guide loop-level parallelism.
CPUGPUMethod int dLinearised(const tarch::la::Vector< Dimensions, int > &counter, int max)
Map d-dimensional vector onto integer index.
CPUGPUMethod int dCmp(const tarch::la::Vector< Dimensions, int > &counter, int max)
Element-wise comparison for the for d-dimensional for loops.
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().
CPUGPUMethod tarch::la::Vector< Dimensions, int > dStartVector()
Construct start vector (0,0,....) for d-dimensional loop.
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()
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
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.
I've written an API to IIT, but I'm not currently using.