FleCSI Core API Version: 2.4.0
 
Loading...
Searching...
No Matches

Local concurrent operations. More...

Classes

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...
 

Macros

#define forall(it, ...)
 A parallel range-for loop.
 
#define reduceall(it, ref, p, R, T, ...)
 A parallel reduction loop.
 

Functions

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 >
parallel_reduce (Policy &&p, Lambda &&lambda, const std::string &name="")
 Perform a reduction based on the elements of a range, potentially in parallel.
 

Detailed Description

Local concurrent operations.

They use the default Kokkos execution space. To avoid unnecessary copies, one needs to pass a view since the ranges provided by the user are copied.

Macro Definition Documentation

◆ forall

#define forall ( it,
... )

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.

Use as a member function; use in isolation is deprecated.

Parameters
itvariable name to introduce
Psized random-access range
nameoptional debugging name, convertible to std::string; not available for the member function form

◆ reduceall

#define reduceall ( it,
ref,
p,
R,
T,
... )

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.

Use as a member function; use in isolation is deprecated.

Parameters
itvariable name to introduce for elements
refvariable name to introduce for storing results; call it with each value participating in the reduction
psized random-access range
Rreduction operation type
Tdata type
nameas for forall
Returns
the reduced result

Function Documentation

◆ 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
mmdspan or mdcolex object
rrfull_range, prefix_range, or sub_range objects for each dimension
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
psized random-access range
nameoperation name, for debugging
Deprecated
Use accelerator::for_each.

◆ parallel_reduce()

template<class R , class T , typename Policy , typename Lambda >
T parallel_reduce ( Policy && p,
Lambda && lambda,
const std::string & name = "" )
nodiscard

Perform a reduction based on the elements of a range, potentially in parallel.

If GPU support is available, lambda is executed there.

Template Parameters
Rreduction operation type
Tdata type
Lambdafunction of an element of p and a function object that calls the latter with each value participating in the reduction
Parameters
psized random-access range
nameoperation name, for debugging
Deprecated
Use accelerator::reduce.