Arax -8d09c51940345c86062e8ef2427c705ae66e5926
A Runtime Framework for Decoupling Applications from Heterogeneous Accelerators
Loading...
Searching...
No Matches
arax_proc.c
Go to the documentation of this file.
1#include "arax_proc.h"
2#include <string.h>
3
5{
6 arax_proc_s *proc =
8 sizeof(arax_proc_s), 1);
9
10 if (!proc) // GCOV_EXCL_LINE
11 return 0; // GCOV_EXCL_LINE
12
13 return proc;
14}
15
21
23{
24 AraxFunctor *ret = arax_proc_get_functor(proc, type);
25
26 proc->functors[type] = vfn;
27
28 proc->canrun |= (1llu << type);
29
30 return ret;
31}
32
34{
36 arax_assert(type != ANY);
37
38 return !!((proc->canrun) & (1llu << type));
39}
40
arax_task_state_e AraxFunctor(arax_task *)
Definition arax_types.h:108
enum arax_accel_type arax_accel_type_e
@ ANY
Definition arax_types.h:84
#define arax_assert(EXPR)
Definition arax_assert.h:7
@ ARAX_TYPE_PROC
Definition arax_object.h:18
#define ARAX_OBJ_DTOR_DECL(TYPE)
int arax_accel_valid_type(arax_accel_type_e type)
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
AraxFunctor * arax_proc_get_functor(arax_proc_s *proc, arax_accel_type_e type)
Definition arax_proc.c:16
arax_proc_s * arax_proc_init(arax_object_repo_s *repo, const char *name)
Definition arax_proc.c:4
int arax_proc_can_run_at(arax_proc_s *proc, arax_accel_type_e type)
Definition arax_proc.c:33
AraxFunctor * arax_proc_set_functor(arax_proc_s *proc, arax_accel_type_e type, AraxFunctor *vfn)
Definition arax_proc.c:22
AraxFunctor * functors[ARAX_ACCEL_TYPES]
Definition arax_proc.h:19
uint64_t canrun
Definition arax_proc.h:18