Arax -8d09c51940345c86062e8ef2427c705ae66e5926
A Runtime Framework for Decoupling Applications from Heterogeneous Accelerators
Loading...
Searching...
No Matches
Public Task user API

Functions

arax_taskarax_task_issue (arax_accel *accel, arax_proc *proc, const void *host_init, size_t host_size, size_t in_count, arax_data **dev_in, size_t out_count, arax_data **dev_out)
 
arax_task_state_e arax_task_issue_sync (arax_accel *accel, arax_proc *proc, void *host_init, size_t host_size, size_t in_count, arax_data **dev_in, size_t out_count, arax_data **dev_out)
 
arax_task_state_e arax_task_stat (arax_task *task, arax_task_stats_s *stats)
 
arax_task_state_e arax_task_wait (arax_task *task)
 
void arax_task_free (arax_task *task)
 

Detailed Description

Functions usable from applications for manipulating Tasks.

Function Documentation

◆ arax_task_free()

void arax_task_free ( arax_task * task)

Decrease ref counter of task

Parameters
taskThe task to wait for.
Returns
Nothing.

Definition at line 524 of file impl.c.

References arax_object_ref_dec(), and arax_task_msg::obj.

Referenced by arax_data_allocate_remote(), arax_data_get(), and arax_task_issue_sync().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ arax_task_issue()

arax_task * arax_task_issue ( arax_accel * accel,
arax_proc * proc,
const void * host_init,
size_t host_size,
size_t in_count,
arax_data ** dev_in,
size_t out_count,
arax_data ** dev_out )

Issue a new arax_task.

This call must be followed by calls to arax_task_wait() and arax_task_free().

After arax_task_wait() and before arax_task_free(), arax_task_host_data() can be called to read updated host values.

Parameters
accelThe accelerator responsible for executing the task.
procarax_proc to be dispatched on accelerator.
host_initHost accesible data initial values. May be null. Will not be modified.
host_sizeSize of host_init data.
in_countsize of input array (elements).
dev_inarray of arax_data pointers with input data.
out_countsize of output array (elements).
dev_outarray of arax_data pointers with output data.
Returns
arax_task * corresponding to the issued function invocation.

Definition at line 467 of file impl.c.

References arax_assert, arax_pipe_get, arax_task_alloc(), arax_task_host_data(), arax_task_submit(), check_semantics(), and vpipe.

Referenced by arax_data_allocate_remote(), arax_data_get(), arax_data_set(), ARAX_OBJ_DTOR_DECL(), and arax_task_issue_sync().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ arax_task_issue_sync()

arax_task_state_e arax_task_issue_sync ( arax_accel * accel,
arax_proc * proc,
void * host_init,
size_t host_size,
size_t in_count,
arax_data ** dev_in,
size_t out_count,
arax_data ** dev_out )

Helper function for issueing,waiting and freeing a task.

Parameters
accelThe accelerator responsible for executing the task.
procarax_proc to be dispatched on accelerator.
host_initHost accesible data initial values. May be null. Will not be modified.
host_sizeSize of host_init data.
in_countsize of input array (elements).
dev_inarray of arax_data pointers with input data.
out_countsize of output array (elements).
dev_outarray of arax_data pointers with output data.
Returns
Returs the status as returned from arax_task_wait().

Definition at line 490 of file impl.c.

References arax_task_free(), arax_task_issue(), and arax_task_wait().

+ Here is the call graph for this function:

◆ arax_task_stat()

arax_task_state_e arax_task_stat ( arax_task * task,
arax_task_stats_s * stats )

Get arax_task status and statistics. If stats is not NULL, copy task statistics to stats.

Note
This function does not call arax_task_wait(), so the user must call it before accessing related arax_buffers.
Parameters
taskThe arax_task of interest.
statsPointer to an allocated arax_task_stats struct to be filled with statistics.
Returns
The current arax_task_state of the task.

Definition at line 502 of file impl.c.

References arax_task_msg::state, and arax_task_msg::stats.

◆ arax_task_wait()

arax_task_state_e arax_task_wait ( arax_task * task)

Wait for an issued task to complete or fail.

When provided task is successfully completed, user buffers are synchronized with up to date data from araxs internal buffers.

Parameters
taskThe task to wait for.
Returns
The arax_task_state of the given arax_task.

Definition at line 515 of file impl.c.

References arax_task_wait_done(), and arax_task_msg::state.

Referenced by arax_data_allocate_remote(), arax_data_get(), and arax_task_issue_sync().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: