Grappa  r3821, hash 22cd626d567a91ead5b23302066d1e9469f45c66
Tasking

Functions

template<TaskMode B, GlobalCompletionEvent * C, typename TF = decltype(nullptr)>
void Grappa::spawn (TF tf)
 Synchronizing private task spawn. More...
 
template<typename TF >
void Grappa::privateTask (TF tf)
 Spawn a task visible to this Core only. More...
 
template<typename TF >
void Grappa::publicTask (TF tf)
 Spawn a task that may be stolen between cores. More...
 
template<typename TF >
void Grappa::spawn_worker (TF &&tf)
 internal More...
 
template<TaskMode B = TaskMode::Bound, typename F = decltype(nullptr)>
void Grappa::spawn (F f)
 
template<typename FP >
void Grappa::run (FP fp)
 

Detailed Description

Function Documentation

template<typename TF >
void Grappa::privateTask ( TF  tf)

Spawn a task visible to this Core only.

The task is specified as a functor or lambda. If it is 24 bytes or less, it is copied directly into the task queue. If it is larger, a copy is allocated on the heap. This copy will be deallocated after the task completes.

Template Parameters
TFtype of task functor
Parameters
tffunctor the new task.

Example:

int data = 0;
Grappa::spawn( [&data] { data++; } );

Shove copy of functor into space used for task arguments.

Todo:
: misusing argument list. Is this okay?

// if not, substitute this:

Definition at line 134 of file Tasking.hpp.

template<typename TF >
void Grappa::publicTask ( TF  tf)

Spawn a task that may be stolen between cores.

The task is specified as a functor or lambda, and must be 24 bytes or less (currently).

See also
Grappa::spawn for usage.

Definition at line 163 of file Tasking.hpp.

template<typename FP >
void Grappa::run ( FP  fp)

Definition at line 197 of file Tasking.hpp.

template<TaskMode B = TaskMode::Bound, typename F = decltype(nullptr)>
void Grappa::spawn ( f)

Definition at line 188 of file Tasking.hpp.

template<TaskMode B, GlobalCompletionEvent * C, typename TF = decltype(nullptr)>
void Grappa::spawn ( TF  tf)

Synchronizing private task spawn.

Overload.

Automatically enrolls task with GlobalCompletionEvent and does local complete when done (if GCE is non-null). In this version, GCE is a template parameter to avoid taking up space in the task's args.

Definition at line 416 of file GlobalCompletionEvent.hpp.

template<typename TF >
void Grappa::spawn_worker ( TF &&  tf)

internal

Definition at line 177 of file Tasking.hpp.