|
RAJA
RAJA provides a collection of platform portability abstractions for C++ HPC applications.
|
#include <types.hpp>
StridedLoop assumes the loop has fewer iterations than indices and maps a single iteration to a range of indices strided by the number of iterations in the loop.
For example a loop with 3 iterations mapping indices from a range of size 8. int iterations = 3; int range_size = 8; for (int i = 0; i < iterations; ++i) { printf("%i -> {", i); int index = i; if (index < range_size) { printf("%i", i); for (index += iterations; index < range_size; index += iterations) { printf(", %i", i); } } printf("}"); } // 0 -> {0, 3, 6} // 1 -> {1, 4, 7} // 2 -> {2, 5}