Core API, Finish/Async/Forasync for structured parallelism.
More...
|
|
#define | NO_PROP 0 |
| | No properties defined.
|
| |
|
#define | NO_ARG NULL |
| | No arguments provided.
|
| |
|
#define | NO_DATUM NULL |
| | To satisfy a DDF with a 'NULL' value.
|
| |
|
#define | NO_DDF NULL |
| | No DDF argument provided.
|
| |
|
#define | NO_PHASER NULL |
| | No phaser argument provided.
|
| |
|
#define | PHASER_TRANSMIT_ALL ((int) 0x1) |
| | To indicate an async must register with all phasers.
|
| |
|
#define | NO_ACCUM NULL |
| | No accumulator argument provided.
|
| |
|
#define | FORASYNC_MODE_RECURSIVE 1 |
| | Forasync mode to recursively chunk the iteration space.
|
| |
|
#define | FORASYNC_MODE_FLAT 0 |
| | Forasync mode to perform static chunking of the iteration space.
|
| |
|
| typedef void(* | asyncFct_t )(void *arg) |
| | Function prototype executable by an async. More...
|
| |
|
typedef int | forasync_mode_t |
| | forasync mode to control chunking strategy.
|
| |
| typedef void(* | forasync1D_Fct_t )(void *arg, int index) |
| | Function prototype for a 1-dimension forasync. More...
|
| |
| typedef void(* | forasync2D_Fct_t )(void *arg, int index_outer, int index_inner) |
| | Function prototype for a 2-dimensions forasync. More...
|
| |
| typedef void(* | forasync3D_Fct_t )(void *arg, int index_outer, int index_mid, int index_inner) |
| | Function prototype for a 3-dimensions forasync. More...
|
| |
|
|
void | hclib_init (int *argc, char **argv) |
| | Initialize the HClib runtime. Implicitly defines a global finish scope.
|
| |
|
void | hclib_finalize () |
| | Finalize execution of the HClib runtime. Ends the global finish scope and waits for all asyncs to terminate.
|
| |
| void | async (asyncFct_t fct_ptr, void *arg, struct ddf_st **ddf_list, struct _phased_t *phased_clause, int property) |
| | Spawn a new task asynchronously. More...
|
| |
| void | forasync (void *forasync_fct, void *argv, struct ddf_st **ddf_list, struct _phased_t *phased_clause, struct _accumed_t *accumed, int dim, loop_domain_t *domain, forasync_mode_t mode) |
| | Parallel for loop 'forasync' (up to 3 dimensions). More...
|
| |
|
void | start_finish () |
| | starts a new finish scope
|
| |
|
void | end_finish () |
| | ends the current finish scope
|
| |
Core API, Finish/Async/Forasync for structured parallelism.
| typedef void(* asyncFct_t)(void *arg) |
Function prototype executable by an async.
- Parameters
-
| [in] | arg | Arguments to the function |
Definition at line 93 of file hclib.h.
| typedef void(* forasync1D_Fct_t)(void *arg, int index) |
Function prototype for a 1-dimension forasync.
- Parameters
-
| [in] | arg | Argument to the loop iteration |
| [in] | index | Current iteration index |
Definition at line 127 of file hclib.h.
| typedef void(* forasync2D_Fct_t)(void *arg, int index_outer, int index_inner) |
Function prototype for a 2-dimensions forasync.
- Parameters
-
| [in] | arg | Argument to the loop iteration |
| [in] | index_outer | Current outer iteration index |
| [in] | index_inner | Current inner iteration index |
Definition at line 135 of file hclib.h.
| typedef void(* forasync3D_Fct_t)(void *arg, int index_outer, int index_mid, int index_inner) |
Function prototype for a 3-dimensions forasync.
- Parameters
-
| [in] | arg | Argument to the loop iteration |
| [in] | index_outer | Current outer iteration index |
| [in] | index_mid | Current intermediate iteration index |
| [in] | index_inner | Current inner iteration index |
Definition at line 144 of file hclib.h.
| void async |
( |
asyncFct_t |
fct_ptr, |
|
|
void * |
arg, |
|
|
struct ddf_st ** |
ddf_list, |
|
|
struct _phased_t * |
phased_clause, |
|
|
int |
property |
|
) |
| |
Spawn a new task asynchronously.
- Parameters
-
| [in] | fct_ptr | The function to execute |
| [in] | arg | Argument to the async |
| [in] | ddf_list | The list of DDFs the async depends on |
| [in] | phased_clause | Phased clause to specify which phasers the async registers on |
| [in] | property | Flag to pass information to the runtime |
Definition at line 136 of file hclib.c.
Referenced by end_finish().
| void forasync |
( |
void * |
forasync_fct, |
|
|
void * |
argv, |
|
|
struct ddf_st ** |
ddf_list, |
|
|
struct _phased_t * |
phased_clause, |
|
|
struct _accumed_t * |
accumed, |
|
|
int |
dim, |
|
|
loop_domain_t * |
domain, |
|
|
forasync_mode_t |
mode |
|
) |
| |
Parallel for loop 'forasync' (up to 3 dimensions).
Execute iterations of a loop in parallel. The loop domain allows to specify bounds as well as tiling information. Tiling of size one, is equivalent to spawning each individual iteration as an async.
- Parameters
-
| [in] | forasync_fct | The function pointer to execute. |
| [in] | argv | Argument to the function |
| [in] | ddf_list | DDFs dependences |
| [in] | phased_clause | Phasers registration |
| [in] | accumed | Accumulators registration |
| [in] | dim | Dimension of the loop |
| [in] | domain | Loop domains to iterate over (array of size 'dim'). |
| [in] | mode | Forasync mode to control chunking strategy (flat chunking or recursive). |
Definition at line 390 of file forasync.c.