![]() |
Arax -8d09c51940345c86062e8ef2427c705ae66e5926
A Runtime Framework for Decoupling Applications from Heterogeneous Accelerators
|
#include "arax_data.h"
Go to the source code of this file.
Functions | |
void | arax_data_shm_sync (arax_accel *accel, const char *func, arax_data_s *data, int block) |
void | arax_data_migrate_accel (arax_data_s *data, arax_accel *accel) |
void | arax_data_allocate_remote (arax_data_s *data, arax_accel *accel) |
void * | arax_data_deref (arax_data *data) |
arax_data * | arax_data_ref (void *data) |
arax_data * | arax_data_ref_offset (arax_pipe_s *vpipe, void *data) |
int | arax_data_has_remote (arax_data *data) |
void arax_data_allocate_remote | ( | arax_data_s * | data, |
arax_accel * | accel ) |
Initialize data
remote (accelerator) buffer.
data | Arax data. |
Definition at line 162 of file arax_data.c.
References arax_data_s::accel, arax_accel_size_dec(), arax_assert, arax_assert_obj, arax_data_size(), arax_object_ref_inc(), arax_proc_get(), arax_task_free(), arax_task_issue(), arax_task_wait(), ARAX_THROTTLE_DEBUG_PRINT, ARAX_TYPE_DATA, ARAX_TYPE_VIRT_ACCEL, CPU, arax_data_s::remote, and task_completed.
void * arax_data_deref | ( | arax_data * | data | ) |
Get pointer to buffer for use from CPU.
data | Valid arax_data pointer. |
Definition at line 260 of file arax_data.c.
References arax_assert_obj, ARAX_THROTTLE_DEBUG_PRINT, ARAX_TYPE_DATA, and arax_data_s::buffer.
Referenced by arax_data_memcpy(), arax_data_ref_offset(), and arax_data_stat().
int arax_data_has_remote | ( | arax_data * | data | ) |
Returns true if data
has been allocated on the remote accelerator.
data | Data to be queried. |
data
has a remote accelerator allocation, 0 otherwise. Definition at line 334 of file arax_data.c.
References arax_assert_obj, ARAX_TYPE_DATA, and arax_data_s::remote.
void arax_data_migrate_accel | ( | arax_data_s * | data, |
arax_accel * | accel ) |
Migrate data
accelerator location to accel
.
\NOTE: Does not yet support migration across physical devices.
Definition at line 117 of file arax_data.c.
References arax_data_s::accel, arax_assert, arax_assert_obj, arax_object_ref_dec(), arax_object_ref_inc(), arax_object_type_to_str(), ARAX_TYPE_DATA, ARAX_TYPE_VIRT_ACCEL, arax_vaccel_s::phys, arax_data_s::remote, and TYPE_MASK.
Referenced by arax_data_arg_init(), arax_data_input_init(), and arax_data_output_init().
arax_data * arax_data_ref | ( | void * | data | ) |
Get pointer to arax_data object from related CPU buffer data
. Undefined behaviour if data
is not a value returned by arax_data_deref.
Definition at line 274 of file arax_data.c.
References arax_assert, arax_ptr_valid(), ARAX_TYPE_DATA, arax_data_s::obj, arax_object_s::type, and VD_BUFF_OWNER.
Referenced by arax_data_ref_offset().
arax_data * arax_data_ref_offset | ( | arax_pipe_s * | vpipe, |
void * | data ) |
Get pointer to arax_data object from data
that points 'inside' related CPU buffer .
Definition at line 295 of file arax_data.c.
References arax_assert, arax_data_deref(), arax_data_ref(), arax_data_size(), arax_object_list_lock(), arax_object_list_unlock(), arax_ptr_valid(), ARAX_TYPE_DATA, utils_list_node::owner, utils_list_for_each, and vpipe.
void arax_data_shm_sync | ( | arax_accel * | accel, |
const char * | func, | ||
arax_data_s * | data, | ||
int | block ) |
Transfer data between shm and remote.
accel | Accelerator/fifo to use. |
func | Sync function to use. Can be "syncTo" or "syncFrom" |
data | Data to be moved with func . |
block | If !=0 this call will block until data are moved. |
References vpipe.