Arax -8d09c51940345c86062e8ef2427c705ae66e5926
A Runtime Framework for Decoupling Applications from Heterogeneous Accelerators
Loading...
Searching...
No Matches
arax_accel_types.c File Reference
#include "arax_types.h"
#include <strings.h>
+ Include dependency graph for arax_accel_types.c:

Go to the source code of this file.

Data Structures

struct  arax_accel_type_map
 

Functions

int arax_accel_valid_type (arax_accel_type_e type)
 
const char * arax_accel_type_to_str (arax_accel_type_e type)
 
arax_accel_type_e arax_accel_type_from_str (const char *type)
 

Variables

struct arax_accel_type_map types_map [ARAX_ACCEL_TYPES]
 

Function Documentation

◆ arax_accel_type_from_str()

arax_accel_type_e arax_accel_type_from_str ( const char * type)

Convert a string to the matching arax_accel_type_e value. type will be compared ignoring capitalization with the string in types_map variable in arax_accel_types.c.

NOTE: This function should not be used in critical paths!

Returns
A value from arax_accel_type_e, if no match is found returns ARAX_ACCEL_TYPES

Definition at line 35 of file arax_accel_types.c.

References ANY, ARAX_ACCEL_TYPES, arax_accel_type_map::str, arax_accel_type_map::type, and types_map.

◆ arax_accel_type_to_str()

const char * arax_accel_type_to_str ( arax_accel_type_e type)

Convert a arax_accel_type_e value to a human readable string. If type not a valid arax_accel_type_e value NULL is returned. NOTE: This function should not be used in critical paths!

Returns
A character representation for the given type,NULL on error.

Definition at line 27 of file arax_accel_types.c.

References arax_accel_valid_type(), arax_accel_type_map::type, and types_map.

+ Here is the call graph for this function:

◆ arax_accel_valid_type()

int arax_accel_valid_type ( arax_accel_type_e type)

Test type, to ensure it is a valid arax_accel_type_e value.

Parameters
typeValue to be checked.
Returns
1 if type is a valid arax_accel_type_e value, 0 otherwise.

Definition at line 22 of file arax_accel_types.c.

References ARAX_ACCEL_TYPES, and arax_accel_type_map::type.

Referenced by arax_accel_type_to_str(), arax_proc_can_run_at(), and arax_proc_get_functor().

+ Here is the caller graph for this function:

Variable Documentation

◆ types_map

Initial value:
= {
{ "any", ANY },
{ "gpu", GPU },
{ "gpu_soft", GPU_SOFT },
{ "cpu", CPU },
{ "sda", SDA },
{ "nano_arm", NANO_ARM },
{ "nano_core", NANO_CORE },
{ "Open_CL", OPEN_CL },
{ "HIP", HIP }
}
@ 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
@ 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

Definition at line 10 of file arax_accel_types.c.

Referenced by arax_accel_type_from_str(), and arax_accel_type_to_str().