15 #ifndef CORE_UTIL_PARTITION_H_
16 #define CORE_UTIL_PARTITION_H_
22 inline void Partition(uint64_t elements, uint64_t batches, uint64_t batch_num,
23 uint64_t* start, uint64_t* end) {
24 auto correction = elements % batches == 0 ? 0 : 1;
25 auto chunk = elements / batches + correction;
26 *start = batch_num * chunk;
27 *end = std::min(elements, *start + chunk);
32 #endif // CORE_UTIL_PARTITION_H_