From 0244439006529b11cac7b9a3d0156087ae1657ea Mon Sep 17 00:00:00 2001 From: Sergei Isakov Date: Mon, 6 Jul 2020 19:40:15 +0200 Subject: [PATCH] Add measurement gate. Comment. --- lib/parfor.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/parfor.h b/lib/parfor.h index 99643a7e..a135fa4c 100644 --- a/lib/parfor.h +++ b/lib/parfor.h @@ -25,6 +25,9 @@ namespace qsim { template struct ParallelForT { + // GetIndex0 and GetIndex1 are useful when we need to know how work was + // divided between threads, for instance, for reusing partial sums obtained + // by RunReduceP. static uint64_t GetIndex0( uint64_t size, unsigned num_threads, unsigned thread_id) { return size >= MIN_SIZE ? size * thread_id / num_threads : 0;