source: trunk/firmware_v4/Drivers/CMSIS/NN/Source/CMakeLists.txt

Last change on this file was 42, checked in by f.jahn, 5 days ago
File size: 2.5 KB
Line 
1#
2# Copyright (c) 2019-2021 Arm Limited.
3#
4# SPDX-License-Identifier: Apache-2.0
5#
6# Licensed under the Apache License, Version 2.0 (the License); you may
7# not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an AS IS BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#
18
19SET(ROOT ${CMSIS_PATH})
20
21# Select which parts of the CMSIS-DSP must be compiled.
22# There are some dependencies between the parts but they are not tracked
23# by this cmake. So, enabling some functions may require to enable some
24# other ones.
25option(CONCATENATION "Concatenation" ON)
26option(FULLYCONNECTED "Fully Connected" ON)
27option(CONVOLUTION "Convolutions" ON)
28option(ACTIVATION "Activations" ON)
29option(POOLING "Pooling" ON)
30option(SOFTMAX "Softmax" ON)
31option(BASICMATHSNN "Basic Maths for NN" ON)
32option(RESHAPE "Reshape" ON)
33option(SVDF "SVDF" ON)
34
35# When OFF it is the default behavior : all tables are included.
36option(NNSUPPORT "NN Support" ON)
37
38
39###########################
40#
41# CMSIS NN
42#
43###########################
44
45# NN Sources
46SET(NN ${ROOT}/CMSIS/NN)
47
48list(APPEND CMAKE_MODULE_PATH ${NN}/Source)
49
50add_library(cmsis-nn STATIC)
51
52target_compile_options(cmsis-nn PRIVATE -Ofast)
53
54### Includes
55target_include_directories(cmsis-nn PUBLIC "${NN}/Include")
56target_include_directories(cmsis-nn PUBLIC "${ROOT}/CMSIS/Core/Include")
57target_include_directories(cmsis-nn PUBLIC "${ROOT}/CMSIS/DSP/Include")
58
59if (BASICMATHSNN)
60 add_subdirectory(BasicMathFunctions)
61endif()
62
63if (CONCATENATION)
64 add_subdirectory(ConcatenationFunctions)
65endif()
66
67if (FULLYCONNECTED)
68 add_subdirectory(FullyConnectedFunctions)
69endif()
70
71if (CONVOLUTION)
72 add_subdirectory(ConvolutionFunctions)
73endif()
74
75if (ACTIVATION)
76 add_subdirectory(ActivationFunctions)
77endif()
78
79if (POOLING)
80 add_subdirectory(PoolingFunctions)
81endif()
82
83if (SOFTMAX)
84 add_subdirectory(SoftmaxFunctions)
85endif()
86
87if (SVDF)
88 add_subdirectory(SVDFunctions)
89endif()
90
91if (RESHAPE)
92 add_subdirectory(ReshapeFunctions)
93endif()
94
95# Keep NNSUPPORT at the end
96if (NNSUPPORT)
97 add_subdirectory(NNSupportFunctions)
98endif()
Note: See TracBrowser for help on using the repository browser.