Embedded Multicore Building Blocks V1.0.0
|
Describes the execution policy of a parallel algorithm. More...
#include <execution_policy.h>
Public Member Functions | |
ExecutionPolicy () | |
Constructs the default execution policy. More... | |
ExecutionPolicy (bool initial_affinity, mtapi_uint_t priority) | |
Constructs an execution policy with the specified affinity and priority. More... | |
ExecutionPolicy (mtapi_uint_t priority) | |
Constructs an execution policy with the specified priority. More... | |
ExecutionPolicy (bool initial_affinity) | |
Constructs an execution policy with the specified affinity. More... | |
void | AddWorker (mtapi_uint_t worker) |
Sets affinity to a specific worker thread. More... | |
void | RemoveWorker (mtapi_uint_t worker) |
Removes affinity to a specific worker thread. More... | |
bool | IsSetWorker (mtapi_uint_t worker) |
Checks if affinity to a specific worker thread is set. More... | |
unsigned int | GetCoreCount () const |
Returns the number of cores the policy is affine to. More... | |
mtapi_affinity_t | GetAffinity () const |
Returns the affinity. More... | |
mtapi_uint_t | GetPriority () const |
Returns the priority. More... | |
Describes the execution policy of a parallel algorithm.
The execution policy comprises
The priority is a number between 0 (denoting the highest priority) to max_priorities - 1 as given during initialization using Node::Initialize(). The default value of max_priorities is 4.
embb::mtapi::ExecutionPolicy::ExecutionPolicy | ( | ) |
Constructs the default execution policy.
Sets the affinity to all worker threads and the priority to the default value.
embb::mtapi::ExecutionPolicy::ExecutionPolicy | ( | bool | initial_affinity, |
mtapi_uint_t | priority | ||
) |
Constructs an execution policy with the specified affinity and priority.
[in] | initial_affinity | true sets the affinity to all worker threads, false to no worker threads. |
[in] | priority | Priority for the execution policy. |
|
explicit |
Constructs an execution policy with the specified priority.
Sets the affinity to all worker threads.
[in] | priority | Priority for the execution policy. |
|
explicit |
Constructs an execution policy with the specified affinity.
Sets the priority to the default value.
[in] | initial_affinity | true sets the affinity to all worker threads, false to no worker threads. |
void embb::mtapi::ExecutionPolicy::AddWorker | ( | mtapi_uint_t | worker | ) |
Sets affinity to a specific worker thread.
[in] | worker | Worker thread index |
void embb::mtapi::ExecutionPolicy::RemoveWorker | ( | mtapi_uint_t | worker | ) |
Removes affinity to a specific worker thread.
[in] | worker | Worker thread index |
bool embb::mtapi::ExecutionPolicy::IsSetWorker | ( | mtapi_uint_t | worker | ) |
Checks if affinity to a specific worker thread is set.
true
if affinity is set, otherwise false
[in] | worker | Worker thread index |
unsigned int embb::mtapi::ExecutionPolicy::GetCoreCount | ( | ) | const |
Returns the number of cores the policy is affine to.
mtapi_affinity_t embb::mtapi::ExecutionPolicy::GetAffinity | ( | ) | const |
Returns the affinity.
mtapi_uint_t embb::mtapi::ExecutionPolicy::GetPriority | ( | ) | const |
Returns the priority.