Arax -8d09c51940345c86062e8ef2427c705ae66e5926
A Runtime Framework for Decoupling Applications from Heterogeneous Accelerators
Loading...
Searching...
No Matches
arax_accel_types.c
Go to the documentation of this file.
1#include "arax_types.h"
2#include <strings.h>
3
5{
6 const char * str;
8};
9
11 { "any", ANY },
12 { "gpu", GPU },
13 { "gpu_soft", GPU_SOFT },
14 { "cpu", CPU },
15 { "sda", SDA },
16 { "nano_arm", NANO_ARM },
17 { "nano_core", NANO_CORE },
18 { "Open_CL", OPEN_CL },
19 { "HIP", HIP }
20};
21
26
28{
30 return types_map[type].str;
31
32 return 0;
33}
34
36{
38
39 if (!type)
40 return ARAX_ACCEL_TYPES;
41
42 for (cnt = ANY; cnt < ARAX_ACCEL_TYPES; cnt++) {
43 if (!types_map[cnt].str)
44 continue;
45 if (!strcasecmp(type, types_map[cnt].str))
46 break;
47 }
48 return cnt;
49}
enum arax_accel_type arax_accel_type_e
@ CPU
Definition arax_types.h:87
@ GPU_SOFT
Definition arax_types.h:86
@ OPEN_CL
Definition arax_types.h:91
@ HIP
Definition arax_types.h:92
@ ARAX_ACCEL_TYPES
Definition arax_types.h:93
@ NANO_ARM
Definition arax_types.h:89
@ GPU
Definition arax_types.h:85
@ ANY
Definition arax_types.h:84
@ NANO_CORE
Definition arax_types.h:90
@ SDA
Definition arax_types.h:88
int arax_accel_valid_type(arax_accel_type_e type)
struct arax_accel_type_map types_map[ARAX_ACCEL_TYPES]
const char * arax_accel_type_to_str(arax_accel_type_e type)
arax_accel_type_e arax_accel_type_from_str(const char *type)
arax_accel_type_e type