From 118d8d20cfc1d23f57a27705cd09aace5b4e94b1 Mon Sep 17 00:00:00 2001 From: qiuleilei Date: Mon, 4 Aug 2025 22:01:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=AC=AC=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E4=BE=9D=E8=B5=96cmsis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmake/external_libs/cmsis.cmake | 37 ------------------- cmake/package_micro.cmake | 4 -- mindspore-lite/CMakeLists.txt | 6 --- .../providers/siteai/CMakeLists.txt | 1 - .../micro/cmake/cortex-m/CMakeLists.txt | 1 - .../converter/micro/coder/CMakeLists.txt | 4 -- .../micro/coder/wrapper/CMakeLists.txt | 23 ------------ 7 files changed, 76 deletions(-) delete mode 100644 cmake/external_libs/cmsis.cmake diff --git a/cmake/external_libs/cmsis.cmake b/cmake/external_libs/cmsis.cmake deleted file mode 100644 index d0bed341..00000000 --- a/cmake/external_libs/cmsis.cmake +++ /dev/null @@ -1,37 +0,0 @@ -set(cmsis_pkg_name cmsis) - -if(ENABLE_GITEE OR ENABLE_GITEE_EULER) # Channel GITEE_EULER is NOT supported now, use GITEE instead. - set(REQ_URL "https://gitee.com/mirrors/CMSIS_5/repository/archive/5.7.0.tar.gz") - set(SHA256 "1b4aa6d47c7d3a5032555049b95f4962a700e2022405f863781010606fe7f8f1") -else() - set(REQ_URL "https://github.com/ARM-software/CMSIS_5/archive/5.7.0.tar.gz") - set(SHA256 "1b4aa6d47c7d3a5032555049b95f4962a700e2022405f863781010606fe7f8f1") -endif() - -set(INCLUDE "./") - -mindspore_add_pkg(${cmsis_pkg_name} - VER 5.7.0 - HEAD_ONLY ${INCLUDE} - URL ${REQ_URL} - SHA256 ${SHA256}) - -message("micro get ${cmsis_pkg_name} config hash: ${${cmsis_pkg_name}_CONFIG_HASH}") - -file(GLOB cmsic_children RELATIVE ${_MS_LIB_CACHE} ${_MS_LIB_CACHE}/*) - -foreach(child ${cmsic_children}) - string(FIND "${child}" "${cmsis_pkg_name}" position) - if(NOT "${position}" EQUAL "-1") - file(STRINGS ${_MS_LIB_CACHE}/${child}/options.txt cmsis_configs) - foreach(cmsis_config ${cmsis_configs}) - string(FIND "${cmsis_config}" "${SHA256}" position_sha256) - if(NOT "${position_sha256}" EQUAL "-1") - if(NOT IS_DIRECTORY ${CMAKE_BINARY_DIR}/${cmsis_pkg_name}) - MESSAGE("copy cmsis libaray: ${child} to ${CMAKE_BINARY_DIR}") - file(COPY ${_MS_LIB_CACHE}/${child}/CMSIS DESTINATION ${CMAKE_BINARY_DIR}/${cmsis_pkg_name}) - endif() - endif() - endforeach() - endif() -endforeach() diff --git a/cmake/package_micro.cmake b/cmake/package_micro.cmake index 3f0c5cca..ec071670 100644 --- a/cmake/package_micro.cmake +++ b/cmake/package_micro.cmake @@ -38,8 +38,4 @@ function(__install_micro_codegen) COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") install(DIRECTORY ${MICRO_CMSIS_DIR}/NN/Include DESTINATION ${CODEGEN_ROOT_DIR}/third_party/include/CMSIS/NN COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") - if(MSLITE_DEPS_CMSIS) - install(TARGETS cmsis_nn ARCHIVE DESTINATION ${CODEGEN_ROOT_DIR}/third_party/lib - COMPONENT ${RUNTIME_COMPONENT_NAME}) - endif() endfunction() diff --git a/mindspore-lite/CMakeLists.txt b/mindspore-lite/CMakeLists.txt index c497ee12..2741677a 100644 --- a/mindspore-lite/CMakeLists.txt +++ b/mindspore-lite/CMakeLists.txt @@ -256,8 +256,6 @@ endif() if(MSLITE_TARGET_SITEAI) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/providers/siteai) -else() - set(MSLITE_DEPS_CMSIS on) endif() if(DEFINED ENV{MSLITE_ENABLE_MODEL_ENCRYPTION}) @@ -747,7 +745,6 @@ set(NNACL_DIR ${OPS_DIR}/kernel/cpu/nnacl) if(PLATFORM_MCU) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-incompatible-pointer-types") -# set(MSLITE_DEPS_CMSIS on) add_subdirectory(${NNACL_DIR} build/nnacl) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tools/converter/micro/cmake/cortex-m/ build) include(${TOP_DIR}/cmake/package_lite.cmake) @@ -941,9 +938,6 @@ if(MSLITE_ENABLE_CONVERTER OR MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENA set(MSLITE_DEPS_EIGEN on) endif() -if(NOT MSLITE_TARGET_SITEAI) - set(MSLITE_DEPS_CMSIS on) -endif() if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE) if(NOT MSLITE_TARGET_SITEAI) diff --git a/mindspore-lite/providers/siteai/CMakeLists.txt b/mindspore-lite/providers/siteai/CMakeLists.txt index dccb9942..de5bf109 100644 --- a/mindspore-lite/providers/siteai/CMakeLists.txt +++ b/mindspore-lite/providers/siteai/CMakeLists.txt @@ -7,7 +7,6 @@ set(MSLITE_DEPS_ROBIN_HOOD_HASHING off CACHE INTERNAL "setting MSLITE_DEPS_ROBIN set(MSLITE_DEPS_MKLDNN off CACHE INTERNAL "setting MSLITE_DEPS_MKLDNN value") set(MSLITE_DEPS_LIBEVENT off CACHE INTERNAL "setting MSLITE_DEPS_LIBEVENT value") set(MSLITE_DEPS_OPENSSL off CACHE INTERNAL "setting MSLITE_DEPS_OPENSSL value") -set(MSLITE_DEPS_CMSIS off CACHE INTERNAL "setting MSLITE_DEPS_CMSIS value") ##enable prune simplest cloud inferenc set(MSLITE_SIMPLEST_CLOUD_INFERENCE on CACHE INTERNAL "setting MSLITE_SIMPLEST_CLOUD_INFERENCE value") diff --git a/mindspore-lite/tools/converter/micro/cmake/cortex-m/CMakeLists.txt b/mindspore-lite/tools/converter/micro/cmake/cortex-m/CMakeLists.txt index 07dbb8f6..d5b9fe30 100644 --- a/mindspore-lite/tools/converter/micro/cmake/cortex-m/CMakeLists.txt +++ b/mindspore-lite/tools/converter/micro/cmake/cortex-m/CMakeLists.txt @@ -7,7 +7,6 @@ set(MICRO_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../..) include_directories(${NNACL_DIR}/..) include(${TOP_DIR}/cmake/utils.cmake) -include(${TOP_DIR}/cmake/external_libs/cmsis.cmake) set(CMSIS_DIR ${CMAKE_BINARY_DIR}/cmsis) message("build cmsis kernels") diff --git a/mindspore-lite/tools/converter/micro/coder/CMakeLists.txt b/mindspore-lite/tools/converter/micro/coder/CMakeLists.txt index 3076495c..5ce3ba11 100644 --- a/mindspore-lite/tools/converter/micro/coder/CMakeLists.txt +++ b/mindspore-lite/tools/converter/micro/coder/CMakeLists.txt @@ -20,10 +20,6 @@ include_directories(${LITE_DIR}) #include coder if(NOT MSVC OR NOT WIN32 OR NOT APPLE) - if(MSLITE_DEPS_CMSIS) - message("MSLITE_DEPS_CMSIS enabled") - include(${TOP_DIR}/cmake/external_libs/cmsis.cmake) - endif() include(${MICRO_DIR}/cmake/package_wrapper.cmake) add_subdirectory(wrapper) endif() diff --git a/mindspore-lite/tools/converter/micro/coder/wrapper/CMakeLists.txt b/mindspore-lite/tools/converter/micro/coder/wrapper/CMakeLists.txt index b6317f09..e121aa4c 100644 --- a/mindspore-lite/tools/converter/micro/coder/wrapper/CMakeLists.txt +++ b/mindspore-lite/tools/converter/micro/coder/wrapper/CMakeLists.txt @@ -16,29 +16,6 @@ if(PLATFORM_ARM64) add_compile_definitions(ENABLE_ARM64) elseif(PLATFORM_ARM32) add_compile_definitions(ENABLE_ARM32) -else() - if(MSLITE_DEPS_CMSIS) - message("MSLITE_DEPS_CMSIS enabled") - set(CMSIS_DIR ${CMAKE_BINARY_DIR}/cmsis) - message("build cmsis kernels") - include_directories(${CMSIS_DIR}/CMSIS/Core/Include) - include_directories(${CMSIS_DIR}/CMSIS/DSP/Include) - include_directories(${CMSIS_DIR}/CMSIS/NN/Include) - - file(REMOVE ${CMSIS_DIR}/CMSIS/NN/Source/NNSupportFunctions/arm_q7_to_q15_reordered_no_shift.c) - file(GLOB CMSIS_OPS - ${CMSIS_DIR}/CMSIS/NN/Source/BasicMathFunctions/*.c - ${CMSIS_DIR}/CMSIS/NN/Source/ActivationFunctions/*.c - ${CMSIS_DIR}/CMSIS/NN/Source/ConcatenationFunctions/*.c - ${CMSIS_DIR}/CMSIS/NN/Source/ConvolutionFunctions/*.c - ${CMSIS_DIR}/CMSIS/NN/Source/FullyConnectedFunctions/*.c - ${CMSIS_DIR}/CMSIS/NN/Source/NNSupportFunctions/*.c - ${CMSIS_DIR}/CMSIS/NN/Source/PoolingFunctions/*.c - ${CMSIS_DIR}/CMSIS/NN/Source/ReshapeFunctions/*.c - ${CMSIS_DIR}/CMSIS/NN/Source/SoftmaxFunctions/*.c - ) - add_library(cmsis_nn STATIC ${CMSIS_OPS}) - endif() endif() include(${MICRO_DIR}/cmake/package_wrapper.cmake) -- Gitee