Arax -8d09c51940345c86062e8ef2427c705ae66e5926
A Runtime Framework for Decoupling Applications from Heterogeneous Accelerators
Loading...
Searching...
No Matches
impl.c File Reference
#include <arax.h>
#include <arax_pipe.h>
#include "core/arax_data.h"
#include "utils/config.h"
#include "utils/system.h"
#include "utils/timer.h"
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
+ Include dependency graph for impl.c:

Go to the source code of this file.

Macros

#define arax_pipe_get()
 
#define GO_FAIL(MSG)
 

Functions

arax_pipe_s_arax_init (int wait_controller)
 
arax_pipe_sarax_init ()
 
arax_pipe_sarax_controller_init_start ()
 
void arax_controller_init_done ()
 
uint64_t arax_instance_uid ()
 
void arax_exit ()
 
int arax_clean ()
 
void arax_accel_set_physical (arax_accel *vaccel, arax_accel *phys)
 
void arax_accel_list_free_pre_locked (arax_accel **accels)
 
int arax_accel_list (arax_accel_type_e type, int physical, arax_accel ***accels)
 
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)
 
arax_procarax_proc_register (const char *func_name)
 
arax_procarax_proc_get (const char *func_name)
 
int arax_proc_put (arax_proc *func)
 
int check_semantics (size_t in_count, arax_data **input, size_t out_count, arax_data **output)
 
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)
 
arax_buffer_s ARAX_BUFFER (size_t size)
 

Variables

const char * arax_version = "VT_VERSION " ARAX_GIT_REV " - " ARAX_GIT_BRANCH
 
struct { 
 
   arax_pipe_s *   vpipe 
 
   char   shm_file [1024] 
 
   uint64_t   threads 
 
   uint64_t   instance_uid 
 
   uint64_t   task_uid 
 
   volatile uint64_t   initialized 
 
   size_t   initialy_available 
 
   char *   config_path 
 
   int   fd 
 
arax_state 
 

Macro Definition Documentation

◆ arax_pipe_get

#define arax_pipe_get ( )
Value:
struct @173207265353054203374042000231016266064377276100 arax_state

Definition at line 29 of file impl.c.

Referenced by arax_accel_acquire_phys(), arax_accel_acquire_type(), arax_accel_list(), ARAX_BUFFER(), arax_proc_get(), arax_proc_register(), and arax_task_issue().

◆ GO_FAIL

#define GO_FAIL ( MSG)
Value:
({ err = __LINE__; err_msg = MSG; goto FAIL; })

Definition at line 31 of file impl.c.

Referenced by _arax_init().

Function Documentation

◆ _arax_init()

arax_pipe_s * _arax_init ( int wait_controller)

Definition at line 33 of file impl.c.

References arax_pipe_get_available_size(), arax_pipe_have_to_mmap(), arax_pipe_init(), arax_pipe_mmap_address(), arax_state, async_condition_lock(), async_condition_unlock(), async_condition_wait(), async_meta_init_always(), CONFIG_FILE, GO_FAIL, system_mmap(), system_process_id(), system_total_memory(), utils_config_alloc_path(), utils_config_get_bool(), utils_config_get_size(), utils_config_get_source(), and utils_config_get_str().

Referenced by arax_controller_init_start(), and arax_init().

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

◆ arax_accel_list_free_pre_locked()

void arax_accel_list_free_pre_locked ( arax_accel ** accels)

Definition at line 294 of file impl.c.

References arax_object_ref_dec_pre_locked().

Referenced by arax_accel_list().

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

◆ arax_controller_init_done()

void arax_controller_init_done ( )

Should only be called by the controller process, after it is ready to recieve tasks. See arax_controller_init_start().

Definition at line 143 of file impl.c.

References arax_state, and async_condition_notify().

+ Here is the call graph for this function:

◆ arax_controller_init_start()

arax_pipe_s * arax_controller_init_start ( )

Similar to arax_init().

As this should be called only by the controller, prior to any other Arax function.

After the controller process is initialized and ready to recieve tasks arax_controller_init_done should be called.

Definition at line 138 of file impl.c.

References _arax_init().

+ Here is the call graph for this function:

◆ arax_instance_uid()

uint64_t arax_instance_uid ( )

Definition at line 151 of file impl.c.

References arax_state.

◆ check_semantics()

int check_semantics ( size_t in_count,
arax_data ** input,
size_t out_count,
arax_data ** output )

Definition at line 422 of file impl.c.

References ARAX_TYPE_DATA, arax_data_s::obj, and arax_object_s::type.

Referenced by arax_task_issue().

+ Here is the caller graph for this function:

Variable Documentation

◆ [struct]

struct { ... } arax_state
Initial value:
=
{ (void *) CONF_ARAX_MMAP_BASE, { '\0' }, 0, 0, 0, 0, 0, NULL, 0 }

Referenced by _arax_init(), arax_controller_init_done(), arax_exit(), and arax_instance_uid().

◆ arax_version

const char* arax_version = "VT_VERSION " ARAX_GIT_REV " - " ARAX_GIT_BRANCH

Definition at line 13 of file impl.c.

◆ config_path

char* config_path

Definition at line 24 of file impl.c.

Referenced by arax_clean().

◆ fd

int fd

Definition at line 25 of file impl.c.

Referenced by async_meta_exit(), init_mparams(), and system_mmap().

◆ initialized

volatile uint64_t initialized

Definition at line 22 of file impl.c.

◆ initialy_available

size_t initialy_available

Definition at line 23 of file impl.c.

◆ instance_uid

uint64_t instance_uid

Definition at line 20 of file impl.c.

◆ shm_file

char shm_file[1024]

Definition at line 18 of file impl.c.

Referenced by arax_clean(), and async_meta_init_always().

◆ task_uid

uint64_t task_uid

Definition at line 21 of file impl.c.

◆ threads

uint64_t threads

Definition at line 19 of file impl.c.

◆ vpipe