H2Lib  3.0
Data Fields
_taskgroup Struct Reference

A collection of tasks for the same callback function. More...

#include <opencl.h>

Data Fields

ptask tasks
 
size_t size
 
task_affinity affinity
 
ptaskgroup next
 
void * data
 
void(* merge_tasks )(ptaskgroup t, void **data)
 
void(* cleanup_merge )(void *data)
 
void(* distribute_results )(ptaskgroup t, void *data)
 
void(* close_taskgroup )(ptaskgroup tg)
 
void(* callback_cpu )(void *data)
 
void(* callback_gpu )(void *data)
 
size_t(* getsize_task )(void *data)
 
void(* split_task )(void *data, void ***splits, uint *n)
 
void(* cleanup_task )(void *data)
 

Detailed Description

A collection of tasks for the same callback function.

Depending on the taskgroup affinity _taskgroup::affinity the computation can either be done on the CPU by the callback _taskgroup::callback_cpu or optionally on the GPU by the second callback function _taskgroup::callback_gpu . In the latter case also the callbacks _taskgroup::merge_tasks, _taskgroup::distribute_results and _taskgroup::cleanup_merge have to be specified. The List of tasks to be processed is given by _taskgroup::tasks and the field _taskgroup::size determines the current matrix elements to be processed by the task list. The amount of storage used by the results can be calculated by the callback _taskgroup::getsize_task. When the scheduler calls a flush on all available taskgroups the callback _taskgroup::close_taskgroup will be called. It is mandatory to supply this callback because some taskgroups might need a chance to close their collection of work before enqueueing them to the scheduler. Also inevitable is the callback _taskgroup::split_task that might split tasks that are too big into smaller chunks, that again might fit into a pending _taskgroup. Finally the callback _taskgroup::cleanup_task takes care of cleaning up temporary data for a given _task.

Field Documentation

task_affinity affinity

Determines the affinity for computation hardware.

void(* callback_cpu) (void *data)

Callback for the computation on the CPU.

void(* callback_gpu) (void *data)

Callback for the computation on the GPU.

void(* cleanup_merge) (void *data)

Cleanup callback for the merged data.

void(* cleanup_task) (void *data)

Cleanup callback for each task of the taskgroup.

void(* close_taskgroup) (ptaskgroup tg)

Close pending work for a taskgroup.

void* data

Additional information about a taskgroup.

void(* distribute_results) (ptaskgroup t, void *data)

Callback for the distribution of output data from GPU computation.

size_t(* getsize_task) (void *data)

Calculate the storage amount for the results.

void(* merge_tasks) (ptaskgroup t, void **data)

Callback for the collection of input data from tasks for the GPU computation.

ptaskgroup next

Pointer to the next taskgroup in the global list

size_t size

Current size of the corresponding matrix elements to be processed.

void(* split_task) (void *data, void ***splits, uint *n)

Splits a _task into number of smaller tasks. The count is returned by n, the array of new tasks is returned by splits.

ptask tasks

The List of tasks to be processed.


The documentation for this struct was generated from the following file: