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
4
struct
arax_accel_type_map
5
{
6
const
char
*
str
;
7
arax_accel_type_e
type
;
8
};
9
10
struct
arax_accel_type_map
types_map
[
ARAX_ACCEL_TYPES
] = {
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
22
int
arax_accel_valid_type
(
arax_accel_type_e
type
)
23
{
24
return
type
<
ARAX_ACCEL_TYPES
;
25
}
26
27
const
char
*
arax_accel_type_to_str
(
arax_accel_type_e
type
)
28
{
29
if
(
arax_accel_valid_type
(
type
))
30
return
types_map
[
type
].str;
31
32
return
0;
33
}
34
35
arax_accel_type_e
arax_accel_type_from_str
(
const
char
*
type
)
36
{
37
arax_accel_type_e
cnt;
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
}
arax_types.h
arax_accel_type_e
enum arax_accel_type arax_accel_type_e
CPU
@ CPU
Definition
arax_types.h:87
GPU_SOFT
@ GPU_SOFT
Definition
arax_types.h:86
OPEN_CL
@ OPEN_CL
Definition
arax_types.h:91
HIP
@ HIP
Definition
arax_types.h:92
ARAX_ACCEL_TYPES
@ ARAX_ACCEL_TYPES
Definition
arax_types.h:93
NANO_ARM
@ NANO_ARM
Definition
arax_types.h:89
GPU
@ GPU
Definition
arax_types.h:85
ANY
@ ANY
Definition
arax_types.h:84
NANO_CORE
@ NANO_CORE
Definition
arax_types.h:90
SDA
@ SDA
Definition
arax_types.h:88
arax_accel_valid_type
int arax_accel_valid_type(arax_accel_type_e type)
Definition
arax_accel_types.c:22
types_map
struct arax_accel_type_map types_map[ARAX_ACCEL_TYPES]
Definition
arax_accel_types.c:10
arax_accel_type_to_str
const char * arax_accel_type_to_str(arax_accel_type_e type)
Definition
arax_accel_types.c:27
arax_accel_type_from_str
arax_accel_type_e arax_accel_type_from_str(const char *type)
Definition
arax_accel_types.c:35
arax_accel_type_map
Definition
arax_accel_types.c:5
arax_accel_type_map::type
arax_accel_type_e type
Definition
arax_accel_types.c:7
arax_accel_type_map::str
const char * str
Definition
arax_accel_types.c:6
src
core
arax_accel_types.c
Generated by
1.13.2