From 48074da09d569104e5d66c73a6d14d9936f9c231 Mon Sep 17 00:00:00 2001 From: zhujingxuan Date: Wed, 7 Apr 2021 15:20:08 +0800 Subject: [PATCH] remove unused code && update doc --- .../generator/component/const_blocks/cmake_lists.cc | 2 ++ mindspore/lite/micro/coder/wrapper/CMakeLists.txt | 11 ++++------- mindspore/lite/micro/example/mobilenetv2/README.md | 2 +- .../lite/micro/example/mobilenetv2/mobilenetv2.sh | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/mindspore/lite/micro/coder/generator/component/const_blocks/cmake_lists.cc b/mindspore/lite/micro/coder/generator/component/const_blocks/cmake_lists.cc index cce75ace0d..7a44fe7456 100644 --- a/mindspore/lite/micro/coder/generator/component/const_blocks/cmake_lists.cc +++ b/mindspore/lite/micro/coder/generator/component/const_blocks/cmake_lists.cc @@ -46,6 +46,7 @@ endif() if(PLATFORM_ARM32) add_compile_definitions(ENABLE_ARM32) + add_definitions(-mfloat-abi=softfp -mfpu=neon) endif() set(CMAKE_C_FLAGS "${CMAKE_ENABLE_C99} ${CMAKE_C_FLAGS}") @@ -123,6 +124,7 @@ endif() if(PLATFORM_ARM32) add_compile_definitions(ENABLE_ARM32) + add_definitions(-mfloat-abi=softfp -mfpu=neon) endif() set(CMAKE_C_FLAGS "${CMAKE_ENABLE_C99} ${CMAKE_C_FLAGS}") diff --git a/mindspore/lite/micro/coder/wrapper/CMakeLists.txt b/mindspore/lite/micro/coder/wrapper/CMakeLists.txt index b494719082..1961a8caa4 100644 --- a/mindspore/lite/micro/coder/wrapper/CMakeLists.txt +++ b/mindspore/lite/micro/coder/wrapper/CMakeLists.txt @@ -6,18 +6,15 @@ else() string(REPLACE "-g" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") endif() -include_directories(${LITE_DIR}) -set(OPERATOR_LIBRARY_PATH ${CMAKE_BINARY_DIR}/operator_library) -set(HEADER_PATH "${OPERATOR_LIBRARY_PATH}/include") +if(PLATFORM_ARM64 OR PLATFORM_ARM32) + add_compile_definitions(ENABLE_NEON) + add_compile_definitions(ENABLE_ARM) +endif() if(PLATFORM_ARM64) add_compile_definitions(ENABLE_ARM64) - add_compile_definitions(ENABLE_NEON) - add_compile_definitions(ENABLE_ARM) elseif(PLATFORM_ARM32) add_compile_definitions(ENABLE_ARM32) - add_compile_definitions(ENABLE_NEON) - add_compile_definitions(ENABLE_ARM) else() include(${MICRO_DIR}/cmake/package_cmsis.cmake) add_library(cmsis_nn STATIC ${CMSIS_OPS}) diff --git a/mindspore/lite/micro/example/mobilenetv2/README.md b/mindspore/lite/micro/example/mobilenetv2/README.md index 50bc6edc0f..a358f95c3d 100755 --- a/mindspore/lite/micro/example/mobilenetv2/README.md +++ b/mindspore/lite/micro/example/mobilenetv2/README.md @@ -116,7 +116,7 @@ cmake -DCMAKE_BUILD_TYPE=Release \ -DANDROID_ABI="armeabi-v7a" \ -DANDROID_TOOLCHAIN_NAME="clang" \ -DANDROID_NATIVE_API_LEVEL="19" \ --DMICRO_BUILD_ARM32=ON \ +-DPLATFORM_ARM32=ON \ -DPKG_PATH={path to}/mindspore-lite-{version}-inference-android-{arch} .. make ``` diff --git a/mindspore/lite/micro/example/mobilenetv2/mobilenetv2.sh b/mindspore/lite/micro/example/mobilenetv2/mobilenetv2.sh index 3036ff8c0b..3bf79ca314 100644 --- a/mindspore/lite/micro/example/mobilenetv2/mobilenetv2.sh +++ b/mindspore/lite/micro/example/mobilenetv2/mobilenetv2.sh @@ -138,7 +138,7 @@ else -DANDROID_ABI="armeabi-v7a" \ -DANDROID_TOOLCHAIN_NAME="clang" \ -DANDROID_NATIVE_API_LEVEL="19" \ - -DMICRO_BUILD_ARM32=ON \ + -DPLATFORM_ARM32=ON \ -DPKG_PATH=${PKG_PATH} ${BENCHMARK_PATH} fi make