From df7e37ee18022fcd6d9fb034b0c52f7e289b9665 Mon Sep 17 00:00:00 2001 From: yangjie159 Date: Fri, 2 Apr 2021 14:44:52 +0800 Subject: [PATCH] rename-pkg_name-for-micro --- cmake/package_lite.cmake | 66 ++++++++-- .../lite/micro/cmake/package_cmsis.cmake | 37 +++--- .../lite/micro/cmake/package_wrapper.cmake | 6 +- mindspore/lite/micro/coder/CMakeLists.txt | 2 +- .../component/const_blocks/cmake_lists.cc | 40 ++++-- .../coder/operator_library/CMakeLists.txt | 120 ------------------ .../lite/micro/coder/wrapper/CMakeLists.txt | 29 +++++ .../wrapper/base/common_wrapper.c | 0 .../wrapper/base/common_wrapper.h | 0 .../detection_post_process_base_wrapper.c | 0 .../detection_post_process_base_wrapper.h | 0 .../wrapper/base/optimize_handler_wrapper.c | 0 .../wrapper/base/optimize_handler_wrapper.h | 0 .../fp32/dequant_int8_to_fp32_wrapper.c | 0 .../fp32/dequant_int8_to_fp32_wrapper.h | 0 .../wrapper/fp32/matmul_fp32_wrapper.c | 0 .../wrapper/fp32/matmul_fp32_wrapper.h | 0 .../wrapper/int8/add_int8_wrapper.c | 0 .../wrapper/int8/add_int8_wrapper.h | 0 .../wrapper/int8/batchnorm_int8_wrapper.c | 0 .../wrapper/int8/batchnorm_int8_wrapper.h | 0 .../wrapper/int8/concat_int8_wrapper.c | 0 .../wrapper/int8/concat_int8_wrapper.h | 0 .../wrapper/int8/conv1x1_init_int8_wrapper.c | 0 .../wrapper/int8/conv1x1_init_int8_wrapper.h | 0 .../wrapper/int8/conv1x1_run_int8_wrapper.c | 0 .../wrapper/int8/conv1x1_run_int8_wrapper.h | 0 .../wrapper/int8/conv_init_int8_wrapper.c | 0 .../wrapper/int8/conv_init_int8_wrapper.h | 0 .../int8/convolution_depthwise_int8_wrapper.c | 0 .../int8/convolution_depthwise_int8_wrapper.h | 0 .../wrapper/int8/convolution_int8_wrapper.c | 0 .../wrapper/int8/convolution_int8_wrapper.h | 0 .../wrapper/int8/matmul_int8_wrapper.c | 0 .../wrapper/int8/matmul_int8_wrapper.h | 0 .../wrapper/int8/resize_int8_wrapper.c | 0 .../wrapper/int8/resize_int8_wrapper.h | 0 .../wrapper/int8/slice_int8_wrapper.c | 0 .../wrapper/int8/slice_int8_wrapper.h | 0 .../mnist_stm32f746/CMakeLists.txt | 10 +- .../mnist_stm32f746/src/CMakeLists.txt | 10 +- .../micro/example/mnist_x86/CMakeLists.txt | 10 +- .../example/mnist_x86/src/CMakeLists.txt | 10 +- .../lite/micro/example/mobilenetv2/README.md | 2 +- .../micro/example/mobilenetv2/mobilenetv2.sh | 2 +- 45 files changed, 152 insertions(+), 192 deletions(-) delete mode 100644 mindspore/lite/micro/coder/operator_library/CMakeLists.txt create mode 100644 mindspore/lite/micro/coder/wrapper/CMakeLists.txt rename mindspore/lite/micro/coder/{operator_library => }/wrapper/base/common_wrapper.c (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/base/common_wrapper.h (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/base/detection_post_process_base_wrapper.c (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/base/detection_post_process_base_wrapper.h (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/base/optimize_handler_wrapper.c (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/base/optimize_handler_wrapper.h (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/fp32/dequant_int8_to_fp32_wrapper.c (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/fp32/dequant_int8_to_fp32_wrapper.h (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/fp32/matmul_fp32_wrapper.c (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/fp32/matmul_fp32_wrapper.h (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/add_int8_wrapper.c (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/add_int8_wrapper.h (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/batchnorm_int8_wrapper.c (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/batchnorm_int8_wrapper.h (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/concat_int8_wrapper.c (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/concat_int8_wrapper.h (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/conv1x1_init_int8_wrapper.c (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/conv1x1_init_int8_wrapper.h (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/conv1x1_run_int8_wrapper.c (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/conv1x1_run_int8_wrapper.h (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/conv_init_int8_wrapper.c (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/conv_init_int8_wrapper.h (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/convolution_depthwise_int8_wrapper.c (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/convolution_depthwise_int8_wrapper.h (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/convolution_int8_wrapper.c (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/convolution_int8_wrapper.h (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/matmul_int8_wrapper.c (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/matmul_int8_wrapper.h (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/resize_int8_wrapper.c (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/resize_int8_wrapper.h (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/slice_int8_wrapper.c (100%) rename mindspore/lite/micro/coder/{operator_library => }/wrapper/int8/slice_int8_wrapper.h (100%) diff --git a/cmake/package_lite.cmake b/cmake/package_lite.cmake index 57d5333ae7..4110d04cd3 100644 --- a/cmake/package_lite.cmake +++ b/cmake/package_lite.cmake @@ -30,25 +30,25 @@ endif() if(BUILD_MINDDATA STREQUAL "full") install(DIRECTORY ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/liteapi/include/ DESTINATION - ${MIND_DATA_INC_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME}) + ${MIND_DATA_INC_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME}) if(PLATFORM_ARM64) file(GLOB JPEGTURBO_LIB_LIST ${jpeg_turbo_LIBPATH}/*.so) install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so - DESTINATION ${MIND_DATA_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME}) + DESTINATION ${MIND_DATA_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME}) install(FILES ${JPEGTURBO_LIB_LIST} DESTINATION ${TURBO_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME}) elseif(PLATFORM_ARM32) file(GLOB JPEGTURBO_LIB_LIST ${jpeg_turbo_LIBPATH}/*.so) install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION - ${MIND_DATA_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME}) + ${MIND_DATA_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME}) install(FILES ${JPEGTURBO_LIB_LIST} DESTINATION ${TURBO_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME}) else() install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION - ${MIND_DATA_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME}) + ${MIND_DATA_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME}) install(FILES ${jpeg_turbo_LIBPATH}/libjpeg.so.62.3.0 DESTINATION ${TURBO_DIR}/lib - RENAME libjpeg.so.62 COMPONENT ${RUNTIME_COMPONENT_NAME}) + RENAME libjpeg.so.62 COMPONENT ${RUNTIME_COMPONENT_NAME}) install(FILES ${jpeg_turbo_LIBPATH}/libturbojpeg.so.0.2.0 DESTINATION ${TURBO_DIR}/lib - RENAME libturbojpeg.so.0 COMPONENT ${RUNTIME_COMPONENT_NAME}) + RENAME libturbojpeg.so.0 COMPONENT ${RUNTIME_COMPONENT_NAME}) endif() endif() @@ -68,7 +68,7 @@ if(BUILD_MINDDATA STREQUAL "wrapper") else() install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${MIND_DATA_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME}) - install(FILES ${jpeg_turbo_LIBPATH}/libjpeg.so.62.3.0 DESTINATION ${TURBO_DIR}/lib RENAME libjpeg.so.62 + install(FILES ${jpeg_turbo_LIBPATH}/libjpeg.so.62.3.0 DESTINATION ${TURBO_DIR}/lib RENAME libjpeg.so.62 COMPONENT ${RUNTIME_COMPONENT_NAME}) install(FILES ${jpeg_turbo_LIBPATH}/libturbojpeg.so.0.2.0 DESTINATION ${TURBO_DIR}/lib RENAME libturbojpeg.so.0 COMPONENT ${RUNTIME_COMPONENT_NAME}) @@ -153,8 +153,19 @@ if(PLATFORM_ARM64) COMPONENT ${RUNTIME_COMPONENT_NAME}) install(DIRECTORY ${TOP_DIR}/include/api/ DESTINATION ${RUNTIME_INC_DIR}/api COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "ops*" EXCLUDE) - install(DIRECTORY ${TOP_DIR}/mindspore/lite/build/operator_library DESTINATION ${CODEGEN_ROOT_DIR} - COMPONENT ${RUNTIME_COMPONENT_NAME}) + file(GLOB NNACL_FILES GLOB ${TOP_DIR}/mindspore/lite/nnacl/*.h) + install(FILES ${NNACL_FILES} DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl COMPONENT ${RUNTIME_COMPONENT_NAME}) + install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/base DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/int8 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/fp32 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/intrinsics DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${TOP_DIR}/mindspore/lite/micro/coder/wrapper DESTINATION ${CODEGEN_ROOT_DIR}/include + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(TARGETS wrapper ARCHIVE DESTINATION ${CODEGEN_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME}) if(ENABLE_TOOLS) install(TARGETS ${BENCHMARK_NAME} RUNTIME DESTINATION ${BENCHMARK_ROOT_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME}) endif() @@ -174,8 +185,19 @@ elseif(PLATFORM_ARM32) COMPONENT ${RUNTIME_COMPONENT_NAME}) install(DIRECTORY ${TOP_DIR}/include/api/ DESTINATION ${RUNTIME_INC_DIR}/api COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "ops*" EXCLUDE) - install(DIRECTORY ${TOP_DIR}/mindspore/lite/build/operator_library DESTINATION ${CODEGEN_ROOT_DIR} - COMPONENT ${RUNTIME_COMPONENT_NAME}) + file(GLOB NNACL_FILES GLOB ${TOP_DIR}/mindspore/lite/nnacl/*.h) + install(FILES ${NNACL_FILES} DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl COMPONENT ${RUNTIME_COMPONENT_NAME}) + install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/base DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/int8 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/fp32 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/intrinsics DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${TOP_DIR}/mindspore/lite/micro/coder/wrapper DESTINATION ${CODEGEN_ROOT_DIR}/include + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(TARGETS wrapper ARCHIVE DESTINATION ${CODEGEN_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME}) if(ENABLE_TOOLS) install(TARGETS ${BENCHMARK_NAME} RUNTIME DESTINATION ${BENCHMARK_ROOT_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME}) endif() @@ -240,7 +262,27 @@ else() install(FILES ${glog_LIBPATH}/libglog.so.0.4.0 DESTINATION ${CONVERTER_ROOT_DIR}/third_party/glog/lib RENAME libglog.so.0 COMPONENT ${RUNTIME_COMPONENT_NAME}) - install(DIRECTORY ${TOP_DIR}/mindspore/lite/build/operator_library DESTINATION ${CODEGEN_ROOT_DIR} + file(GLOB NNACL_FILES GLOB ${TOP_DIR}/mindspore/lite/nnacl/*.h) + install(FILES ${NNACL_FILES} DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl COMPONENT ${RUNTIME_COMPONENT_NAME}) + install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/base DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/int8 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/fp32 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/intrinsics DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${TOP_DIR}/mindspore/lite/micro/coder/wrapper DESTINATION ${CODEGEN_ROOT_DIR}/include + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(TARGETS wrapper ARCHIVE DESTINATION ${CODEGEN_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME}) + set(MICRO_CMSIS_DIR ${CMAKE_BINARY_DIR}/cmsis/CMSIS) + install(DIRECTORY ${MICRO_CMSIS_DIR}/Core/Include DESTINATION ${CODEGEN_ROOT_DIR}/third_party/include/CMSIS/Core + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${MICRO_CMSIS_DIR}/DSP/Include DESTINATION ${CODEGEN_ROOT_DIR}/third_party/include/CMSIS/DSP + 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") + install(TARGETS cmsis_nn ARCHIVE DESTINATION ${CODEGEN_ROOT_DIR}/third_party/lib COMPONENT ${RUNTIME_COMPONENT_NAME}) install(TARGETS codegen RUNTIME DESTINATION ${CODEGEN_ROOT_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME}) endif() diff --git a/mindspore/lite/micro/cmake/package_cmsis.cmake b/mindspore/lite/micro/cmake/package_cmsis.cmake index eaed65def9..283b64abec 100644 --- a/mindspore/lite/micro/cmake/package_cmsis.cmake +++ b/mindspore/lite/micro/cmake/package_cmsis.cmake @@ -1,21 +1,20 @@ -set(CMSIS_DIR ${LITE_DIR}/micro/build/cmsis) -if(MICRO_CMSIS_X86) - 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) +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(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 + ) - 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 - ) -endif() diff --git a/mindspore/lite/micro/cmake/package_wrapper.cmake b/mindspore/lite/micro/cmake/package_wrapper.cmake index ce455fe83f..4ba639d700 100644 --- a/mindspore/lite/micro/cmake/package_wrapper.cmake +++ b/mindspore/lite/micro/cmake/package_wrapper.cmake @@ -1,7 +1,5 @@ -include_directories(${LITE_DIR}/micro/coder/operator_library) -set(WRAPPER_DIR ${LITE_DIR}/micro/coder/operator_library/wrapper/) - - +include_directories(${LITE_DIR}/micro/coder/) +set(WRAPPER_DIR ${LITE_DIR}/micro/coder/wrapper/) set(WRAPPER_SRC ${WRAPPER_DIR}/base/common_wrapper.c diff --git a/mindspore/lite/micro/coder/CMakeLists.txt b/mindspore/lite/micro/coder/CMakeLists.txt index efa732d194..3463649c78 100644 --- a/mindspore/lite/micro/coder/CMakeLists.txt +++ b/mindspore/lite/micro/coder/CMakeLists.txt @@ -24,7 +24,7 @@ include_directories(${MICRO_DIR}) include(${TOP_DIR}/cmake/external_libs/cmsis.cmake) include(${MICRO_DIR}/cmake/file_list.cmake) include(${MICRO_DIR}/cmake/package_wrapper.cmake) -add_subdirectory(operator_library) +add_subdirectory(wrapper) if(ENABLE_CONVERTER) add_executable(codegen main.cc ${FILE_SET}) 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 e4af9740f0..cce75ace0d 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 @@ -30,23 +30,22 @@ get_filename_component(PKG_PATH ${PKG_PATH} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_BI set(HEADER_PATH ${PKG_PATH}/inference) -option(MICRO_BUILD_ARM64 "build android arm64" OFF) -option(MICRO_BUILD_ARM32A "build android arm32" OFF) +option(PLATFORM_ARM64 "build android arm64" OFF) +option(PLATFORM_ARM32 "build android arm32" OFF) add_compile_definitions(NOT_USE_STL) -if(MICRO_BUILD_ARM64 OR MICRO_BUILD_ARM32A) +if(PLATFORM_ARM64 OR PLATFORM_ARM32) add_compile_definitions(ENABLE_NEON) add_compile_definitions(ENABLE_ARM) endif() -if(MICRO_BUILD_ARM64) +if(PLATFORM_ARM64) add_compile_definitions(ENABLE_ARM64) endif() -if(MICRO_BUILD_ARM32A) +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}") @@ -88,8 +87,9 @@ endif() get_filename_component(PKG_PATH ${PKG_PATH} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_BINARY_DIR}) -set(OP_LIB ${PKG_PATH}/tools/codegen/operator_library/lib/libops.a) -set(OP_HEADER_PATH ${PKG_PATH}/tools/codegen/operator_library/include) +set(OP_LIB ${PKG_PATH}/inference/lib/libmindspore-lite.a) +set(WRAPPER_LIB ${PKG_PATH}/tools/codegen/lib/libwrapper.a) +set(OP_HEADER_PATH ${PKG_PATH}/tools/codegen/include) set(HEADER_PATH ${PKG_PATH}/inference) message("operator lib path: ${OP_LIB}") @@ -100,23 +100,29 @@ add_compile_definitions(NOT_USE_STL) include_directories(${OP_HEADER_PATH}) include_directories(${HEADER_PATH}) +if(NOT PLATFORM_ARM32 AND NOT PLATFORM_ARM64) + include_directories(${PKG_PATH}/tools/codegen/third_party/include) + include_directories(${PKG_PATH}/tools/codegen/third_party/include/CMSIS/Core/Include) + include_directories(${PKG_PATH}/tools/codegen/third_party/include/CMSIS/DSP/Include) + include_directories(${PKG_PATH}/tools/codegen/third_party/include/CMSIS/NN/Include) +endif() + include(net.cmake) -option(MICRO_BUILD_ARM64 "build android arm64" OFF) -option(MICRO_BUILD_ARM32A "build android arm32" OFF) +option(PLATFORM_ARM64 "build android arm64" OFF) +option(PLATFORM_ARM32 "build android arm32" OFF) -if(MICRO_BUILD_ARM64 OR MICRO_BUILD_ARM32A) +if(PLATFORM_ARM64 OR PLATFORM_ARM32) add_compile_definitions(ENABLE_NEON) add_compile_definitions(ENABLE_ARM) endif() -if(MICRO_BUILD_ARM64) +if(PLATFORM_ARM64) add_compile_definitions(ENABLE_ARM64) endif() -if(MICRO_BUILD_ARM32A) +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}") @@ -143,11 +149,17 @@ function(create_library) COMMAND rm -rf tmp COMMAND mkdir tmp COMMAND cd tmp && ar -x ${OP_LIB} + COMMAND cd tmp && ar -x ${WRAPPER_LIB} COMMAND echo "raw static library ${library_name} size:" COMMAND ls -lh ${library_name} COMMAND mv ${library_name} ./tmp && cd tmp && ar -x ${library_name} COMMENT "unzip raw static library ${library_name}" ) + if(NOT PLATFORM_ARM32 AND NOT PLATFORM_ARM64) + set(CMSIS_LIB ${PKG_PATH}/tools/codegen/third_party/lib/libcmsis_nn.a) + add_custom_command(TARGET net POST_BUILD COMMAND cd tmp && ar -x ${CMSIS_LIB}) + endif() + foreach(object_file ${OP_SRC}) add_custom_command(TARGET net POST_BUILD COMMAND mv ./tmp/${object_file} .) endforeach() diff --git a/mindspore/lite/micro/coder/operator_library/CMakeLists.txt b/mindspore/lite/micro/coder/operator_library/CMakeLists.txt deleted file mode 100644 index 16a44f0edb..0000000000 --- a/mindspore/lite/micro/coder/operator_library/CMakeLists.txt +++ /dev/null @@ -1,120 +0,0 @@ -option(MICRO_CMSIS_X86 "build for CMSIS x86" ON) -option(ENABLE_ASAN "enable asan" OFF) -option(CMAKE_BUILD_TYPE "debug or release" Debug) - -if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") - set(DEBUG_MODE "Debug") -endif() - -set(CMAKE_C_FLAGS "${CMAKE_ENABLE_C99} ${CMAKE_C_FLAGS}") -if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") - set(CMAKE_C_FLAGS "-DDebug -g -fvisibility=default ${CMAKE_C_FLAGS}") -else() - set(CMAKE_C_FLAGS "-fPIC -fPIE -Werror -O3 -fstack-protector-strong -fomit-frame-pointer ${CMAKE_C_FLAGS}") - set(CMAKE_C_FLAGS_Release "${CMAKE_C_FLAGS_Release} -O3 -ffunction-sections -fdata-sections") - string(REPLACE "-g" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") -endif() - -if(ENABLE_ASAN) - set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} ${OPTION_CXX_FLAGS} -lasan") -endif() - -include_directories(${LITE_DIR}) -set(MICRO_CMAKE_PATH ${MICRO_DIR}/cmake) -set(OPERATOR_LIBRARY_PATH ${CMAKE_BINARY_DIR}/operator_library) -set(HEADER_PATH "${OPERATOR_LIBRARY_PATH}/include") -set(LIB_PATH "${OPERATOR_LIBRARY_PATH}/lib") -set(NNACL_DIR ${LITE_DIR}/nnacl) - -message("===========>start to pack operators' head file") -file(REMOVE_RECURSE ${OPERATOR_LIBRARY_PATH}) -file(MAKE_DIRECTORY ${OPERATOR_LIBRARY_PATH}) -file(GLOB NNACL_FILES GLOB ${LITE_DIR}/nnacl/*.h) -file(COPY ${NNACL_FILES} DESTINATION ${HEADER_PATH}/nnacl/) -file(COPY ${LITE_DIR}/nnacl/base - ${LITE_DIR}/nnacl/int8 - ${LITE_DIR}/nnacl/fp32 - ${LITE_DIR}/nnacl/intrinsics - DESTINATION ${HEADER_PATH}/nnacl FILES_MATCHING PATTERN "*.h") -file(COPY ${MICRO_DIR}/coder/operator_library/wrapper DESTINATION ${HEADER_PATH} FILES_MATCHING PATTERN "*.h") -file(COPY ${CMAKE_BINARY_DIR}/cmsis/CMSIS/Core/Include - ${CMAKE_BINARY_DIR}/cmsis/CMSIS/DSP/Include - ${CMAKE_BINARY_DIR}/cmsis/CMSIS/NN/Include - DESTINATION ${HEADER_PATH}/CMSIS/Core) - -if(PLATFORM_ARM64) - add_compile_definitions(ENABLE_ARM64) -endif() - -if(PLATFORM_ARM32) - add_compile_definitions(ENABLE_ARM32) - add_definitions(-mfloat-abi=softfp -mfpu=neon) -endif() - -if(PLATFORM_ARM64 OR PLATFORM_ARM32) - add_compile_definitions(ENABLE_NEON) - add_compile_definitions(ENABLE_ARM) -endif() - -file(GLOB KERNEL_SRC - ${NNACL_DIR}/*.c - ${NNACL_DIR}/base/*.c - ${NNACL_DIR}/fp32/*.c - ${NNACL_DIR}/int8/*.c - ) - -if(PLATFORM_ARM64) - file(GLOB ASSEMBLY_SRC ${NNACL_DIR}/assembly/arm64/*.S) - set_property(SOURCE ${ASSEMBLY_SRC} PROPERTY LANGUAGE C) -endif() - -if(PLATFORM_ARM32) - file(GLOB ASSEMBLY_SRC ${NNACL_DIR}/assembly/arm32/*.S) - set_property(SOURCE ${ASSEMBLY_SRC} PROPERTY LANGUAGE C) -endif() - -set(NNACL_OPS ${KERNEL_SRC} ${ASSEMBLY_SRC}) -set(RUNTIME_SRC ${LITE_DIR}/src/runtime/thread_pool.c) - -include(${MICRO_CMAKE_PATH}/package_cmsis.cmake) -include(${MICRO_CMAKE_PATH}/package_wrapper.cmake) - -list(APPEND OP_FILES ${NNACL_OPS} ${WRAPPER_SRC} ${RUNTIME_SRC}) - -if(NOT PLATFORM_ARM64 AND NOT PLATFORM_ARM32) - list(APPEND OP_FILES ${CMSIS_OPS}) -endif() - - -# generate static library -add_library(ops STATIC ${OP_FILES}) - -function(create_library) - string(CONCAT library_name "lib" ops ".a") - string(CONCAT opt_name "lib" opt_ops ".a") - set(ANDROID_AR - ${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar) - add_custom_command(TARGET ops - POST_BUILD - COMMAND rm -rf tmp - COMMAND mkdir tmp - COMMAND mv ${opt_name} ./tmp && cd ./tmp && ${ANDROID_AR} -x ${opt_name} - COMMAND mv ${library_name} ./tmp && cd ./tmp && ${ANDROID_AR} -x ${library_name} - COMMENT "unzip raw static library ${library_name}" - COMMAND ${ANDROID_AR} cr ${library_name} ./tmp/*.o - COMMAND rm -rf tmp - COMMENT "generate specified static library ${library_name}" - ) -endfunction() - -if(PLATFORM_ARM64) - file(GLOB OPT_SRC ${NNACL_DIR}/assembly/opt/*.S) - set_property(SOURCE ${OPT_SRC} PROPERTY LANGUAGE C) - add_library(opt_ops STATIC ${OPT_SRC}) - - add_dependencies(ops opt_ops) - set_target_properties(opt_ops PROPERTIES COMPILE_FLAGS -march=armv8.2-a+dotprod) - create_library() -endif() - -install(TARGETS ops ARCHIVE DESTINATION ${LIB_PATH}) diff --git a/mindspore/lite/micro/coder/wrapper/CMakeLists.txt b/mindspore/lite/micro/coder/wrapper/CMakeLists.txt new file mode 100644 index 0000000000..b494719082 --- /dev/null +++ b/mindspore/lite/micro/coder/wrapper/CMakeLists.txt @@ -0,0 +1,29 @@ +if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + set(CMAKE_C_FLAGS "-DDebug -g -fvisibility=default ${CMAKE_C_FLAGS}") +else() + set(CMAKE_C_FLAGS "-fPIC -fPIE -Werror -O3 -fstack-protector-strong -fomit-frame-pointer ${CMAKE_C_FLAGS}") + set(CMAKE_C_FLAGS_Release "${CMAKE_C_FLAGS_Release} -O3 -ffunction-sections -fdata-sections") + 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) + 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}) +endif() + +include(${MICRO_DIR}/cmake/package_wrapper.cmake) + +# generate static library +add_library(wrapper STATIC ${WRAPPER_SRC}) diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/base/common_wrapper.c b/mindspore/lite/micro/coder/wrapper/base/common_wrapper.c similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/base/common_wrapper.c rename to mindspore/lite/micro/coder/wrapper/base/common_wrapper.c diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/base/common_wrapper.h b/mindspore/lite/micro/coder/wrapper/base/common_wrapper.h similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/base/common_wrapper.h rename to mindspore/lite/micro/coder/wrapper/base/common_wrapper.h diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/base/detection_post_process_base_wrapper.c b/mindspore/lite/micro/coder/wrapper/base/detection_post_process_base_wrapper.c similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/base/detection_post_process_base_wrapper.c rename to mindspore/lite/micro/coder/wrapper/base/detection_post_process_base_wrapper.c diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/base/detection_post_process_base_wrapper.h b/mindspore/lite/micro/coder/wrapper/base/detection_post_process_base_wrapper.h similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/base/detection_post_process_base_wrapper.h rename to mindspore/lite/micro/coder/wrapper/base/detection_post_process_base_wrapper.h diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/base/optimize_handler_wrapper.c b/mindspore/lite/micro/coder/wrapper/base/optimize_handler_wrapper.c similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/base/optimize_handler_wrapper.c rename to mindspore/lite/micro/coder/wrapper/base/optimize_handler_wrapper.c diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/base/optimize_handler_wrapper.h b/mindspore/lite/micro/coder/wrapper/base/optimize_handler_wrapper.h similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/base/optimize_handler_wrapper.h rename to mindspore/lite/micro/coder/wrapper/base/optimize_handler_wrapper.h diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/fp32/dequant_int8_to_fp32_wrapper.c b/mindspore/lite/micro/coder/wrapper/fp32/dequant_int8_to_fp32_wrapper.c similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/fp32/dequant_int8_to_fp32_wrapper.c rename to mindspore/lite/micro/coder/wrapper/fp32/dequant_int8_to_fp32_wrapper.c diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/fp32/dequant_int8_to_fp32_wrapper.h b/mindspore/lite/micro/coder/wrapper/fp32/dequant_int8_to_fp32_wrapper.h similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/fp32/dequant_int8_to_fp32_wrapper.h rename to mindspore/lite/micro/coder/wrapper/fp32/dequant_int8_to_fp32_wrapper.h diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/fp32/matmul_fp32_wrapper.c b/mindspore/lite/micro/coder/wrapper/fp32/matmul_fp32_wrapper.c similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/fp32/matmul_fp32_wrapper.c rename to mindspore/lite/micro/coder/wrapper/fp32/matmul_fp32_wrapper.c diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/fp32/matmul_fp32_wrapper.h b/mindspore/lite/micro/coder/wrapper/fp32/matmul_fp32_wrapper.h similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/fp32/matmul_fp32_wrapper.h rename to mindspore/lite/micro/coder/wrapper/fp32/matmul_fp32_wrapper.h diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/add_int8_wrapper.c b/mindspore/lite/micro/coder/wrapper/int8/add_int8_wrapper.c similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/add_int8_wrapper.c rename to mindspore/lite/micro/coder/wrapper/int8/add_int8_wrapper.c diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/add_int8_wrapper.h b/mindspore/lite/micro/coder/wrapper/int8/add_int8_wrapper.h similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/add_int8_wrapper.h rename to mindspore/lite/micro/coder/wrapper/int8/add_int8_wrapper.h diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/batchnorm_int8_wrapper.c b/mindspore/lite/micro/coder/wrapper/int8/batchnorm_int8_wrapper.c similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/batchnorm_int8_wrapper.c rename to mindspore/lite/micro/coder/wrapper/int8/batchnorm_int8_wrapper.c diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/batchnorm_int8_wrapper.h b/mindspore/lite/micro/coder/wrapper/int8/batchnorm_int8_wrapper.h similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/batchnorm_int8_wrapper.h rename to mindspore/lite/micro/coder/wrapper/int8/batchnorm_int8_wrapper.h diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/concat_int8_wrapper.c b/mindspore/lite/micro/coder/wrapper/int8/concat_int8_wrapper.c similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/concat_int8_wrapper.c rename to mindspore/lite/micro/coder/wrapper/int8/concat_int8_wrapper.c diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/concat_int8_wrapper.h b/mindspore/lite/micro/coder/wrapper/int8/concat_int8_wrapper.h similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/concat_int8_wrapper.h rename to mindspore/lite/micro/coder/wrapper/int8/concat_int8_wrapper.h diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/conv1x1_init_int8_wrapper.c b/mindspore/lite/micro/coder/wrapper/int8/conv1x1_init_int8_wrapper.c similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/conv1x1_init_int8_wrapper.c rename to mindspore/lite/micro/coder/wrapper/int8/conv1x1_init_int8_wrapper.c diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/conv1x1_init_int8_wrapper.h b/mindspore/lite/micro/coder/wrapper/int8/conv1x1_init_int8_wrapper.h similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/conv1x1_init_int8_wrapper.h rename to mindspore/lite/micro/coder/wrapper/int8/conv1x1_init_int8_wrapper.h diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/conv1x1_run_int8_wrapper.c b/mindspore/lite/micro/coder/wrapper/int8/conv1x1_run_int8_wrapper.c similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/conv1x1_run_int8_wrapper.c rename to mindspore/lite/micro/coder/wrapper/int8/conv1x1_run_int8_wrapper.c diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/conv1x1_run_int8_wrapper.h b/mindspore/lite/micro/coder/wrapper/int8/conv1x1_run_int8_wrapper.h similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/conv1x1_run_int8_wrapper.h rename to mindspore/lite/micro/coder/wrapper/int8/conv1x1_run_int8_wrapper.h diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/conv_init_int8_wrapper.c b/mindspore/lite/micro/coder/wrapper/int8/conv_init_int8_wrapper.c similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/conv_init_int8_wrapper.c rename to mindspore/lite/micro/coder/wrapper/int8/conv_init_int8_wrapper.c diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/conv_init_int8_wrapper.h b/mindspore/lite/micro/coder/wrapper/int8/conv_init_int8_wrapper.h similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/conv_init_int8_wrapper.h rename to mindspore/lite/micro/coder/wrapper/int8/conv_init_int8_wrapper.h diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/convolution_depthwise_int8_wrapper.c b/mindspore/lite/micro/coder/wrapper/int8/convolution_depthwise_int8_wrapper.c similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/convolution_depthwise_int8_wrapper.c rename to mindspore/lite/micro/coder/wrapper/int8/convolution_depthwise_int8_wrapper.c diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/convolution_depthwise_int8_wrapper.h b/mindspore/lite/micro/coder/wrapper/int8/convolution_depthwise_int8_wrapper.h similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/convolution_depthwise_int8_wrapper.h rename to mindspore/lite/micro/coder/wrapper/int8/convolution_depthwise_int8_wrapper.h diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/convolution_int8_wrapper.c b/mindspore/lite/micro/coder/wrapper/int8/convolution_int8_wrapper.c similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/convolution_int8_wrapper.c rename to mindspore/lite/micro/coder/wrapper/int8/convolution_int8_wrapper.c diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/convolution_int8_wrapper.h b/mindspore/lite/micro/coder/wrapper/int8/convolution_int8_wrapper.h similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/convolution_int8_wrapper.h rename to mindspore/lite/micro/coder/wrapper/int8/convolution_int8_wrapper.h diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/matmul_int8_wrapper.c b/mindspore/lite/micro/coder/wrapper/int8/matmul_int8_wrapper.c similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/matmul_int8_wrapper.c rename to mindspore/lite/micro/coder/wrapper/int8/matmul_int8_wrapper.c diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/matmul_int8_wrapper.h b/mindspore/lite/micro/coder/wrapper/int8/matmul_int8_wrapper.h similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/matmul_int8_wrapper.h rename to mindspore/lite/micro/coder/wrapper/int8/matmul_int8_wrapper.h diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/resize_int8_wrapper.c b/mindspore/lite/micro/coder/wrapper/int8/resize_int8_wrapper.c similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/resize_int8_wrapper.c rename to mindspore/lite/micro/coder/wrapper/int8/resize_int8_wrapper.c diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/resize_int8_wrapper.h b/mindspore/lite/micro/coder/wrapper/int8/resize_int8_wrapper.h similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/resize_int8_wrapper.h rename to mindspore/lite/micro/coder/wrapper/int8/resize_int8_wrapper.h diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/slice_int8_wrapper.c b/mindspore/lite/micro/coder/wrapper/int8/slice_int8_wrapper.c similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/slice_int8_wrapper.c rename to mindspore/lite/micro/coder/wrapper/int8/slice_int8_wrapper.c diff --git a/mindspore/lite/micro/coder/operator_library/wrapper/int8/slice_int8_wrapper.h b/mindspore/lite/micro/coder/wrapper/int8/slice_int8_wrapper.h similarity index 100% rename from mindspore/lite/micro/coder/operator_library/wrapper/int8/slice_int8_wrapper.h rename to mindspore/lite/micro/coder/wrapper/int8/slice_int8_wrapper.h diff --git a/mindspore/lite/micro/example/mnist_stm32f746/mnist_stm32f746/CMakeLists.txt b/mindspore/lite/micro/example/mnist_stm32f746/mnist_stm32f746/CMakeLists.txt index fb0470ed29..72cb7f92b8 100755 --- a/mindspore/lite/micro/example/mnist_stm32f746/mnist_stm32f746/CMakeLists.txt +++ b/mindspore/lite/micro/example/mnist_stm32f746/mnist_stm32f746/CMakeLists.txt @@ -10,22 +10,22 @@ get_filename_component(PKG_PATH ${PKG_PATH} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_BI set(HEADER_PATH ${PKG_PATH}/inference) -option(MICRO_BUILD_ARM64 "build android arm64" OFF) -option(MICRO_BUILD_ARM32A "build android arm32" OFF) +option(PLATFORM_ARM64 "build android arm64" OFF) +option(PLATFORM_ARM32 "build android arm32" OFF) add_compile_definitions(NOT_USE_STL) -if(MICRO_BUILD_ARM64 OR MICRO_BUILD_ARM32A) +if(PLATFORM_ARM64 OR PLATFORM_ARM32) add_compile_definitions(ENABLE_NEON) add_compile_definitions(ENABLE_ARM) endif() -if(MICRO_BUILD_ARM64) +if(PLATFORM_ARM64) add_compile_definitions(ENABLE_ARM64) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=armv8.2-a+dotprod") endif() -if(MICRO_BUILD_ARM32A) +if(PLATFORM_ARM32) add_compile_definitions(ENABLE_ARM32) add_definitions(-mfloat-abi=softfp -mfpu=neon) endif() diff --git a/mindspore/lite/micro/example/mnist_stm32f746/mnist_stm32f746/src/CMakeLists.txt b/mindspore/lite/micro/example/mnist_stm32f746/mnist_stm32f746/src/CMakeLists.txt index cae94664a6..9b18bb607b 100755 --- a/mindspore/lite/micro/example/mnist_stm32f746/mnist_stm32f746/src/CMakeLists.txt +++ b/mindspore/lite/micro/example/mnist_stm32f746/mnist_stm32f746/src/CMakeLists.txt @@ -22,20 +22,20 @@ include_directories(${HEADER_PATH}) include(net.cmake) -option(MICRO_BUILD_ARM64 "build android arm64" OFF) -option(MICRO_BUILD_ARM32A "build android arm32" OFF) +option(PLATFORM_ARM64 "build android arm64" OFF) +option(PLATFORM_ARM32 "build android arm32" OFF) -if(MICRO_BUILD_ARM64 OR MICRO_BUILD_ARM32A) +if(PLATFORM_ARM64 OR PLATFORM_ARM32) add_compile_definitions(ENABLE_NEON) add_compile_definitions(ENABLE_ARM) endif() -if(MICRO_BUILD_ARM64) +if(PLATFORM_ARM64) add_compile_definitions(ENABLE_ARM64) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=armv8.2-a+dotprod") endif() -if(MICRO_BUILD_ARM32A) +if(PLATFORM_ARM32) add_compile_definitions(ENABLE_ARM32) add_definitions(-mfloat-abi=softfp -mfpu=neon) endif() diff --git a/mindspore/lite/micro/example/mnist_x86/CMakeLists.txt b/mindspore/lite/micro/example/mnist_x86/CMakeLists.txt index fb0470ed29..72cb7f92b8 100644 --- a/mindspore/lite/micro/example/mnist_x86/CMakeLists.txt +++ b/mindspore/lite/micro/example/mnist_x86/CMakeLists.txt @@ -10,22 +10,22 @@ get_filename_component(PKG_PATH ${PKG_PATH} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_BI set(HEADER_PATH ${PKG_PATH}/inference) -option(MICRO_BUILD_ARM64 "build android arm64" OFF) -option(MICRO_BUILD_ARM32A "build android arm32" OFF) +option(PLATFORM_ARM64 "build android arm64" OFF) +option(PLATFORM_ARM32 "build android arm32" OFF) add_compile_definitions(NOT_USE_STL) -if(MICRO_BUILD_ARM64 OR MICRO_BUILD_ARM32A) +if(PLATFORM_ARM64 OR PLATFORM_ARM32) add_compile_definitions(ENABLE_NEON) add_compile_definitions(ENABLE_ARM) endif() -if(MICRO_BUILD_ARM64) +if(PLATFORM_ARM64) add_compile_definitions(ENABLE_ARM64) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=armv8.2-a+dotprod") endif() -if(MICRO_BUILD_ARM32A) +if(PLATFORM_ARM32) add_compile_definitions(ENABLE_ARM32) add_definitions(-mfloat-abi=softfp -mfpu=neon) endif() diff --git a/mindspore/lite/micro/example/mnist_x86/src/CMakeLists.txt b/mindspore/lite/micro/example/mnist_x86/src/CMakeLists.txt index cae94664a6..9b18bb607b 100644 --- a/mindspore/lite/micro/example/mnist_x86/src/CMakeLists.txt +++ b/mindspore/lite/micro/example/mnist_x86/src/CMakeLists.txt @@ -22,20 +22,20 @@ include_directories(${HEADER_PATH}) include(net.cmake) -option(MICRO_BUILD_ARM64 "build android arm64" OFF) -option(MICRO_BUILD_ARM32A "build android arm32" OFF) +option(PLATFORM_ARM64 "build android arm64" OFF) +option(PLATFORM_ARM32 "build android arm32" OFF) -if(MICRO_BUILD_ARM64 OR MICRO_BUILD_ARM32A) +if(PLATFORM_ARM64 OR PLATFORM_ARM32) add_compile_definitions(ENABLE_NEON) add_compile_definitions(ENABLE_ARM) endif() -if(MICRO_BUILD_ARM64) +if(PLATFORM_ARM64) add_compile_definitions(ENABLE_ARM64) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=armv8.2-a+dotprod") endif() -if(MICRO_BUILD_ARM32A) +if(PLATFORM_ARM32) add_compile_definitions(ENABLE_ARM32) add_definitions(-mfloat-abi=softfp -mfpu=neon) endif() diff --git a/mindspore/lite/micro/example/mobilenetv2/README.md b/mindspore/lite/micro/example/mobilenetv2/README.md index 1eed2b0cfd..353dcdf30d 100755 --- a/mindspore/lite/micro/example/mobilenetv2/README.md +++ b/mindspore/lite/micro/example/mobilenetv2/README.md @@ -90,7 +90,7 @@ cmake -DCMAKE_BUILD_TYPE=Release \ -DANDROID_ABI="arm64-v8a" \ -DANDROID_TOOLCHAIN_NAME="aarch64-linux-android-clang" \ -DANDROID_NATIVE_API_LEVEL="19" \ --DMICRO_BUILD_ARM64=ON \ +-DPLATFORM_ARM64=ON \ -DPKG_PATH={path to}/mindspore-lite-{version}-inference-android .. make ``` diff --git a/mindspore/lite/micro/example/mobilenetv2/mobilenetv2.sh b/mindspore/lite/micro/example/mobilenetv2/mobilenetv2.sh index 553d8a7399..3036ff8c0b 100644 --- a/mindspore/lite/micro/example/mobilenetv2/mobilenetv2.sh +++ b/mindspore/lite/micro/example/mobilenetv2/mobilenetv2.sh @@ -130,7 +130,7 @@ if [[ "${LITE_PLATFORM}" == "arm64" ]]; then -DANDROID_ABI="arm64-v8a" \ -DANDROID_TOOLCHAIN_NAME="aarch64-linux-android-clang" \ -DANDROID_NATIVE_API_LEVEL="19" \ - -DMICRO_BUILD_ARM64=ON \ + -DPLATFORM_ARM64=ON \ -DPKG_PATH=${PKG_PATH} ${BENCHMARK_PATH} else cmake -DCMAKE_BUILD_TYPE=Release \