Skip to content

Commit

Permalink
Add measurement gate. Comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeisakov committed Jul 6, 2020
1 parent 64d7c94 commit 0244439
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/parfor.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ namespace qsim {

template <uint64_t MIN_SIZE>
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;
Expand Down

0 comments on commit 0244439

Please sign in to comment.