Skip to content

Commit 1337dce

Browse files
committed
Release v1.0.0
1 parent 60fd70a commit 1337dce

File tree

265 files changed

+1563186
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

265 files changed

+1563186
-2
lines changed

Binary/app.hex

Lines changed: 18767 additions & 0 deletions
Large diffs are not rendered by default.

Binary/mcuboot.hex

Lines changed: 2787 additions & 0 deletions
Large diffs are not rendered by default.

Binary/network_data.hex

Lines changed: 691016 additions & 0 deletions
Large diffs are not rendered by default.

LICENSE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
| Component | Copyright | License |
2+
|:--------- |:---------- |:------- |
3+
| app | STMicroelectronics | SLA0044 |
4+
| Lib/AI_Runtime | STMicroelectronics | SLA0044 |
5+
| Lib/lib_vision_models_pp/lib_vision_models_pp | STMicroelectronics | SLA0044 |
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
******************************************************************************
3+
* @file ai_common_config.h
4+
* @author AST Embedded Analytics Research Platform
5+
* @brief header file of AI platform common compile configuration defines
6+
******************************************************************************
7+
* @attention
8+
*
9+
* Copyright (c) 2018 STMicroelectronics.
10+
* All rights reserved.
11+
*
12+
* This software is licensed under terms that can be found in the LICENSE file
13+
* in the root directory of this software component.
14+
* If no LICENSE file comes with this software, it is provided AS-IS.
15+
*
16+
******************************************************************************
17+
*/
18+
#ifndef AI_COMMON_CONFIG_H
19+
#define AI_COMMON_CONFIG_H
20+
21+
/*!
22+
* @defgroup layers Layers Compilation Config Definitions
23+
* @brief definition
24+
*
25+
*/
26+
27+
#define HAS_PROFILE_FLOAT
28+
#define HAS_PROFILE_FIXED
29+
30+
31+
#endif /*AI_COMMON_CONFIG_H*/

Lib/AI_Runtime/Inc/ai_datatypes.h

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
2+
#ifndef AI_DATATYPES_H
3+
#define AI_DATATYPES_H
4+
/**
5+
******************************************************************************
6+
* @file ai_datatypes.h
7+
* @author AST Embedded Analytics Research Platform
8+
* @brief Definitions of AI platform private APIs types
9+
******************************************************************************
10+
* @attention
11+
*
12+
* Copyright (c) 2017 STMicroelectronics.
13+
* All rights reserved.
14+
*
15+
* This software is licensed under terms that can be found in the LICENSE file
16+
* in the root directory of this software component.
17+
* If no LICENSE file comes with this software, it is provided AS-IS.
18+
*
19+
******************************************************************************
20+
*/
21+
#include <string.h>
22+
#include "ai_platform.h"
23+
#include "ai_platform_interface.h"
24+
25+
/*!
26+
* @defgroup datatypes Platform Interface Datatypes
27+
* @brief Data structures used by AI platform to implement neural networks
28+
*
29+
*/
30+
31+
/** Count Variable Number of Arguments (up to 64 elements) *******************/
32+
#define AI_NUMARGS(...) \
33+
PP_NARG_(__VA_ARGS__,PP_RSEQ_N())
34+
#define PP_NARG_(...) \
35+
PP_ARG_N(__VA_ARGS__)
36+
#define PP_ARG_N( \
37+
_1, _2, _3, _4, _5, _6, _7, _8, _9,_10, \
38+
_11,_12,_13,_14,_15,_16,_17,_18,_19,_20, \
39+
_21,_22,_23,_24,_25,_26,_27,_28,_29,_30, \
40+
_31,_32,_33,_34,_35,_36,_37,_38,_39,_40, \
41+
_41,_42,_43,_44,_45,_46,_47,_48,_49,_50, \
42+
_51,_52,_53,_54,_55,_56,_57,_58,_59,_60, \
43+
_61,_62,_63,N,...) N
44+
#define PP_RSEQ_N() \
45+
63,62,61,60, \
46+
59,58,57,56,55,54,53,52,51,50, \
47+
49,48,47,46,45,44,43,42,41,40, \
48+
39,38,37,36,35,34,33,32,31,30, \
49+
29,28,27,26,25,24,23,22,21,20, \
50+
19,18,17,16,15,14,13,12,11,10, \
51+
9,8,7,6,5,4,3,2,1,0
52+
53+
54+
/*****************************************************************************/
55+
#define AI_PTR_ALIGN(ptr, alignment) \
56+
((((ai_uptr)(ptr))+((ai_uptr)(alignment)-1))&(~((ai_uptr)(alignment)-1)))
57+
58+
59+
/*!
60+
* @typedef ai_offset
61+
* @ingroup ai_datatypes_internal
62+
* @brief Generic index offset type
63+
*/
64+
typedef int32_t ai_offset;
65+
66+
67+
AI_API_DECLARE_BEGIN
68+
69+
AI_API_DECLARE_END
70+
71+
#endif /* AI_DATATYPES_H */
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
/**
2+
******************************************************************************
3+
* @file ai_datatypes_defines.h
4+
* @author AST Embedded Analytics Research Platform
5+
* @brief Definitions of AI platform private APIs types
6+
******************************************************************************
7+
* @attention
8+
*
9+
* Copyright (c) 2017 STMicroelectronics.
10+
* All rights reserved.
11+
*
12+
* This software is licensed under terms that can be found in the LICENSE file
13+
* in the root directory of this software component.
14+
* If no LICENSE file comes with this software, it is provided AS-IS.
15+
*
16+
******************************************************************************
17+
*/
18+
#ifndef AI_DATATYPES_DEFINES_H
19+
#define AI_DATATYPES_DEFINES_H
20+
21+
#include "ai_platform.h"
22+
#include "core_assert.h"
23+
24+
25+
/*!
26+
* @defgroup datatypes_defines Internal Datatypes Defines Header
27+
* @brief Data structures used internally to implement neural networks
28+
*
29+
*/
30+
31+
/* define to track datatypes used by codegen */
32+
#define AI_INTERNAL_API /* AI_INTERNAL_API */
33+
34+
#define AI_CONST const
35+
#define AI_STATIC static
36+
#define AI_STATIC_CONST static const
37+
38+
/******************************************************************************/
39+
/* NOP operation used by codegen */
40+
#define AI_NOP /* NOP */
41+
42+
#define AI_WRAP_FUNC(fn_) do { fn_ } while (0);
43+
44+
#define AI_CAT(a, ...) AI_PRIMITIVE_CAT(a, __VA_ARGS__)
45+
#define AI_PRIMITIVE_CAT(a, ...) a ## __VA_ARGS__
46+
47+
/******************************************************************************/
48+
#define AI_ASSERT(expr) \
49+
CORE_ASSERT(expr)
50+
51+
52+
/******************************************************************************/
53+
#define AI_NO_PACKED_STRUCTS
54+
55+
/* Macro for defining packed structures (compiler dependent).
56+
* This just reduces memory requirements, but is not required.
57+
*/
58+
#if defined(AI_NO_PACKED_STRUCTS)
59+
/* Disable struct packing */
60+
#define AI_PACKED_STRUCT_START /* AI_PACKED_STRUCT_START */
61+
#define AI_PACKED_STRUCT_END /* AI_PACKED_STRUCT_END */
62+
#define AI_PACKED /* AI_PACKED */
63+
#elif defined(__GNUC__) || defined(__clang__)
64+
/* For GCC and clang */
65+
#define AI_PACKED_STRUCT_START /* AI_PACKED_STRUCT_START */
66+
#define AI_PACKED_STRUCT_END /* AI_PACKED_STRUCT_END */
67+
#define AI_PACKED __attribute__((packed))
68+
#elif defined(__ICCARM__) || defined (__IAR_SYSTEMS_ICC__) || defined(__CC_ARM)
69+
/* For IAR ARM and Keil MDK-ARM compilers */
70+
#define AI_PACKED_STRUCT_START _Pragma("pack(push, 1)")
71+
#define AI_PACKED_STRUCT_END _Pragma("pack(pop)")
72+
#define AI_PACKED /* AI_PACKED */
73+
#elif defined(_MSC_VER) && (_MSC_VER >= 1500)
74+
/* For Microsoft Visual C++ */
75+
#define AI_PACKED_STRUCT_START __pragma(pack(push, 1))
76+
#define AI_PACKED_STRUCT_END __pragma(pack(pop))
77+
#define AI_PACKED /* AI_PACKED */
78+
#else
79+
/* Unknown compiler */
80+
#define AI_PACKED_STRUCT_START /* AI_PACKED_STRUCT_START */
81+
#define AI_PACKED_STRUCT_END /* AI_PACKED_STRUCT_END */
82+
#define AI_PACKED /* AI_PACKED */
83+
#endif /* AI_NO_PACKED_STRUCTS */
84+
85+
/******************************************************************************/
86+
#define AI_STRINGIFY_ARG(contents) # contents
87+
#define AI_STRINGIFY(macro_or_string) AI_STRINGIFY_ARG (macro_or_string)
88+
89+
/******************************************************************************/
90+
#if defined(_MSC_VER)
91+
#define AI_DECLARE_STATIC static __inline
92+
// #define AI_FORCE_INLINE static __forceinline
93+
#define AI_FORCE_INLINE static __inline
94+
#define AI_HINT_INLINE static __inline
95+
#define AI_ALIGNED_TYPE(type, x) type __declspec(align(x))
96+
#define AI_INTERFACE_ENTRY __declspec(dllexport)
97+
#elif defined(__ICCARM__) || defined (__IAR_SYSTEMS_ICC__)
98+
#define AI_DECLARE_STATIC static inline
99+
// #define AI_FORCE_INLINE static _Pragma("inline=forced") // TODO: check this definition!
100+
#define AI_FORCE_INLINE static inline
101+
#define AI_HINT_INLINE static inline
102+
#define AI_ALIGNED_TYPE(type, x) type
103+
#define AI_INTERFACE_ENTRY /* AI_INTERFACE_ENTRY */
104+
#elif defined(__GNUC__)
105+
#define AI_DECLARE_STATIC static __inline
106+
#define AI_FORCE_INLINE static __inline
107+
#define AI_HINT_INLINE static __inline
108+
#define AI_ALIGNED_TYPE(type, x) type __attribute__ ((aligned(x)))
109+
#define AI_INTERFACE_ENTRY /* AI_INTERFACE_ENTRY */
110+
#else /* _MSC_VER */
111+
#define AI_DECLARE_STATIC static __inline
112+
// #define AI_FORCE_INLINE static __forceinline
113+
#define AI_FORCE_INLINE static __inline
114+
#define AI_HINT_INLINE static __inline
115+
#define AI_ALIGNED_TYPE(type, x) type __attribute__ ((aligned(x)))
116+
#define AI_INTERFACE_ENTRY __attribute__((visibility("default")))
117+
#endif /* _MSC_VER */
118+
119+
/******************************************************************************/
120+
#define AI_ALIGN_MASKED(value, mask) ( ((value)+(mask))&(~(mask)) )
121+
122+
#define AI_GET_VERSION_STRING(major, minor, micro) \
123+
AI_STRINGIFY_ARG(major) "." \
124+
AI_STRINGIFY_ARG(minor) "." \
125+
AI_STRINGIFY_ARG(micro) \
126+
127+
128+
#define AI_PACK_TENSORS_PTR(...) \
129+
AI_PACK(__VA_ARGS__)
130+
131+
#define AI_PACK_INFO(size_) (ai_tensor_info[1]) { { \
132+
.buffer = (ai_buffer[size_])AI_STRUCT_INIT, \
133+
.state = (ai_tensor_state[size_])AI_STRUCT_INIT, \
134+
} }
135+
136+
#define AI_CR "\r\n"
137+
138+
#if (defined HAS_AI_DEBUG || defined HAS_DEBUG_LIB)
139+
#include <stdio.h>
140+
#define AI_DEBUG(...) __VA_ARGS__
141+
#define AI_DEBUG_PRINT(fmt, ...) { printf(fmt, ##__VA_ARGS__); }
142+
#else
143+
#define AI_DEBUG(...) AI_WRAP_FUNC(/*AI_DEBUG*/)
144+
#define AI_DEBUG_PRINT(fmt, ...) AI_WRAP_FUNC(/*AI_DEBUG_PRINT*/)
145+
#endif
146+
147+
#define AI_FLAG_SET(mask, flag) (mask) |= (flag)
148+
#define AI_FLAG_UNSET(mask, flag) (mask) &= (~(flag))
149+
#define AI_FLAG_IS_SET(mask, flag) ((flag)==((mask)&(flag)))
150+
151+
#endif /*AI_DATATYPES_DEFINES_H*/

0 commit comments

Comments
 (0)