qsim:: ParallelForT

#include <parfor.h>

Helper struct for executing for-loops in parallel across multiple threads.

Summary

Constructors and Destructors

ParallelForT (unsigned num_threads)

Public attributes

num_threads
unsigned

Public functions

GetIndex0 (uint64_t size, unsigned thread_id) const
uint64_t
GetIndex1 (uint64_t size, unsigned thread_id) const
uint64_t
Run (uint64_t size, Function && func, Args &&... args) const
void
RunReduce (uint64_t size, Function && func, Op && op, Args &&... args) const
Op::result_type
RunReduceP (uint64_t size, Function && func, Op && op, Args &&... args) const
std::vector< typename Op::result_type >

Public attributes

num_threads

unsigned qsim::ParallelForT::num_threads

Public functions

GetIndex0

uint64_t qsim::ParallelForT::GetIndex0(
  uint64_t size,
  unsigned thread_id
) const 

GetIndex1

uint64_t qsim::ParallelForT::GetIndex1(
  uint64_t size,
  unsigned thread_id
) const 

ParallelForT

 qsim::ParallelForT::ParallelForT(
  unsigned num_threads
)

Run

void qsim::ParallelForT::Run(
  uint64_t size,
  Function && func,
  Args &&... args
) const 

RunReduce

Op::result_type qsim::ParallelForT::RunReduce(
  uint64_t size,
  Function && func,
  Op && op,
  Args &&... args
) const 

RunReduceP

std::vector< typename Op::result_type > qsim::ParallelForT::RunReduceP(
  uint64_t size,
  Function && func,
  Op && op,
  Args &&... args
) const