Contains all relevant information about a parallel for loop. Contains a collection of Thr objects, the loop's start and end iterations, the chunk size, the number of threads, and the number of threads that have completed their work.
More...
|
| WorkShare (uint num_threads, Thread[] threads, int start, int end, uint chunk_size, Operations? op, IScheduler schedule) |
| The constructor for a WorkShare object. More...
|
|
| WorkShare () |
| Default constructor. More...
|
|
void | AddReductionValue (dynamic value) |
| Add a value to reduction_list. More...
|
|
void | SetLocal< T > (ref T local) |
| Sets the local variable to the appropriate value based on the operation for parallel for reduction loops. For addition and subtraction, the initial starting value is 0. For multiplication, the initial starting value is 1. For binary And, the initial starting value is the bitwise negation of 0. For binary Or and Xor, the initial starting value is 0. For boolean And, the initial starting value is true. For boolean Or, the initial starting value is false. For min, the initial starting value is int.MaxValue. For max, the initial starting value is int.MinValue. More...
|
|
void | PerformLoop< T > (ForAction< T > forAction) |
| Performs a parallel for loop according to the scheduling policy provided. More...
|
|
Contains all relevant information about a parallel for loop. Contains a collection of Thr objects, the loop's start and end iterations, the chunk size, the number of threads, and the number of threads that have completed their work.
◆ WorkShare() [1/2]
DotMP.WorkShare.WorkShare |
( |
uint |
num_threads, |
|
|
Thread[] |
threads, |
|
|
int |
start, |
|
|
int |
end, |
|
|
uint |
chunk_size, |
|
|
Operations? |
op, |
|
|
IScheduler |
schedule |
|
) |
| |
|
inlinepackage |
The constructor for a WorkShare object.
- Parameters
-
num_threads | The number of threads in the WorkShare. |
threads | The Thread[] array of threads. |
start | Starting iteration, inclusive. |
end | Ending iteration, exclusive. |
chunk_size | The chunk size to use. |
op | The operation for reduction, null if not a reduction. |
schedule | The Parallel.Schedule to use. |
◆ WorkShare() [2/2]
DotMP.WorkShare.WorkShare |
( |
| ) |
|
|
inlinepackage |
◆ AddReductionValue()
void DotMP.WorkShare.AddReductionValue |
( |
dynamic |
value | ) |
|
|
inlinepackage |
Add a value to reduction_list.
- Parameters
-
value | The value to add to reduction_list. |
◆ PerformLoop< T >()
void DotMP.WorkShare.PerformLoop< T > |
( |
ForAction< T > |
forAction | ) |
|
|
inlinepackage |
Performs a parallel for loop according to the scheduling policy provided.
- Template Parameters
-
T | The type of reductions, if applicable. |
- Parameters
-
forAction | The function to be executed. |
- Exceptions
-
InternalSchedulerException | Thrown if the internal schedulers throw an exception. |
◆ SetLocal< T >()
void DotMP.WorkShare.SetLocal< T > |
( |
ref T |
local | ) |
|
|
inlinepackage |
Sets the local variable to the appropriate value based on the operation for parallel for reduction loops. For addition and subtraction, the initial starting value is 0. For multiplication, the initial starting value is 1. For binary And, the initial starting value is the bitwise negation of 0. For binary Or and Xor, the initial starting value is 0. For boolean And, the initial starting value is true. For boolean Or, the initial starting value is false. For min, the initial starting value is int.MaxValue. For max, the initial starting value is int.MinValue.
- Template Parameters
-
T | The type of the local variable. |
- Parameters
-
local | The local variable to be set. |
◆ chunk_size_pv
uint DotMP.WorkShare.chunk_size_pv |
|
staticprivate |
The chunk size to be used with the selected scheduler.
◆ in_for_pv
bool [] DotMP.WorkShare.in_for_pv |
|
staticprivate |
Booleans per-thread to check if we're currently in a Parallel.For or Parallel.ForReduction<T>.
◆ reduction_list
volatile List<dynamic> DotMP.WorkShare.reduction_list |
|
staticprivate |
The list of reduction variables from each thread.
◆ schedule_pv
The schedule to be used in the parallel for loop.
◆ start_pv
volatile int DotMP.WorkShare.start_pv |
|
staticprivate |
The starting iteration of the parallel for loop, inclusive.
◆ threads
Thread [] DotMP.WorkShare.threads |
|
staticprivate |
The threads to be used in the parallel for loop.
◆ working_iters
int [] DotMP.WorkShare.working_iters |
|
staticprivate |
The working iterations of each thread.
◆ chunk_size
uint DotMP.WorkShare.chunk_size |
|
getprivate setpackage |
◆ end
The ending iteration of the parallel for loop, exclusive.
◆ in_for
bool DotMP.WorkShare.in_for |
|
getsetpackage |
◆ num_threads
uint DotMP.WorkShare.num_threads |
|
getprivate setpackage |
The number of threads to be used in the parallel for loop.
◆ op
The operation to be performed if doing a reduction.
◆ reduction_values
List<dynamic> DotMP.WorkShare.reduction_values |
|
getpackage |
◆ schedule
◆ start
int DotMP.WorkShare.start |
|
getpackage |
◆ working_iter
int DotMP.WorkShare.working_iter |
|
getpackage |
Get Thr object based on current thread ID.
The documentation for this class was generated from the following file: