Grappa  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 121 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 150 of file Tasking.hpp.

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

Definition at line 184 of file Tasking.hpp.

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

Definition at line 175 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 337 of file GlobalCompletionEvent.hpp.

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

internal

Definition at line 164 of file Tasking.hpp.