1# 2# SPDX-FileCopyrightText: Copyright 2019-2022 Arm Limited and/or its affiliates <open-source-office@arm.com> 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) 34option(LSTM "LSTM" ON) 35 36# Always needed if any other module above is on. 37option(NNSUPPORT "NN Support" ON) 38 39list(APPEND CMAKE_MODULE_PATH Source) 40 41# There is a dependency to CMSIS-Core. 42target_include_directories(cmsis-nn PUBLIC "${ROOT}/CMSIS/Core/Include") 43 44if (BASICMATHSNN) 45 add_subdirectory(BasicMathFunctions) 46endif() 47 48if (CONCATENATION) 49 add_subdirectory(ConcatenationFunctions) 50endif() 51 52if (FULLYCONNECTED) 53 add_subdirectory(FullyConnectedFunctions) 54endif() 55 56if (CONVOLUTION) 57 add_subdirectory(ConvolutionFunctions) 58endif() 59 60if (ACTIVATION) 61 add_subdirectory(ActivationFunctions) 62endif() 63 64if (POOLING) 65 add_subdirectory(PoolingFunctions) 66endif() 67 68if (SOFTMAX) 69 add_subdirectory(SoftmaxFunctions) 70endif() 71 72if (SVDF) 73 add_subdirectory(SVDFunctions) 74endif() 75 76if (LSTM) 77 add_subdirectory(LSTMFunctions) 78endif() 79 80if (RESHAPE) 81 add_subdirectory(ReshapeFunctions) 82endif() 83 84# Keep NNSUPPORT at the end 85if (NNSUPPORT) 86 add_subdirectory(NNSupportFunctions) 87endif() 88