26constexpr std::array<std::int64_t, 2>
local_range(
int index, std::int64_t N,
34 const std::int64_t n = N / size;
35 const std::int64_t r = N % size;
39 return {index * (n + 1), index * (n + 1) + n + 1};
41 return {index * n + r, index * n + r + n};
constexpr std::array< std::int64_t, 2 > local_range(int index, std::int64_t N, int size)
Partition a global range [0, N - 1] across callers into non-overlapping sub-partitions of almost equa...
Definition local_range.h:26