Template Function shad::rt::asyncForEachAt(Handle&, const Locality&, FunT&&, const InArgsT&, const size_t)¶
- Defined in File runtime.h
Function Documentation¶
-
template <typename FunT, typename InArgsT>
voidshad::rt
::
asyncForEachAt
(Handle &handle, const Locality &loc, FunT &&func, const InArgsT &args, const size_t numIters) Execute a parallel loop at a specific locality asynchronously.
Typical Usage:
struct Args { int a; char b; }; Args args { 2, 'a' }; Handle handle; shad::rt::asyncForEachAt(locality, [](Handle & handle, const Args & input, size_t itrNum) { // Do something. }, args, iterations, handle); shad::rt::waitForcompletion(handle);
- Template Parameters
FunT
: The type of the function to be executed. The function prototype must be:where the itrNum is the n-th iteration of the loop.void(Handle &, const ArgsT &, size_t itrNum);
InArgsT
: The type of the argument accepted by the function. The type can be a structure or a class but with the restriction that must be memcopy-able.
- Parameters