dispenso
A library for task parallelism
 
Loading...
Searching...
No Matches
dispenso::ParForOptions Struct Reference

#include <parallel_for.h>

Public Attributes

uint32_t maxThreads = std::numeric_limits<int32_t>::max()
 
bool wait = true
 
ParForChunking defaultChunking = ParForChunking::kStatic
 
uint32_t minItemsPerChunk = 1
 
bool reuseExistingState = false
 

Detailed Description

A set of options to control parallel_for

Definition at line 38 of file parallel_for.h.

Member Data Documentation

◆ defaultChunking

ParForChunking dispenso::ParForOptions::defaultChunking = ParForChunking::kStatic

Specify whether default chunking should be static or auto (dynamic load balancing). This is used when invoking the version of parallel_for that takes index parameters (vs a ChunkedRange).

Definition at line 59 of file parallel_for.h.

◆ maxThreads

uint32_t dispenso::ParForOptions::maxThreads = std::numeric_limits<int32_t>::max()

The maximum number of threads to use. This can be used to limit the number of threads below the number associated with the TaskSet's thread pool to control the degree of concurrency. Setting maxThreads to zero or one will result in serial operation.

Definition at line 44 of file parallel_for.h.

◆ minItemsPerChunk

uint32_t dispenso::ParForOptions::minItemsPerChunk = 1

Specify a minimum number of items per chunk for static or auto dynamic load balancing. Cheaper workloads should have a higher number of minWorkItems. Will be ignored if an explicit chunk size is provided to ChunkedRange.

Definition at line 66 of file parallel_for.h.

◆ reuseExistingState

bool dispenso::ParForOptions::reuseExistingState = false

When set to false, and StateContainers are supplied to parallel_for, re-create container from scratch each call to parallel_for. When true, reuse existing state as much as possible (only create new state if we require more than is already available in the container).

Definition at line 73 of file parallel_for.h.

◆ wait

bool dispenso::ParForOptions::wait = true

Specify whether the return of the parallel_for signifies the work is complete. If the parallel_for is initiated without providing a TaskSet, the parallel_for will always wait.

Note
If wait is true, the calling thread will always participate in computation. If this is not desired, pass wait as false, and wait manually outside of the parallel_for on the passed TaskSet.

Definition at line 53 of file parallel_for.h.


The documentation for this struct was generated from the following file: