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

Functions

int arax_accel_list (arax_accel_type_e type, int physical, arax_accel ***accels)
 
void arax_accel_set_physical (arax_accel *vaccel, arax_accel *phys)
 
void arax_accel_list_free (arax_accel **accels)
 
arax_accel_type_e arax_accel_type (arax_accel *accel)
 
arax_accel_state_e arax_accel_stat (arax_accel *accel, arax_accel_stats_s *stat)
 
int arax_accel_acquire_phys (arax_accel **accel)
 
arax_accelarax_accel_acquire_type (arax_accel_type_e type)
 
void arax_accel_release (arax_accel **accel)
 

Detailed Description

Functions usable from applications for manipulating Accelerators.

Function Documentation

◆ arax_accel_acquire_phys()

int arax_accel_acquire_phys ( arax_accel ** accel)

Acquire specific physical accelerator specified by accel for exclusive use.

Note
By default all accelerators are 'shared'
Every call to arax_accel_acquire must have a matching arax_accel_release call.
Parameters
accelAccelerator to be acquired for exclusive use.
Returns
Return 1 if successful, 0 on failure.

Definition at line 335 of file impl.c.

References arax_pipe_get, ARAX_TYPE_PHYS_ACCEL, arax_vaccel_init(), arax_accel_s::obj, arax_accel_s::type, arax_object_s::type, and vpipe.

+ Here is the call graph for this function:

◆ arax_accel_acquire_type()

arax_accel * arax_accel_acquire_type ( arax_accel_type_e type)

Acquire a virtual accelerator of the given type.

Note
Every call to arax_accel_acquire must have a matching arax_accel_release call.
Parameters
typeAccelerator type to be acquired.
Returns
Return acquired virtual accelerator, NULL on failure.

Definition at line 354 of file impl.c.

References arax_pipe_get, arax_vaccel_init(), and vpipe.

+ Here is the call graph for this function:

◆ arax_accel_list()

int arax_accel_list ( arax_accel_type_e type,
int physical,
arax_accel *** accels )

Return number of accelerators of provided type If zero is returned no matching devices were found. If accels is not null an array with all matching accelerator descriptors is allocated and passed to the user. If *accels is not null, it will be freed by arax_accel_list_free.

Note
The *accels pointer must be freed by the user using free().
Parameters
typeCount only accelerators of specified arax_accel_type_e
physicalBoolean value (0,1), if true return physical accelerators, if false return virtual accelerators.
accelspointer to array with available matching accelerator descriptors.
Returns
Number of available accelerators of specified type.

Definition at line 221 of file impl.c.

References arax_accel_list_free_pre_locked(), arax_object_list_lock(), arax_object_list_unlock(), arax_object_ref_inc(), arax_pipe_get, ARAX_TYPE_PHYS_ACCEL, ARAX_TYPE_VIRT_ACCEL, utils_list_s::length, arax_accel_s::obj, arax_vaccel_s::obj, utils_list_node::owner, arax_accel_s::type, arax_vaccel_s::type, utils_list_for_each, and vpipe.

+ Here is the call graph for this function:

◆ arax_accel_list_free()

void arax_accel_list_free ( arax_accel ** accels)

Free memory of accelerator array returned by arax_accel_list

Parameters
accelspointer acquired through a arax_accel_list call.

Definition at line 283 of file impl.c.

References arax_object_ref_dec().

+ Here is the call graph for this function:

◆ arax_accel_release()

void arax_accel_release ( arax_accel ** accel)

Release previously acquired accelerator.

Note
By default all accelerators are 'shared'
Every call to arax_accel_acquire must have a matching arax_accel_release call.
Parameters
accelA previously acquired accelerator to be released.
Returns
Return 1 if successful, 0 on failure.

Definition at line 366 of file impl.c.

References arax_assert, arax_object_ref_dec(), ARAX_TYPE_PHYS_ACCEL, ARAX_TYPE_VIRT_ACCEL, arax_vaccel_s::obj, and arax_object_s::type.

Referenced by ARAX_OBJ_DTOR_DECL().

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

◆ arax_accel_set_physical()

void arax_accel_set_physical ( arax_accel * vaccel,
arax_accel * phys )

Set physical accelator to arax_accel_s

Parameters
vaccelVirtual accelator to set physical accelerator
physPhysical accelerator to set on arax_accel_s
Returns
Nothing .

Definition at line 209 of file impl.c.

References arax_accel_add_vaccel(), and arax_assert.

+ Here is the call graph for this function:

◆ arax_accel_stat()

arax_accel_state_e arax_accel_stat ( arax_accel * accel,
arax_accel_stats_s * stat )

Return statistics of accelerator specified by accel.

Parameters
accelA valid arax_accel descriptor returned by arax_accel_list().
statA pointer to a arax_accel_stats_s struct, to be filled with the accel statistics.
Returns
The state of the accelerator at the time of the call.

Definition at line 314 of file impl.c.

References accel_failed, arax_accel_get_stat(), ARAX_TYPE_PHYS_ACCEL, ARAX_TYPE_VIRT_ACCEL, arax_vaccel_get_stat(), arax_accel_s::obj, and arax_object_s::type.

+ Here is the call graph for this function:

◆ arax_accel_type()

Return the type of accelerator specified by accel.

Parameters
accelA valid arax_accel descriptor returned by arax_accel_list().
Returns
A value from arax_accel_type_e.

Definition at line 305 of file impl.c.

References arax_accel_s::type.