summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKshitij Sisodia <kshitij.sisodia@arm.com>2021-11-23 17:19:52 +0000
committerKshitij Sisodia <kshitij.sisodia@arm.com>2021-11-23 17:19:52 +0000
commitb59ba684aef4bef16262a1825e787a55fc992f0d (patch)
tree389e667ef3132727386e0800c0a63d676693185f
parent37926c819f77a6fe9e3ae913486ac6fc78bd2bd0 (diff)
downloadml-embedded-evaluation-kit-b59ba684aef4bef16262a1825e787a55fc992f0d.tar.gz
MLECO-1935: All common CMake user options consolidated.
For easier look up and maintenance, all common CMake user options have been consolidated in one CMake file. NOTE: the individual use case specific options are still within the correspoinding use case CMake files. Change-Id: Id887f7b2c763f4d3eb997d997cf466684d0089b6
-rw-r--r--CMakeLists.txt89
-rw-r--r--docs/sections/building.md6
-rw-r--r--scripts/cmake/bare-metal-sources.cmake30
-rw-r--r--scripts/cmake/common_user_options.cmake164
-rw-r--r--scripts/cmake/native-sources.cmake2
-rw-r--r--scripts/cmake/source_gen_utils.cmake2
-rw-r--r--scripts/cmake/tensorflow.cmake20
-rw-r--r--scripts/cmake/util_functions.cmake9
-rw-r--r--tests/common/PlatformMathTests.cpp10
9 files changed, 206 insertions, 126 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b747018..a3e238a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,13 +41,11 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_SCRIPTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake)
set(DOWNLOAD_DEP_DIR ${CMAKE_BINARY_DIR}/dependencies)
-set(CMAKE_TOOLCHAIN_DIR ${CMAKE_SCRIPTS_DIR}/toolchains)
set(RESOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/resources_downloaded
CACHE PATH "Resources directory")
include(${CMAKE_SCRIPTS_DIR}/source_gen_utils.cmake)
-include(${CMAKE_SCRIPTS_DIR}/util_functions.cmake)
if (${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
message(FATAL_ERROR "Source and build are in the same directory")
@@ -56,55 +54,20 @@ else()
message(STATUS "Binary directory: ${CMAKE_BINARY_DIR}")
endif()
-USER_OPTION(LOG_LEVEL "Log level for the application"
- LOG_LEVEL_INFO
- STRING)
-
-USER_OPTION(TENSORFLOW_SRC_PATH "Path to the root of the tensor flow directory"
- "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/tensorflow"
- PATH)
-
-USER_OPTION(TARGET_PLATFORM "Target platform to execute evaluation application: mps3, simple_platform, native"
- mps3
- STRING)
-
-USER_OPTION(TARGET_SUBSYSTEM "Specify platform target subsystem: sse-300 or none"
- sse-300
- STRING)
-
-USER_OPTION(ETHOS_U_NPU_ENABLED "Select if Ethos-U NPU is available for the platform and subsystem"
- ON
- BOOL)
-
-USER_OPTION(USE_CASE_BUILD "Optional. Defines the use-case to build from the available sources. By default, all use-cases are built."
- all
- STRING)
-
-USER_OPTION(CPU_PROFILE_ENABLED "Output CPU performance profiling information. Should be used only for MPS3 board."
- OFF
- BOOL)
-
-if (TARGET_PLATFORM STREQUAL mps3)
- message(STATUS "Platform: MPS3 FPGA Prototyping Board or FVP")
- set(DEFAULT_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_DIR}/bare-metal-gcc.cmake)
-elseif (TARGET_PLATFORM STREQUAL simple_platform)
- message(STATUS "Platform: Simple platform with minimal peripherals")
- set(DEFAULT_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_DIR}/bare-metal-gcc.cmake)
-elseif (TARGET_PLATFORM STREQUAL native)
- message(STATUS "Platform: Native (Linux based x86_64/aarch64 system)")
- set(DEFAULT_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_DIR}/native-gcc.cmake)
-else ()
- message(FATAL_ERROR "Invalid platform specified: ${TARGET_PLATFORM}")
-endif ()
+include(${CMAKE_SCRIPTS_DIR}/common_user_options.cmake)
-if (NOT DEFINED CMAKE_TOOLCHAIN_FILE)
- set(CMAKE_TOOLCHAIN_FILE ${DEFAULT_TOOLCHAIN_FILE}
- CACHE FILEPATH "Toolchain file")
-endif()
-message(STATUS "Using CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}")
+# Make sure the following options are defined before proceeding:
+assert_defined(LOG_LEVEL)
+assert_defined(TENSORFLOW_SRC_PATH)
+assert_defined(TARGET_PLATFORM)
+assert_defined(TARGET_SUBSYSTEM)
+assert_defined(ETHOS_U_NPU_ENABLED)
+assert_defined(USE_CASE_BUILD)
+assert_defined(CPU_PROFILE_ENABLED)
+assert_defined(CMAKE_TOOLCHAIN_FILE)
project(arm_ml_embedded_evaluation_kit
- VERSION 21.08
+ VERSION 21.11
DESCRIPTION "ARM ML Embedded Evaluation Kit for MPS3 FPGA and FastModel")
enforce_compiler_version()
@@ -127,25 +90,13 @@ if (TARGET_PLATFORM STREQUAL native)
else ()
set(PLATFORM_SOURCES_CMAKE_FILE ${CMAKE_SCRIPTS_DIR}/bare-metal-sources.cmake)
- USER_OPTION(CMSIS_SRC_PATH
- "Path to CMSIS-5 sources"
- "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/cmsis"
- PATH
- )
+ assert_defined(CMSIS_SRC_PATH)
if (CMAKE_BUILD_TYPE STREQUAL Debug AND CMAKE_CXX_COMPILER_ID STREQUAL ARMClang)
- USER_OPTION(ARMCLANG_DEBUG_DWARF_LEVEL
- "Dwarf conformance level for armclang toolchain"
- "4" # Default = 4 (Arm-DS etc). For model debugger specify "3"
- STRING
- )
- elseif (DEFINED ARMCLANG_DEBUG_DWARF_LEVEL)
- message(WARNING "ARMCLANG_DEBUG_DWARF_LEVEL definition is unsupported"
- "within current configuration. Removing definition...")
- unset(ARMCLANG_DEBUG_DWARF_LEVEL CACHE)
+ assert_defined(ARMCLANG_DEBUG_DWARF_LEVEL)
endif()
-
endif ()
+
message(STATUS "Including ${PLATFORM_SOURCES_CMAKE_FILE}")
include(${PLATFORM_SOURCES_CMAKE_FILE})
@@ -167,17 +118,9 @@ endif ()
if (ETHOS_U_NPU_ENABLED)
message(STATUS "Using ARM Ethos-U NPU - adding core-driver and timing-adapter-driver includes and libraries")
- USER_OPTION(ETHOS_U_NPU_TIMING_ADAPTER_SRC_PATH
- "Path to Ethos-U NPU timing adapter sources"
- "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/core-software/drivers/timing_adapter"
- PATH
- )
- USER_OPTION(ETHOS_U_NPU_DRIVER_SRC_PATH
- "Path to Ethos-U NPU core driver sources"
- "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/core-driver"
- PATH
- )
+ assert_defined(ETHOS_U_NPU_TIMING_ADAPTER_SRC_PATH)
+ assert_defined(ETHOS_U_NPU_DRIVER_SRC_PATH)
include_directories("${ETHOS_U_NPU_TIMING_ADAPTER_SRC_PATH}/include/")
diff --git a/docs/sections/building.md b/docs/sections/building.md
index 28130d6..7ca98c5 100644
--- a/docs/sections/building.md
+++ b/docs/sections/building.md
@@ -119,9 +119,9 @@ along with the network inputs.
It also builds TensorFlow Lite for Microcontrollers library, Arm® *Ethos™-U* NPU driver library, and the CMSIS-DSP library
from sources.
-The build script is parameterized to support different options. Default values for build parameters build the
-applications for all use-cases where the Arm® *Corstone™-300* design can execute on an MPS3 FPGA or the Fixed Virtual
-Platform (FVP).
+The build script is parameterized to support different options (see [common_user_options.cmake](../../scripts/cmake/common_user_options.cmake)).
+Default values for these parameters configure the build for all use-cases to be executed on an MPS3 FPGA or the Fixed Virtual
+Platform (FVP) implementation of the Arm® *Corstone™-300* design.
The build parameters are:
diff --git a/scripts/cmake/bare-metal-sources.cmake b/scripts/cmake/bare-metal-sources.cmake
index 98030d5..abca622 100644
--- a/scripts/cmake/bare-metal-sources.cmake
+++ b/scripts/cmake/bare-metal-sources.cmake
@@ -40,29 +40,9 @@ set(ETHOS_U_NPU_FLAG "-DARM_NPU=1")
if (ETHOS_U_NPU_ENABLED)
- USER_OPTION(ETHOS_U_NPU_ID "Arm Ethos-U NPU IP (U55 or U65)"
- "U55"
- STRING)
-
- if ((ETHOS_U_NPU_ID STREQUAL U55) OR (ETHOS_U_NPU_ID STREQUAL U65))
- if (ETHOS_U_NPU_ID STREQUAL U55)
- set(DEFAULT_NPU_MEM_MODE "Shared_Sram")
- set(DEFAULT_NPU_CONFIG_ID "H128")
- elseif(ETHOS_U_NPU_ID STREQUAL U65)
- set(DEFAULT_NPU_MEM_MODE "Dedicated_Sram")
- set(DEFAULT_NPU_CONFIG_ID "Y256")
- endif()
- else ()
- message(FATAL_ERROR "Non compatible Ethos-U NPU processor ${ETHOS_U_NPU_ID}")
- endif ()
-
- USER_OPTION(ETHOS_U_NPU_MEMORY_MODE "Specifies the memory mode used in the Vela command."
- "${DEFAULT_NPU_MEM_MODE}"
- STRING)
-
- USER_OPTION(ETHOS_U_NPU_CONFIG_ID "Specifies the configuration ID for the NPU."
- "${DEFAULT_NPU_CONFIG_ID}"
- STRING)
+ assert_defined(ETHOS_U_NPU_ID)
+ assert_defined(ETHOS_U_NPU_MEMORY_MODE)
+ assert_defined(ETHOS_U_NPU_CONFIG_ID)
if (ETHOS_U_NPU_MEMORY_MODE STREQUAL Sram_Only)
@@ -140,11 +120,9 @@ if (ETHOS_U_NPU_ENABLED)
else ()
set(DEFAULT_TA_CONFIG_FILE_PATH "${CMAKE_SCRIPTS_DIR}/timing_adapter/ta_config_u65_high_end.cmake")
endif ()
- USER_OPTION(TA_CONFIG_FILE "Path to the timing adapter configuration file"
- ${DEFAULT_TA_CONFIG_FILE_PATH}
- FILEPATH)
# must be included after target subsystem CMake file
+ assert_defined(TA_CONFIG_FILE)
include(${TA_CONFIG_FILE})
endif()
diff --git a/scripts/cmake/common_user_options.cmake b/scripts/cmake/common_user_options.cmake
new file mode 100644
index 0000000..13c88d2
--- /dev/null
+++ b/scripts/cmake/common_user_options.cmake
@@ -0,0 +1,164 @@
+#----------------------------------------------------------------------------
+# Copyright (c) 2021 Arm Limited. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#----------------------------------------------------------------------------
+
+#----------------------------------------------------------------------------
+# This file should contain all the common user options for the application
+# For use case specific options, see individual usecase.cmake files under
+# each example use case.
+#----------------------------------------------------------------------------
+
+if (NOT DEFINED USER_OPTIONS_INCLUDED)
+ set(USER_OPTIONS_INCLUDED ON)
+else()
+ return()
+endif()
+
+message(STATUS "Assessing common user options...")
+
+set(CMAKE_TOOLCHAIN_DIR ${CMAKE_CURRENT_LIST_DIR}/toolchains)
+set(DEPENDENCY_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../../dependencies)
+include(${CMAKE_CURRENT_LIST_DIR}/util_functions.cmake)
+
+USER_OPTION(LOG_LEVEL "Log level for the application"
+ LOG_LEVEL_INFO
+ STRING)
+
+USER_OPTION(TENSORFLOW_SRC_PATH "Path to the root of the tensor flow directory"
+ "${DEPENDENCY_ROOT_DIR}/tensorflow"
+ PATH)
+
+USER_OPTION(TARGET_PLATFORM "Target platform to execute evaluation application: mps3, simple_platform, native"
+ mps3
+ STRING)
+
+USER_OPTION(TARGET_SUBSYSTEM "Specify platform target subsystem: sse-300 or none"
+ sse-300
+ STRING)
+
+if (TARGET_PLATFORM STREQUAL native)
+ set(NPU_AVAILABLE OFF)
+else()
+ set(NPU_AVAILABLE ON)
+endif()
+
+USER_OPTION(ETHOS_U_NPU_ENABLED "If Arm Ethos-U NPU is enabled in the target system."
+ ${NPU_AVAILABLE}
+ BOOL)
+
+USER_OPTION(USE_CASE_BUILD "Optional. Defines the use-case to build from the available sources. By default, all use-cases are built."
+ all
+ STRING)
+
+USER_OPTION(CPU_PROFILE_ENABLED "Output CPU performance profiling information. Should be used only for MPS3 board."
+ OFF
+ BOOL)
+
+USER_OPTION(TENSORFLOW_LITE_MICRO_BUILD_TYPE "TensorFlow Lite Mirco build type (release/debug etc.)"
+ $<IF:$<CONFIG:RELEASE>,release_with_logs,debug>
+ STRING)
+
+USER_OPTION(TENSORFLOW_LITE_MICRO_CLEAN_DOWNLOADS "Select if TPIP downloads should be cleaned before each build."
+ OFF
+ BOOL)
+
+USER_OPTION(TENSORFLOW_LITE_MICRO_CLEAN_BUILD "Select if clean target should be added to a list of targets"
+ ON
+ BOOL)
+
+if (NOT TARGET_PLATFORM STREQUAL native)
+
+ USER_OPTION(CMSIS_SRC_PATH
+ "Path to CMSIS-5 sources"
+ "${DEPENDENCY_ROOT_DIR}/cmsis"
+ PATH)
+
+ if (CMAKE_BUILD_TYPE STREQUAL Debug)
+ # For use with Arm compiler:
+ USER_OPTION(ARMCLANG_DEBUG_DWARF_LEVEL
+ "Dwarf conformance level for armclang toolchain"
+ "4" # Default = 4 (Arm-DS etc). For model debugger specify "3"
+ STRING)
+ endif()
+
+ # If we need NPU libraries:
+ if (ETHOS_U_NPU_ENABLED)
+ USER_OPTION(ETHOS_U_NPU_TIMING_ADAPTER_SRC_PATH
+ "Path to Ethos-U NPU timing adapter sources"
+ "${DEPENDENCY_ROOT_DIR}/core-software/drivers/timing_adapter"
+ PATH
+ )
+
+ USER_OPTION(ETHOS_U_NPU_DRIVER_SRC_PATH
+ "Path to Ethos-U NPU core driver sources"
+ "${DEPENDENCY_ROOT_DIR}/core-driver"
+ PATH
+ )
+
+ USER_OPTION(ETHOS_U_NPU_ID "Arm Ethos-U NPU IP (U55 or U65)"
+ "U55"
+ STRING)
+
+ if ((ETHOS_U_NPU_ID STREQUAL U55) OR (ETHOS_U_NPU_ID STREQUAL U65))
+ if (ETHOS_U_NPU_ID STREQUAL U55)
+ set(DEFAULT_NPU_MEM_MODE "Shared_Sram")
+ set(DEFAULT_NPU_CONFIG_ID "H128")
+ elseif(ETHOS_U_NPU_ID STREQUAL U65)
+ set(DEFAULT_NPU_MEM_MODE "Dedicated_Sram")
+ set(DEFAULT_NPU_CONFIG_ID "Y256")
+ endif()
+ else ()
+ message(FATAL_ERROR "Non compatible Ethos-U NPU processor ${ETHOS_U_NPU_ID}")
+ endif ()
+
+ USER_OPTION(ETHOS_U_NPU_MEMORY_MODE "Specifies the memory mode used in the Vela command."
+ "${DEFAULT_NPU_MEM_MODE}"
+ STRING)
+
+ USER_OPTION(ETHOS_U_NPU_CONFIG_ID "Specifies the configuration ID for the NPU."
+ "${DEFAULT_NPU_CONFIG_ID}"
+ STRING)
+
+ if (ETHOS_U_NPU_ID STREQUAL U55)
+ set(DEFAULT_TA_CONFIG_FILE_PATH "${CMAKE_CURRENT_LIST_DIR}/timing_adapter/ta_config_u55_high_end.cmake")
+ else ()
+ set(DEFAULT_TA_CONFIG_FILE_PATH "${CMAKE_CURRENT_LIST_DIR}/timing_adapter/ta_config_u65_high_end.cmake")
+ endif ()
+
+ USER_OPTION(TA_CONFIG_FILE "Path to the timing adapter configuration file"
+ ${DEFAULT_TA_CONFIG_FILE_PATH}
+ FILEPATH)
+ endif()
+endif()
+
+if (TARGET_PLATFORM STREQUAL mps3)
+ message(STATUS "Platform: MPS3 FPGA Prototyping Board or FVP")
+ set(DEFAULT_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_DIR}/bare-metal-gcc.cmake)
+elseif (TARGET_PLATFORM STREQUAL simple_platform)
+ message(STATUS "Platform: Simple platform with minimal peripherals")
+ set(DEFAULT_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_DIR}/bare-metal-gcc.cmake)
+elseif (TARGET_PLATFORM STREQUAL native)
+ message(STATUS "Platform: Native (Linux based x86_64/aarch64 system)")
+ set(DEFAULT_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_DIR}/native-gcc.cmake)
+else ()
+ message(FATAL_ERROR "Invalid platform specified: ${TARGET_PLATFORM}")
+endif ()
+
+if (NOT DEFINED CMAKE_TOOLCHAIN_FILE)
+ set(CMAKE_TOOLCHAIN_FILE ${DEFAULT_TOOLCHAIN_FILE}
+ CACHE FILEPATH "Toolchain file")
+endif()
+message(STATUS "Using CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}")
diff --git a/scripts/cmake/native-sources.cmake b/scripts/cmake/native-sources.cmake
index 2a5b0ae..6ebf435 100644
--- a/scripts/cmake/native-sources.cmake
+++ b/scripts/cmake/native-sources.cmake
@@ -20,7 +20,7 @@ set(PLAT_HAL ${CMAKE_CURRENT_SOURCE_DIR}/source/application/hal/platforms/native
if (ETHOS_U_NPU_ENABLED)
message(WARNING "EthosU can't be enabled for native builds."
- "Use -DETHOS_U_NPU_ENABLED=0 flag for this target platform."
+ "Use -DETHOS_U_NPU_ENABLED=OFF flag for this target platform."
"Overriding, disabling use of EthosU...")
set(ETHOS_U_NPU_ENABLED OFF)
endif()
diff --git a/scripts/cmake/source_gen_utils.cmake b/scripts/cmake/source_gen_utils.cmake
index 9d27b4d..ccce7e7 100644
--- a/scripts/cmake/source_gen_utils.cmake
+++ b/scripts/cmake/source_gen_utils.cmake
@@ -218,7 +218,7 @@ function(generate_test_data_code)
)
# no input NPY data found => skip code generation.
if(NOT input_data_files)
- message(WARNING "No files were found to generated input data: ${input_dir}")
+ message(WARNING "No files were found to generate input data: ${input_dir}")
break()
endif()
diff --git a/scripts/cmake/tensorflow.cmake b/scripts/cmake/tensorflow.cmake
index 60f191f..8ebac28 100644
--- a/scripts/cmake/tensorflow.cmake
+++ b/scripts/cmake/tensorflow.cmake
@@ -19,30 +19,16 @@ include(ProcessorCount)
ProcessorCount(J)
if (CMAKE_BUILD_TYPE STREQUAL Debug)
- set(TENSORFLOW_LITE_MICRO_DEFAULT_BUILD_TYPE "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_DEFAULT_BUILD_TYPE "release_with_logs")
set(TENSORFLOW_LITE_MICRO_CORE_OPTIMIZATION_LEVEL "-O3")
set(TENSORFLOW_LITE_MICRO_KERNEL_OPTIMIZATION_LEVEL "-O3")
-elseif (NOT DEFINED TENSORFLOW_LITE_MICRO_BUILD_TYPE)
- message(WARNING "TENSORFLOW_LITE_MICRO_BUILD_TYPE is not set.")
- message(FATAL_ERROR "Build type ${CMAKE_BUILD_TYPE} does not have a corresponding "
- "default to set TensorFlow build type")
endif()
-USER_OPTION(TENSORFLOW_LITE_MICRO_BUILD_TYPE "TensorFlow Lite Mirco build type (release/debug etc.)"
- ${TENSORFLOW_LITE_MICRO_DEFAULT_BUILD_TYPE}
- STRING)
-
-USER_OPTION(TENSORFLOW_LITE_MICRO_CLEAN_DOWNLOADS "Select if TPIP downloads should be cleaned before each build."
- OFF
- BOOL)
-
-USER_OPTION(TENSORFLOW_LITE_MICRO_CLEAN_BUILD "Select if clean target should be added to a list of targets"
- ON
- BOOL)
+assert_defined(TENSORFLOW_LITE_MICRO_BUILD_TYPE)
+assert_defined(TENSORFLOW_LITE_MICRO_CLEAN_DOWNLOADS)
+assert_defined(TENSORFLOW_LITE_MICRO_CLEAN_BUILD)
if (CMAKE_CXX_COMPILER_ID STREQUAL "ARMClang")
set(TENSORFLOW_LITE_MICRO_TOOLCHAIN "armclang")
diff --git a/scripts/cmake/util_functions.cmake b/scripts/cmake/util_functions.cmake
index 06ae184..f9742f7 100644
--- a/scripts/cmake/util_functions.cmake
+++ b/scripts/cmake/util_functions.cmake
@@ -84,6 +84,15 @@ function(USER_OPTION name description default type)
endfunction()
+
+# Function to check if a variable is defined, and throw
+# an error if it is not.
+function(assert_defined var_name)
+ if (NOT DEFINED ${var_name})
+ message(FATAL_ERROR "ERROR: ${var_name} is undefined!")
+ endif()
+endfunction()
+
# Function to get the path type for a variable
# Args:
# path_var[in]: path variable for which the cmake path type is requested
diff --git a/tests/common/PlatformMathTests.cpp b/tests/common/PlatformMathTests.cpp
index 78bd36a..02653f2 100644
--- a/tests/common/PlatformMathTests.cpp
+++ b/tests/common/PlatformMathTests.cpp
@@ -140,7 +140,7 @@ TEST_CASE("Test SqrtF32")
{
/*Test Constants: */
std::vector<float> inputA{0,1,2,9,M_PI};
- uint32_t len = inputA.size();
+ size_t len = inputA.size();
std::vector<float> expectedResult{0, 1, 1.414213562, 3, 1.772453851 };
for (size_t i=0; i < len; i++){
@@ -538,13 +538,13 @@ TEST_CASE("Test FFT32")
expected_result_random};
arm::app::math::FftInstance fftInstance;
/* Iterate over each of the input vectors, calculate FFT and compare with corresponding expected_results vectors */
- for (int j=0; j < input_vectors.size(); j++) {
+ for (size_t j = 0; j < input_vectors.size(); j++) {
uint16_t fftLen = input_vectors[j].size();
arm::app::math::MathUtils::FftInitF32(fftLen, fftInstance);
arm::app::math::MathUtils::FftF32(input_vectors[j], output_vectors[j], fftInstance);
float tolerance = 10e-4;
- for (size_t i=0; i < fftLen/2; i++) {
+ for (size_t i = 0; i < fftLen/2; i++) {
CHECK (output_vectors[j][i] ==
Approx(expected_results_vectors[j][i]).margin(tolerance));
@@ -586,11 +586,11 @@ TEST_CASE("Test ComplexMagnitudeSquaredF32")
/*Test Constants: */
std::vector<float> input
{0.0, 0.0, 0.5, 0.5,1,1};
- int inputLen = input.size();
+ size_t inputLen = input.size();
std::vector<float> expectedResult
{0.0, 0.5, 2,};
- int outputLen = inputLen/2;
+ size_t outputLen = inputLen/2;
std::vector<float>output(outputLen);
/* Pass pointers to input/output vectors as this function over-writes the first half