Arax -8d09c51940345c86062e8ef2427c705ae66e5926
A Runtime Framework for Decoupling Applications from Heterogeneous Accelerators
Loading...
Searching...
No Matches
arax_object.h
Go to the documentation of this file.
1#ifndef ARAX_OBJECT_HEADER
2#define ARAX_OBJECT_HEADER
3#include "utils/list.h"
4#include "utils/spinlock.h"
5#include "arch/alloc.h"
6
7#ifdef __cplusplus
8extern "C" {
9#endif /* ifdef __cplusplus */
10
14typedef enum arax_object_type
15{
16 ARAX_TYPE_PHYS_ACCEL, /* Physical Accelerator */
17 ARAX_TYPE_VIRT_ACCEL, /* Virtual Accelerator */
18 ARAX_TYPE_PROC, /* Procedure */
19 ARAX_TYPE_DATA, /* Data Allocation */
20 ARAX_TYPE_TASK, /* Task */
21 ARAX_TYPE_COUNT /* Number of types */
23
36
49
57
68
76
91 arax_object_type_e type, const char *name, size_t size, const int ref_count);
92
100void arax_object_rename(arax_object_s *obj, const char *fmt, ...);
101
108
116
125
132
140 arax_object_type_e type);
141
151
152#define ARAX_OBJ_DTOR_DECL(TYPE) void __dtor_ ## TYPE(arax_pipe_s * pipe, arax_object_s * obj)
153#define ARAX_OBJ_DTOR_USE(TYPE) __dtor_ ## TYPE
154
155#ifdef __cplusplus
156}
157#endif /* ifdef __cplusplus */
158
159#endif /* ifndef ARAX_OBJECT_HEADER */
struct arax_pipe arax_pipe_s
struct utils_list_node utils_list_node_s
volatile uint32_t utils_spinlock
Definition spinlock.h:10
int arax_object_ref_dec_pre_locked(arax_object_s *obj)
enum arax_object_type arax_object_type_e
arax_object_type
Definition arax_object.h:15
@ ARAX_TYPE_DATA
Definition arax_object.h:19
@ ARAX_TYPE_COUNT
Definition arax_object.h:21
@ ARAX_TYPE_VIRT_ACCEL
Definition arax_object.h:17
@ ARAX_TYPE_PROC
Definition arax_object.h:18
@ ARAX_TYPE_TASK
Definition arax_object.h:20
@ ARAX_TYPE_PHYS_ACCEL
Definition arax_object.h:16
int arax_object_repo_exit(arax_object_repo_s *repo)
Definition arax_object.c:71
arax_object_s * arax_object_register(arax_object_repo_s *repo, arax_object_type_e type, const char *name, size_t size, const int ref_count)
Definition arax_object.c:98
const char * arax_object_type_to_str(arax_object_type_e type)
Definition arax_object.c:90
void arax_object_rename(arax_object_s *obj, const char *fmt,...)
int arax_object_refs(arax_object_s *obj)
void arax_object_repo_init(arax_object_repo_s *repo, arax_pipe_s *pipe)
Definition arax_object.c:60
void arax_object_ref_inc(arax_object_s *obj)
utils_list_s * arax_object_list_lock(arax_object_repo_s *repo, arax_object_type_e type)
void arax_object_list_unlock(arax_object_repo_s *repo, arax_object_type_e type)
int arax_object_ref_dec(arax_object_s *obj)
utils_spinlock lock
Definition arax_object.h:33
arax_pipe_s * pipe
Definition arax_object.h:29
utils_list_s list
Definition arax_object.h:32
size_t alloc_size
Definition arax_object.h:44
volatile int ref_count
Definition arax_object.h:46
arax_object_type_e type
Definition arax_object.h:45
arax_object_repo_s * repo
Definition arax_object.h:42
utils_list_node_s list
Definition arax_object.h:43