![]() |
Arax -8d09c51940345c86062e8ef2427c705ae66e5926
A Runtime Framework for Decoupling Applications from Heterogeneous Accelerators
|
#include <arax.h>
#include "core/arax_object.h"
#include "async.h"
#include <conf.h>
#include "core/arax_accel.h"
Go to the source code of this file.
Data Structures | |
struct | arax_data_s |
struct | arax_data_dtr |
Macros | |
#define | ARAX_BUFF_ALLOC_SIZE(SIZE, ALIGN) |
#define | ARAX_DATA_ALLOC_SIZE(DATA) |
#define | arax_data_stat(DATA) |
#define | arax_data_annotate(DATA, ...) |
Typedefs | |
typedef enum arax_data_flags | arax_data_flags_e |
typedef struct arax_data_s | arax_data_s |
typedef int | arax_data_sync_fn(arax_data_s *) |
typedef struct arax_data_dtr | arax_data_dtr |
Enumerations | |
enum | arax_data_flags { OTHR_REMT = 4 } |
Functions | |
arax_data_s * | arax_data_init (arax_pipe_s *vpipe, size_t size) |
arax_data_s * | arax_data_init_aligned (arax_pipe_s *vpipe, size_t size, size_t align) |
void | arax_data_get (arax_data *data, void *user) |
void | arax_data_set_remote (arax_data_s *data, arax_accel *accel, void *remt) |
void | arax_data_set_accel (arax_data_s *data, arax_accel *accel) |
void | arax_data_set (arax_data *data, arax_accel *accel, const void *user) |
void | arax_data_memcpy (arax_accel *accel, arax_data_s *dst, arax_data_s *src, int block) |
void | arax_data_arg_init (arax_data_s *data, arax_accel *accel) |
void | arax_data_input_init (arax_data_s *data, arax_accel *accel) |
void | arax_data_output_init (arax_data_s *data, arax_accel *accel) |
size_t | arax_data_size (arax_data *data) |
void | arax_data_free (arax_data *data) |
void | arax_data_stat (arax_data *data, const char *file, size_t line) |
#define ARAX_BUFF_ALLOC_SIZE | ( | SIZE, | |
ALIGN ) |
Calculate allocation size for a buffer of size SIZE
and alignment ALIGN
.
Definition at line 16 of file arax_data.h.
Referenced by arax_data_init_aligned().
#define ARAX_DATA_ALLOC_SIZE | ( | DATA | ) |
Calculate allocation size for arax_data_s DATA
.
Definition at line 21 of file arax_data.h.
#define arax_data_annotate | ( | DATA, | |
... ) |
Definition at line 158 of file arax_data.h.
Referenced by arax_task_alloc().
#define arax_data_stat | ( | DATA | ) |
Definition at line 152 of file arax_data.h.
typedef struct arax_data_dtr arax_data_dtr |
Definition at line 53 of file arax_data.h.
typedef enum arax_data_flags arax_data_flags_e |
typedef struct arax_data_s arax_data_s |
Definition at line 32 of file arax_data.h.
typedef int arax_data_sync_fn(arax_data_s *) |
Definition at line 34 of file arax_data.h.
enum arax_data_flags |
Enumerator | |
---|---|
OTHR_REMT |
Definition at line 27 of file arax_data.h.
void arax_data_arg_init | ( | arax_data_s * | data, |
arax_accel * | accel ) |
Definition at line 220 of file arax_data.c.
References arax_assert, arax_assert_obj, arax_data_migrate_accel(), and ARAX_TYPE_DATA.
void arax_data_free | ( | arax_data * | data | ) |
Mark data
for deletion.
Definition at line 325 of file arax_data.c.
References arax_assert_obj, arax_object_ref_dec(), ARAX_TYPE_DATA, and arax_data_s::obj.
void arax_data_get | ( | arax_data * | data, |
void * | user ) |
Get the data of data
, and copy them to user
.
data | A valid arax_data_s instance. |
user | An allocated memory of at least arax_data_size() bytes. |
Definition at line 52 of file arax_data.c.
References arax_data_s::accel, arax_assert, arax_assert_obj, arax_data_size(), arax_proc_get(), arax_proc_put(), arax_task_free(), arax_task_host_data(), arax_task_issue(), arax_task_wait(), ARAX_TYPE_DATA, and task_completed.
Referenced by arax_data_memcpy().
arax_data_s * arax_data_init | ( | arax_pipe_s * | vpipe, |
size_t | size ) |
Initialize a new arax_data_s object.
vpipe | Valid arax_pipe_s instance. |
size | Size of data in bytes. |
Definition at line 16 of file arax_data.c.
References arax_data_init_aligned(), and vpipe.
Referenced by ARAX_BUFFER().
arax_data_s * arax_data_init_aligned | ( | arax_pipe_s * | vpipe, |
size_t | size, | ||
size_t | align ) |
Initialize a new arax_data_s object, with an aligned buffer.
vpipe | Valid arax_pipe_s instance. |
size | Size of data in bytes. |
align | alignment of buffer in bytes, power of two. |
Definition at line 21 of file arax_data.c.
References arax_data_s::align, arax_assert, ARAX_BUFF_ALLOC_SIZE, arax_object_register(), ARAX_TYPE_DATA, arax_data_s::buffer, arax_data_s::flags, arax_data_s::phys, arax_data_s::size, and vpipe.
Referenced by arax_data_init().
void arax_data_input_init | ( | arax_data_s * | data, |
arax_accel * | accel ) |
Definition at line 229 of file arax_data.c.
References arax_assert, arax_assert_obj, arax_data_migrate_accel(), arax_object_ref_inc(), ARAX_TYPE_DATA, and arax_data_s::obj.
Referenced by arax_task_alloc().
void arax_data_memcpy | ( | arax_accel * | accel, |
arax_data_s * | dst, | ||
arax_data_s * | src, | ||
int | block ) |
Copy data of src
to dst
.
@Note src
and dst
must have the same size. @Note If src
and dst
are the same, function is no-op.
accel | Accelerator/fifo to use. |
dst | Destination buffer. |
src | Source buffer. |
block | If true function returns only when copy has completed. |
Definition at line 95 of file arax_data.c.
References arax_assert, arax_assert_obj, arax_data_deref(), arax_data_get(), arax_data_set(), arax_data_size(), ARAX_TYPE_DATA, and arax_data_s::flags.
void arax_data_output_init | ( | arax_data_s * | data, |
arax_accel * | accel ) |
Definition at line 240 of file arax_data.c.
References arax_assert, arax_assert_obj, arax_data_migrate_accel(), arax_object_ref_inc(), ARAX_TYPE_DATA, and arax_data_s::obj.
Referenced by arax_task_alloc().
void arax_data_set | ( | arax_data * | data, |
arax_accel * | accel, | ||
const void * | user ) |
Copy data from user
to 'c data.
data | A valid arax_data_s instance. |
accel | Accelerator/fifo to use. |
user | An allocated memory of at least arax_data_size() bytes. |
Definition at line 75 of file arax_data.c.
References arax_data_s::accel, arax_assert, arax_assert_obj, arax_data_size(), arax_object_ref_inc(), arax_proc_get(), arax_proc_put(), arax_task_issue(), and ARAX_TYPE_DATA.
Referenced by arax_data_memcpy().
void arax_data_set_accel | ( | arax_data_s * | data, |
arax_accel * | accel ) |
Set accelerator to data and increment reference counters.
data | A valid arax_data_s instance. |
accel | Accelerator/fifo to use. |
Definition at line 195 of file arax_data.c.
References arax_data_s::accel, arax_assert_obj, arax_object_ref_inc(), ARAX_TYPE_DATA, and ARAX_TYPE_VIRT_ACCEL.
void arax_data_set_remote | ( | arax_data_s * | data, |
arax_accel * | accel, | ||
void * | remt ) |
Set data
remote (accelerator) buffer to point to remt
, owned by accel
.
data | Arax data. |
Definition at line 206 of file arax_data.c.
References arax_data_s::accel, arax_assert, arax_assert_obj, arax_object_ref_inc(), ARAX_TYPE_DATA, ARAX_TYPE_VIRT_ACCEL, CPU, arax_data_s::flags, OTHR_REMT, and arax_data_s::remote.
size_t arax_data_size | ( | arax_data * | data | ) |
Return size of provided arax_data object.
data | Valid arax_data pointer. |
Definition at line 251 of file arax_data.c.
References arax_assert_obj, ARAX_TYPE_DATA, and arax_data_s::size.
Referenced by arax_data_allocate_remote(), arax_data_get(), arax_data_memcpy(), arax_data_ref_offset(), arax_data_set(), arax_data_stat(), and ARAX_OBJ_DTOR_DECL().
void arax_data_stat | ( | arax_data * | data, |
const char * | file, | ||
size_t | line ) |
Print debug info for 'c data.
Definition at line 346 of file arax_data.c.
References arax_assert_obj, arax_data_deref(), arax_data_size(), ARAX_TYPE_DATA, arax_data_s::flags, and OTHR_REMT.