File size: 1,536 Bytes
1634b64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef __AX_DEVICES_H__
#define __AX_DEVICES_H__

#if defined(__cplusplus)
extern "C"
{
#endif
#define AX_DEVICES_COUNT 16
#define AX_VERSION_LEN 32

    typedef enum
    {
        ax_dev_errcode_failed = -1,
        ax_dev_errcode_success = 0,

        ax_dev_errcode_sysinit_failed,
        ax_dev_errcode_sysdeinit_failed,
        ax_dev_errcode_axcl_sysinit_failed,
        ax_dev_errcode_axcl_sysdeinit_failed,
    } ax_dev_errcode_e;

    typedef enum
    {
        unknown_device = 0,
        host_device = 1,
        axcl_device = 2
    } ax_devive_e;

    typedef struct
    {
        struct
        {
            char available;
            char version[AX_VERSION_LEN];
            struct
            {
                int remain;
                int total;
            } mem_info;
        } host;

        struct
        {
            char host_version[AX_VERSION_LEN];
            char dev_version[AX_VERSION_LEN];
            unsigned char count;
            struct
            {
                int temp;
                int cpu_usage;
                int npu_usage;
                struct
                {
                    int remain;
                    int total;
                } mem_info;
            } devices_info[AX_DEVICES_COUNT];

        } devices;
    } ax_devices_t;

    int ax_dev_enum_devices(ax_devices_t *devices);
    int ax_dev_sys_init(ax_devive_e dev_type, char devid);
    int ax_dev_sys_deinit(ax_devive_e dev_type, char devid);

#if defined(__cplusplus)
}
#endif

#endif // __AX_DEVICES_H__