Arax -8d09c51940345c86062e8ef2427c705ae66e5926
A Runtime Framework for Decoupling Applications from Heterogeneous Accelerators
Loading...
Searching...
No Matches
arax_vaccel.h File Reference
#include "core/arax_object.h"
#include "utils/queue.h"
#include "core/arax_accel.h"
#include "async.h"
+ Include dependency graph for arax_vaccel.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  arax_vaccel_s
 

Typedefs

typedef struct arax_vaccel_s arax_vaccel_s
 
typedef enum arax_accel_ordering_e arax_accel_ordering_e
 

Enumerations

enum  arax_accel_ordering_e { SEQUENTIAL , PARALLEL }
 

Functions

arax_vaccel_sarax_vaccel_init (arax_pipe_s *pipe, const char *name, arax_accel_type_e type, arax_accel_s *accel)
 
void arax_vaccel_add_task (arax_vaccel_s *accel, arax_task *task)
 
void arax_vaccel_set_ordering (arax_accel_s *accel, arax_accel_ordering_e ordering)
 
arax_accel_ordering_e arax_vaccel_get_ordering (arax_accel_s *accel)
 
uint64_t arax_vaccel_set_cid (arax_vaccel_s *vaccel, uint64_t cid)
 
uint64_t arax_vaccel_get_cid (arax_vaccel_s *vaccel)
 
uint64_t arax_vaccel_set_job_priority (arax_vaccel_s *vaccel, uint64_t priority)
 
uint64_t arax_vaccel_get_job_priority (arax_vaccel_s *vaccel)
 
void arax_vaccel_set_meta (arax_vaccel_s *vaccel, void *meta)
 
void * arax_vaccel_get_meta (arax_vaccel_s *vaccel)
 
utils_queue_sarax_vaccel_queue (arax_vaccel_s *vaccel)
 
unsigned int arax_vaccel_queue_size (arax_vaccel_s *vaccel)
 
arax_accel_state_e arax_vaccel_get_stat (arax_vaccel_s *accel, arax_accel_stats_s *stat)
 

Typedef Documentation

◆ arax_accel_ordering_e

◆ arax_vaccel_s

typedef struct arax_vaccel_s arax_vaccel_s

Definition at line 6 of file arax_vaccel.h.

Enumeration Type Documentation

◆ arax_accel_ordering_e

Enumerator
SEQUENTIAL 
PARALLEL 

Definition at line 16 of file arax_vaccel.h.

Function Documentation

◆ arax_vaccel_add_task()

void arax_vaccel_add_task ( arax_vaccel_s * accel,
arax_task * task )

Definition at line 32 of file arax_vaccel.c.

References arax_accel_add_task(), arax_vaccel_s::lock, arax_vaccel_s::phys, arax_vaccel_s::queue, utils_queue_push(), utils_spinlock_lock, and utils_spinlock_unlock.

Referenced by arax_task_submit().

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

◆ arax_vaccel_get_cid()

uint64_t arax_vaccel_get_cid ( arax_vaccel_s * vaccel)

Get the client id for this virtual accelerator.

Definition at line 64 of file arax_vaccel.c.

References arax_assert_obj, ARAX_TYPE_VIRT_ACCEL, and arax_vaccel_s::cid.

◆ arax_vaccel_get_job_priority()

uint64_t arax_vaccel_get_job_priority ( arax_vaccel_s * vaccel)

Get the priority (latency or throughput critical) for this virtual accelerator.

Definition at line 77 of file arax_vaccel.c.

References arax_assert_obj, ARAX_TYPE_VIRT_ACCEL, and arax_vaccel_s::priority.

◆ arax_vaccel_get_meta()

void * arax_vaccel_get_meta ( arax_vaccel_s * vaccel)

Set the meta for this virtual accelerator.

Definition at line 89 of file arax_vaccel.c.

References arax_assert_obj, ARAX_TYPE_VIRT_ACCEL, and arax_vaccel_s::meta.

◆ arax_vaccel_get_ordering()

arax_accel_ordering_e arax_vaccel_get_ordering ( arax_accel_s * accel)

Get arax_accel_ordering_e mode of provided accel.

Parameters
vaccelA virtual accelerator

Definition at line 49 of file arax_vaccel.c.

References arax_assert_obj, ARAX_TYPE_VIRT_ACCEL, and arax_vaccel_s::ordering.

◆ arax_vaccel_get_stat()

arax_accel_state_e arax_vaccel_get_stat ( arax_vaccel_s * accel,
arax_accel_stats_s * stat )

Definition at line 107 of file arax_vaccel.c.

References arax_accel_get_stat(), arax_assert_obj, ARAX_TYPE_VIRT_ACCEL, and arax_vaccel_s::phys.

Referenced by arax_accel_stat().

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

◆ arax_vaccel_init()

arax_vaccel_s * arax_vaccel_init ( arax_pipe_s * pipe,
const char * name,
arax_accel_type_e type,
arax_accel_s * accel )

Initialize a arax_vaccel_s in mem.

Parameters
pipeValid arax_pipe_s instance.
nameName of the virtual accelerator
typeType of the virtual accelerator
accelA physical accelerator

Definition at line 3 of file arax_vaccel.c.

References arax_accel_add_vaccel(), arax_object_register(), arax_pipe_add_orphan_vaccel(), ARAX_TYPE_VIRT_ACCEL, arax_vaccel_s::cid, arax_vaccel_s::lock, arax_vaccel_s::meta, arax_pipe::objs, arax_vaccel_s::ordering, arax_vaccel_s::phys, arax_vaccel_s::priority, arax_vaccel_s::queue, SEQUENTIAL, arax_vaccel_s::type, utils_list_node_init(), utils_queue_init(), utils_spinlock_init, and arax_vaccel_s::vaccels.

Referenced by arax_accel_acquire_phys(), arax_accel_acquire_type(), and arax_accel_init().

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

◆ arax_vaccel_queue()

utils_queue_s * arax_vaccel_queue ( arax_vaccel_s * vaccel)

Get the queue of vaccel.

Parameters
vaccelA virtual accelerator
Returns
The queue of vaccel,NULL on failure

Definition at line 95 of file arax_vaccel.c.

References arax_assert_obj, ARAX_TYPE_VIRT_ACCEL, and arax_vaccel_s::queue.

Referenced by arax_vaccel_queue_size().

+ Here is the caller graph for this function:

◆ arax_vaccel_queue_size()

unsigned int arax_vaccel_queue_size ( arax_vaccel_s * vaccel)

Requrn size of vaccel.

Parameters
vaccelA virtual accelerator
Returns
The size of the queue of vaccel.

Definition at line 101 of file arax_vaccel.c.

References arax_assert_obj, ARAX_TYPE_VIRT_ACCEL, arax_vaccel_queue(), and utils_queue_used_slots().

Referenced by arax_accel_add_vaccel(), and arax_accel_del_vaccel().

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

◆ arax_vaccel_set_cid()

uint64_t arax_vaccel_set_cid ( arax_vaccel_s * vaccel,
uint64_t cid )

Set the client id for this virtual accelerator.

Definition at line 57 of file arax_vaccel.c.

References arax_assert_obj, ARAX_TYPE_VIRT_ACCEL, and arax_vaccel_s::cid.

◆ arax_vaccel_set_job_priority()

uint64_t arax_vaccel_set_job_priority ( arax_vaccel_s * vaccel,
uint64_t priority )

Set the priority (latency or throughput critical) for this virtual accelerator.

Definition at line 70 of file arax_vaccel.c.

References arax_assert_obj, ARAX_TYPE_VIRT_ACCEL, and arax_vaccel_s::priority.

◆ arax_vaccel_set_meta()

void arax_vaccel_set_meta ( arax_vaccel_s * vaccel,
void * meta )

Get the meta for this virtual accelerator.

Definition at line 83 of file arax_vaccel.c.

References arax_assert_obj, ARAX_TYPE_VIRT_ACCEL, and arax_vaccel_s::meta.

◆ arax_vaccel_set_ordering()

void arax_vaccel_set_ordering ( arax_accel_s * accel,
arax_accel_ordering_e ordering )

Set arax_accel_ordering_e mode to ordering of provided accel.

Parameters
vaccelA virtual accelerator

Definition at line 41 of file arax_vaccel.c.

References arax_assert_obj, ARAX_TYPE_VIRT_ACCEL, and arax_vaccel_s::ordering.