diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/cmake/cmsis-dsp.cmake | 8 | ||||
-rw-r--r-- | scripts/cmake/tensorflow_lite_micro.cmake | 10 |
2 files changed, 14 insertions, 4 deletions
diff --git a/scripts/cmake/cmsis-dsp.cmake b/scripts/cmake/cmsis-dsp.cmake index 2dc093d..f45bc7c 100644 --- a/scripts/cmake/cmsis-dsp.cmake +++ b/scripts/cmake/cmsis-dsp.cmake @@ -1,5 +1,6 @@ #---------------------------------------------------------------------------- -# SPDX-FileCopyrightText: Copyright 2021 Arm Limited and/or its affiliates <open-source-office@arm.com> +# SPDX-FileCopyrightText: Copyright 2021, 2024 Arm Limited and/or its +# affiliates <open-source-office@arm.com> # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -67,6 +68,11 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") "optimisation level") target_compile_options(${CMSIS_DSP_TARGET} PUBLIC -O3) endif() +elseif (CMAKE_CXX_COMPILER_ID STREQUAL "ARMClang") + # For Arm Compiler the floating-point standard conformance is set to'std' + # by default. As we need NaN's and infinity definitions, we set the mode + # to 'full'. + target_compile_options(${CMSIS_DSP_TARGET} PRIVATE -ffp-mode=full) endif () # 5. General compile definitions diff --git a/scripts/cmake/tensorflow_lite_micro.cmake b/scripts/cmake/tensorflow_lite_micro.cmake index cb45274..79e3e07 100644 --- a/scripts/cmake/tensorflow_lite_micro.cmake +++ b/scripts/cmake/tensorflow_lite_micro.cmake @@ -27,8 +27,12 @@ if (CMAKE_BUILD_TYPE STREQUAL Debug) set(TENSORFLOW_LITE_MICRO_CORE_OPTIMIZATION_LEVEL "-O0") set(TENSORFLOW_LITE_MICRO_KERNEL_OPTIMIZATION_LEVEL "-O0") elseif (CMAKE_BUILD_TYPE STREQUAL Release) - set(TENSORFLOW_LITE_MICRO_CORE_OPTIMIZATION_LEVEL "-Ofast") - set(TENSORFLOW_LITE_MICRO_KERNEL_OPTIMIZATION_LEVEL "-Ofast") + # -Ofast is not an option as we set the floating-point conformance mode + # to 'full' in the TensorFlow Lite Micro Makefile. Although this is done + # only for Arm Compiler, we stick with the '-O3' optimisation level for + # all compilers. + set(TENSORFLOW_LITE_MICRO_CORE_OPTIMIZATION_LEVEL "-O3") + set(TENSORFLOW_LITE_MICRO_KERNEL_OPTIMIZATION_LEVEL "-O3") endif() assert_defined(TENSORFLOW_LITE_MICRO_BUILD_TYPE) @@ -71,7 +75,7 @@ else() if(ETHOS_U_NPU_ENABLED) # Arm Ethos-U55 NPU is the co-processor for ML workload: set(TENSORFLOW_LITE_MICRO_CO_PROCESSOR "ethos_u") - set(TENSORFLOW_LITE_MICRO_CO_PROCESSOR_ARCH "u55") # Currently only u55 is supported by TFLite Micro. + string(TOLOWER ${ETHOS_U_NPU_ID} TENSORFLOW_LITE_MICRO_CO_PROCESSOR_ARCH) endif() set(TENSORFLOW_LITE_MICRO_OPTIMIZED_KERNEL "cmsis_nn") |