Class
ExecutionPolicyPolicy to select runtime execution mode for algorithms.
Policy to select runtime execution mode for algorithms.
All Subcl's | WavefrontExecutionPolicy |
---|---|
Defined in | <seqan/parallel.h> |
Signature |
template<typename TThreadingMode, typename TVectorizationMode>
struct ExecutionPolicy;
|
Template Parameters
TThreadingMode |
Type specifying the threading model. Can be Parallel or Serial (default). |
---|---|
TVectorizationMode |
Type specifying the vectorization model. Can be Vectorial or Serial (default). |
Interface Function Overview
-
auto numThreads(exec);
Getter function for the thread number. -
void setNumThreads(exec, n);
Setter function for the thread number.
Interface Metafunction Overview
-
IsExecutionPolicy<T>::VALUE
Checks if a given type is an ExecutionPolicy. -
IsParallel<TExecPolicy>::VALUE
-
IsVectorized<TExecPolicy>::VALUE
Member Variable Overview
-
size_t ExecutionPolicy::numThreads
The number of threads to use for the parallel execution. Defaults to 1.
Detailed Description
The ExecutionPolicy class is used to select different execution models for certain algorithms. Depending on the specialization of the template parameters 4 different modes are possible: sequential, parallel, vectorized and parallel+vectorized. The number of threads for the parallel execution modes can be configured via a member variable.
Interface Functions Detail
auto numThreads(exec);
Getter function for the thread number.
Parameters
exec
|
The ExecutionPolicy to get the number of threads for. |
---|
Returns
auto |
The number of threads. |
---|
Data Races
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
void setNumThreads(exec, n);
Setter function for the thread number.
Parameters
exec
|
The ExecutionPolicy to set the number of threads for. |
---|---|
n
|
The number of threads used for the parallel execution. |
Data Races
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
Member Variables Detail
size_t ExecutionPolicy::numThreads
The number of threads to use for the parallel execution. Defaults to 1.