Local concurrent operations.
More...
|
struct | full_range |
| This class computes full range size if prefix or subinterval of the range is not specified. More...
|
|
struct | prefix_range |
| This class computes the range based on the prefix specified. More...
|
|
struct | sub_range |
| This class computes subinterval of a range based on the starting and ending indices provided. More...
|
|
|
#define | forall(it, P, name) |
| A parallel range-for loop.
|
|
#define | reduceall(it, ref, p, R, T, name) |
| A parallel reduction loop.
|
|
|
template<class M , class... RR> |
auto | mdiota_view (const M &m, RR... rr) |
| Compute the Cartesian product of several intervals of integers.
|
|
template<typename Policy , typename Lambda > |
void | parallel_for (Policy &&p, Lambda &&lambda, const std::string &name="") |
| Call a function on each element of a range, potentially in parallel.
|
|
template<class R , class T , typename Policy , typename Lambda > |
T | parallel_reduce (Policy &&p, Lambda &&lambda, const std::string &name="") |
| Perform a reduction based on the elements of a range, potentially in parallel.
|
|
Local concurrent operations.
If Kokkos is not available, they simply execute serially. To avoid unnecessary copies, one needs to pass a view since the ranges provided by the user are copied.
◆ forall
#define forall |
( |
|
it, |
|
|
|
P, |
|
|
|
name |
|
) |
| |
A parallel range-for loop.
Follow with a compound statement and ;
. Often the elements of range (and thus the values of it
) are indices for other ranges.
- Parameters
-
it | variable name to introduce |
P | sized random-access range |
name | debugging name, convertible to std::string |
◆ reduceall
#define reduceall |
( |
|
it, |
|
|
|
ref, |
|
|
|
p, |
|
|
|
R, |
|
|
|
T, |
|
|
|
name |
|
) |
| |
A parallel reduction loop.
Follow with a compound statement to form an expression. Often the elements of range (and thus the values of it
) are indices for other ranges.
- Parameters
-
it | variable name to introduce for elements |
ref | variable name to introduce for storing results; call it with each value participating in the reduction |
p | sized random-access range |
R | reduction operation type |
T | data type |
name | debugging name, convertible to std::string |
- Returns
- the reduced result
◆ mdiota_view()
template<class M , class... RR>
auto mdiota_view |
( |
const M & |
m, |
|
|
RR... |
rr |
|
) |
| |
Compute the Cartesian product of several intervals of integers.
- Parameters
-
- Returns
- sized random-access range of
std::array
objects, each with one index of type range_index
for each argument in rr
◆ parallel_for()
template<typename Policy , typename Lambda >
void parallel_for |
( |
Policy && |
p, |
|
|
Lambda && |
lambda, |
|
|
const std::string & |
name = "" |
|
) |
| |
Call a function on each element of a range, potentially in parallel.
If GPU support is available, lambda is executed there.
- Parameters
-
p | sized random-access range |
name | operation name, for debugging |
◆ parallel_reduce()
template<class R , class T , typename Policy , typename Lambda >
T parallel_reduce |
( |
Policy && |
p, |
|
|
Lambda && |
lambda, |
|
|
const std::string & |
name = "" |
|
) |
| |
Perform a reduction based on the elements of a range, potentially in parallel.
If GPU support is available, lambda is executed there.
- Template Parameters
-
R | reduction operation type |
T | data type |
Lambda | function of an element of p and a function object that calls the latter with each value participating in the reduction |
- Parameters
-
p | sized random-access range |
name | operation name, for debugging |