Template Function shad::rt::asyncExecuteAt(Handle&, const Locality&, FunT&&, const InArgsT&)¶
- Defined in File runtime.h
Function Documentation¶
-
template <typename FunT, typename InArgsT>
voidshad::rt
::
asyncExecuteAt
(Handle &handle, const Locality &loc, FunT &&func, const InArgsT &args) Execute a function on a selected locality asynchronously.
Typical Usage:
struct Args { int a; char b; }; void task(Handle & handle, const Args & args) { /* do something */ } Args args { 2, 'a' }; Handle handle; for (auto & locality : allLocalities) if (static_cast<uint32_t>(locality) % 2) asyncExecuteAt(handle, locality, task, args); waitForCompletion(handle);
- Template Parameters
FunT
: The type of the function to be executed. The function prototype must be:void(Handle &, const InArgsT &);
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