![]() |
Arax -8d09c51940345c86062e8ef2427c705ae66e5926
A Runtime Framework for Decoupling Applications from Heterogeneous Accelerators
|
Go to the source code of this file.
void arax_pipe_add_orphan_vaccel | ( | arax_pipe_s * | pipe, |
arax_vaccel_s * | vac ) |
Add vac
to the list of orphan_vacs/ unassigned accels.
pipe | arax_pipe instance. |
vac | Unassigned/Orphan Virtual Acceleator instance. |
Definition at line 63 of file arax_pipe.c.
References arax_assert, arax_assert_obj, ARAX_TYPE_VIRT_ACCEL, async_condition_lock(), async_condition_notify(), async_condition_unlock(), arax_pipe::orphan_cond, arax_pipe::orphan_vacs, arax_vaccel_s::phys, utils_list_add(), and arax_vaccel_s::vaccels.
Referenced by arax_vaccel_init().
uint64_t arax_pipe_add_process | ( | arax_pipe_s * | pipe | ) |
Increase process counter for pipe
.
pipe | arax_pipe instance. |
Definition at line 116 of file arax_pipe.c.
References arax_pipe::processes.
Referenced by arax_pipe_init().
uint64_t arax_pipe_del_process | ( | arax_pipe_s * | pipe | ) |
Decrease process counter for pipe
.
pipe | arax_pipe instance. |
Definition at line 121 of file arax_pipe.c.
References arax_pipe::processes.
Referenced by arax_pipe_exit().
int arax_pipe_delete_accel | ( | arax_pipe_s * | pipe, |
arax_accel_s * | accel ) |
Remove accel
from the pipe
accelerator list.
pipe | The pipe instance where the accelerator belongs. |
accel | The accelerator to be removed. |
Definition at line 175 of file arax_pipe.c.
References arax_object_list_lock(), arax_object_list_unlock(), arax_object_ref_dec(), ARAX_TYPE_PHYS_ACCEL, arax_accel_s::obj, arax_pipe::objs, utils_list_node::owner, and utils_list_for_each.
int arax_pipe_exit | ( | arax_pipe_s * | pipe | ) |
Destroy arax_pipe.
Definition at line 241 of file arax_pipe.c.
References arax_pipe::allocator, arax_object_repo_exit(), arax_pipe_del_process(), arch_alloc_exit(), arax_pipe::async, async_meta_exit(), and arax_pipe::objs.
Referenced by arax_exit().
arax_accel_s * arax_pipe_find_accel | ( | arax_pipe_s * | pipe, |
const char * | name, | ||
arax_accel_type_e | type ) |
Find an accelerator matching the user specified criteria.
pipe | arax_pipe instance. |
name | The cstring name of the accelerator, \ NULL if we dont care for the name. |
type | Type of the accelerator, see arax_accel_type_e. |
Definition at line 194 of file arax_pipe.c.
References arax_accel_get_name(), arax_object_list_lock(), arax_object_list_unlock(), ARAX_TYPE_PHYS_ACCEL, arax_pipe::objs, utils_list_node::owner, arax_accel_s::type, and utils_list_for_each.
arax_proc_s * arax_pipe_find_proc | ( | arax_pipe_s * | pipe, |
const char * | name ) |
Find a procedure matching the user specified criteria.
pipe | arax_pipe instance. |
name | The cstring name of the procedure. |
Definition at line 219 of file arax_pipe.c.
References arax_object_list_lock(), arax_object_list_unlock(), ARAX_TYPE_PROC, arax_object_s::name, arax_proc_s::obj, arax_pipe::objs, utils_list_node::owner, and utils_list_for_each.
Referenced by arax_proc_get(), and arax_proc_register().
size_t arax_pipe_get_available_size | ( | arax_pipe_s * | pipe | ) |
Gets available size of shm
pipe | pipe for shm |
Definition at line 265 of file arax_pipe.c.
References arax_assert, arax_throttle_get_available_size(), and arax_pipe::throttle.
Referenced by _arax_init(), and arax_exit().
arax_vaccel_s * arax_pipe_get_orphan_vaccel | ( | arax_pipe_s * | pipe | ) |
Return an orphan/unassigned virtual accelerator or null. Function will sleep if no orphans exist at the time of the call. Returned arax_vaccel_s should either be assigned to a arax_accel_s using arax_accel_add_vaccel()
, or should be marked again as orphan using arax_pipe_add_orphan_vaccel()
.
Definition at line 78 of file arax_pipe.c.
References arax_assert, arax_assert_obj, arax_pipe_have_orphan_vaccels(), ARAX_TYPE_VIRT_ACCEL, async_condition_lock(), async_condition_unlock(), async_condition_wait(), arax_pipe::orphan_cond, arax_pipe::orphan_vacs, utils_list_node::owner, arax_vaccel_s::phys, and utils_list_pop_head().
const char * arax_pipe_get_revision | ( | arax_pipe_s * | pipe | ) |
Get Arax revision
pipe | arax_pipe instance. |
Definition at line 58 of file arax_pipe.c.
References arax_pipe::sha.
size_t arax_pipe_get_total_size | ( | arax_pipe_s * | pipe | ) |
Gets available total size of shm
pipe | pipe for shm |
Definition at line 271 of file arax_pipe.c.
References arax_assert, arax_throttle_get_total_size(), and arax_pipe::throttle.
int arax_pipe_have_orphan_vaccels | ( | arax_pipe_s * | pipe | ) |
Will return != 0 if there are orphan vaccels.
@Note: This function may return old values.
pipe | arax_pipe instance. |
Definition at line 73 of file arax_pipe.c.
References utils_list_s::length, and arax_pipe::orphan_vacs.
Referenced by arax_pipe_get_orphan_vaccel().
int arax_pipe_have_to_mmap | ( | arax_pipe_s * | pipe, |
int | pid ) |
Return if we have to mmap, for the given pid. This will return 1, only the first time it is callled with a specific pid
.
Definition at line 126 of file arax_pipe.c.
References arax_assert, arax_pipe::proc_lock, arax_pipe::proc_map, utils_spinlock_lock, and utils_spinlock_unlock.
Referenced by _arax_init().
arax_pipe_s * arax_pipe_init | ( | void * | mem, |
size_t | size, | ||
int | enforce_version ) |
Initialize a arax_pipe.
mem | Shared memory pointer. |
size | Size of the shared memory in bytes. |
enforce_version | Set to 0 to make version mismatch non fatal. |
Write sha sum except first byte
Definition at line 5 of file arax_pipe.c.
References arax_pipe::allocator, arax_object_repo_init(), arax_pipe_add_process(), ARAX_PIPE_SHA_SIZE, arax_throttle_init(), arch_alloc_init_always(), arch_alloc_init_once(), arax_pipe::ass_kv, arax_pipe::async, async_condition_init(), async_meta_init_once(), arax_pipe::cntrl_ready_cond, arax_pipe::metrics_kv, arax_pipe::objs, arax_pipe::orphan_cond, arax_pipe::orphan_vacs, arax_pipe::sha, arax_pipe::shm_size, arax_pipe::throttle, utils_kv_init(), and utils_list_init().
Referenced by _arax_init().
void arax_pipe_mark_unmap | ( | arax_pipe_s * | pipe, |
int | pid ) |
This should be called after munmap'ing pipe
, in pid
process.
Definition at line 148 of file arax_pipe.c.
References arax_assert, arax_pipe::proc_lock, arax_pipe::proc_map, utils_spinlock_lock, and utils_spinlock_unlock.
Referenced by arax_exit().
void * arax_pipe_mmap_address | ( | arax_pipe_s * | pipe | ) |
Return (and set if needed) the mmap location for pipe
.
pipe | arax_pipe instance. |
Definition at line 165 of file arax_pipe.c.
References arax_pipe::self.
Referenced by _arax_init().
void arax_pipe_orphan_stop | ( | arax_pipe_s * | pipe | ) |
This will return null to a blocked caller thread of arax_pipe_get_orphan_vaccel()
. That should be used to signal thread termination.
This function should be called once for every thread using arax_pipe_get_orphan_vaccel().
pipe | arax_pipe instance. |
Definition at line 109 of file arax_pipe.c.
References async_condition_lock(), async_condition_notify(), async_condition_unlock(), and arax_pipe::orphan_cond.
void arax_pipe_remove_orphan_vaccel | ( | arax_pipe_s * | pipe, |
arax_vaccel_s * | vac ) |
Remove specific vac
for list of orphan vacs.
Definition at line 100 of file arax_pipe.c.
References arax_assert_obj, ARAX_TYPE_VIRT_ACCEL, async_condition_lock(), async_condition_unlock(), arax_pipe::orphan_cond, arax_pipe::orphan_vacs, utils_list_del(), utils_list_node_linked(), and arax_vaccel_s::vaccels.
Referenced by arax_accel_add_vaccel(), and ARAX_OBJ_DTOR_DECL().
void ARAX_PIPE_THOTTLE_DEBUG_FUNC arax_pipe_size_dec | ( | arax_pipe_s * | pipe, |
size_t sz | ARAX_PIPE_THOTTLE_DEBUG_PARAMS ) |
Decrements available size of gpu by sz
pipe | pipe for shm |
sz | size of removed data |
Definition at line 259 of file arax_pipe.c.
References arax_assert, arax_pipe_size_dec(), ARAX_PIPE_THOTTLE_DEBUG_PARAMS, and arax_throttle_size_dec().
Referenced by arax_object_register(), and arax_pipe_size_dec().
void ARAX_PIPE_THOTTLE_DEBUG_FUNC arax_pipe_size_inc | ( | arax_pipe_s * | pipe, |
size_t sz | ARAX_PIPE_THOTTLE_DEBUG_PARAMS ) |
Increments available size of gpu by sz
pipe | pipe for shm |
sz | Size of added data |
Definition at line 253 of file arax_pipe.c.
References arax_assert, arax_pipe_size_inc(), ARAX_PIPE_THOTTLE_DEBUG_PARAMS, and arax_throttle_size_inc().
Referenced by arax_object_ref_dec(), arax_object_ref_dec_pre_locked(), and arax_pipe_size_inc().