OpenMP Runtime
Defines | Functions
tomp_task.c File Reference

Implements (1) tasking APIs: GOMP_task, GOMP_taskwait (2) tomp_eoStartTask - the execution object for tasks. More...

#include <string.h>
#include <stdlib.h>
#include "tomp_parallel.h"
#include "tomp_log.h"
#include <c6x.h>
Include dependency graph for tomp_task.c:

Defines

#define ALIGN_SIZE   (sizeof(long long))
 Allocate and initialize a task argument buffer.
#define ALIGN_TO_SIZE(x)   (((x) + ALIGN_SIZE-1) & ~(ALIGN_SIZE-1))

Functions

void GOMP_taskwait (void)
 Called when encountering a taskwait directive.
static void tomp_taskInitArgBuffer (tomp_Task *task, void *arg, int arg_size)
static void tomp_taskCleanup (tomp_Task *task)
 Performs book-keeping activities on completion of task execution.
static void tomp_taskFreeArgBuffer (tomp_Task *task)
 Free up memory allocated for the task argument buffer.
static void tomp_taskFree (tomp_Task *task)
 Free up memory allocated for an explicit task.
void GOMP_task (void(*fn)(void *), void *data, void(*cpyfn)(unsigned char *, unsigned char *), int arg_size, int arg_align, int if_clause, int flags)
 Called when encountering an explicit task directive.
void tomp_eoStartTaskX (tomp_event_t eventHdl)
 Function executed by the worker cores when they pull an event from the task queue.

Detailed Description

Implements (1) tasking APIs: GOMP_task, GOMP_taskwait (2) tomp_eoStartTask - the execution object for tasks.


Define Documentation

#define ALIGN_SIZE   (sizeof(long long))

Allocate and initialize a task argument buffer.

If the arg buffer will fit in an EM buffer, allocate from EM to speed up task generation.

  • em_alloc/em_free ~240 cycles
  • bare-metal malloc/free ~1474 cycles
  • IPC malloc/free ~4578 cycles
Parameters:
taskpointer to task
datapointer to data associated with the task
arg_sizesize of the argument buffer associated with the task

Function Documentation

void GOMP_task ( void(*)(void *)  fn,
void *  data,
void(*)(unsigned char *, unsigned char *)  cpyfn,
int  arg_size,
int  arg_align,
int  if_clause,
int  flags 
)

Called when encountering an explicit task directive.

If IF_CLAUSE is false, then we must not delay in executing the task. If UNTIED is true, then the task may be executed by any member of the team.

Here is the call graph for this function:

static void tomp_taskCleanup ( tomp_Task task) [static]

Performs book-keeping activities on completion of task execution.

This function modifies shared variables - task_count and children_count. Therefore, task lock must be acquired on entry to & released on exit.

Parameters:
taskPointer to a task that has completed execution.
See also:
tomp_eoStartTask

Here is the call graph for this function:

Here is the caller graph for this function:

static void tomp_taskFree ( tomp_Task task) [inline, static]

Free up memory allocated for an explicit task.

Parameters:
taskpointer to a task

Here is the call graph for this function:

Here is the caller graph for this function:

static void tomp_taskFreeArgBuffer ( tomp_Task task) [inline, static]

Free up memory allocated for the task argument buffer.

Parameters:
taskpointer to a task

Here is the caller graph for this function:

 All Classes Files Functions Variables Typedefs Enumerations Defines