adjust kernel_reg dynamic lib
This commit is contained in:
parent
260acb7cfb
commit
40899f7b80
12
build.sh
12
build.sh
|
@ -725,8 +725,6 @@ build_lite_java_arm64() {
|
|||
if [[ "X$SUPPORT_TRAIN" = "Xon" ]]; then
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/train/lib/libmindspore-lite-train.so ${JAVA_PATH}/java/app/libs/arm64-v8a/
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/train/lib/libmindspore-lite-train.so ${JAVA_PATH}/native/libs/arm64-v8a/
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/train/lib/libmslite_kernel_reg.so ${JAVA_PATH}/java/app/libs/arm64-v8a/
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/train/lib/libmslite_kernel_reg.so ${JAVA_PATH}/native/libs/arm64-v8a/
|
||||
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/train/lib/libminddata-lite.so ${JAVA_PATH}/java/app/libs/arm64-v8a/
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/train/lib/libminddata-lite.so ${JAVA_PATH}/native/libs/arm64-v8a/
|
||||
|
@ -736,8 +734,6 @@ build_lite_java_arm64() {
|
|||
else
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/inference/lib/libmindspore-lite.so ${JAVA_PATH}/java/app/libs/arm64-v8a/
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/inference/lib/libmindspore-lite.so ${JAVA_PATH}/native/libs/arm64-v8a/
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/inference/lib/libmslite_kernel_reg.so ${JAVA_PATH}/java/app/libs/arm64-v8a/
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/inference/lib/libmslite_kernel_reg.so ${JAVA_PATH}/native/libs/arm64-v8a/
|
||||
fi
|
||||
[ -n "${local_pkg_name}" ] && rm -rf ${local_pkg_name}
|
||||
}
|
||||
|
@ -761,8 +757,6 @@ build_lite_java_arm32() {
|
|||
if [[ "X$SUPPORT_TRAIN" = "Xon" ]]; then
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/train/lib/libmindspore-lite-train.so ${JAVA_PATH}/java/app/libs/armeabi-v7a/
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/train/lib/libmindspore-lite-train.so ${JAVA_PATH}/native/libs/armeabi-v7a/
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/train/lib/libmslite_kernel_reg.so ${JAVA_PATH}/java/app/libs/armeabi-v7a/
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/train/lib/libmslite_kernel_reg.so ${JAVA_PATH}/native/libs/armeabi-v7a/
|
||||
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/train/lib/libminddata-lite.so ${JAVA_PATH}/java/app/libs/armeabi-v7a/
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/train/lib/libminddata-lite.so ${JAVA_PATH}/native/libs/armeabi-v7a/
|
||||
|
@ -772,8 +766,6 @@ build_lite_java_arm32() {
|
|||
else
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/inference/lib/libmindspore-lite.so ${JAVA_PATH}/java/app/libs/armeabi-v7a/
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/inference/lib/libmindspore-lite.so ${JAVA_PATH}/native/libs/armeabi-v7a/
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/inference/lib/libmslite_kernel_reg.so ${JAVA_PATH}/java/app/libs/armeabi-v7a/
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/inference/lib/libmslite_kernel_reg.so ${JAVA_PATH}/native/libs/armeabi-v7a/
|
||||
fi
|
||||
[ -n "${local_pkg_name}" ] && rm -rf ${local_pkg_name}
|
||||
}
|
||||
|
@ -798,8 +790,6 @@ build_lite_java_x86() {
|
|||
if [[ "X$SUPPORT_TRAIN" = "Xon" ]]; then
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/train/lib/libmindspore-lite-train.so ${JAVA_PATH}/java/linux_x86/libs/
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/train/lib/libmindspore-lite-train.so ${JAVA_PATH}/native/libs/linux_x86/
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/train/lib/libmslite_kernel_reg.so ${JAVA_PATH}/java/linux_x86/libs/
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/train/lib/libmslite_kernel_reg.so ${JAVA_PATH}/native/libs/linux_x86/
|
||||
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/train/lib/libminddata-lite.so ${JAVA_PATH}/java/linux_x86/libs/
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/train/lib/libminddata-lite.so ${JAVA_PATH}/native/libs/linux_x86/
|
||||
|
@ -809,8 +799,6 @@ build_lite_java_x86() {
|
|||
else
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/inference/lib/libmindspore-lite.so ${JAVA_PATH}/java/linux_x86/libs/
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/inference/lib/libmindspore-lite.so ${JAVA_PATH}/native/libs/linux_x86/
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/inference/lib/libmslite_kernel_reg.so ${JAVA_PATH}/java/linux_x86/libs/
|
||||
cp ${BASEPATH}/mindspore/lite/build/java/${local_pkg_name}/inference/lib/libmslite_kernel_reg.so ${JAVA_PATH}/native/libs/linux_x86/
|
||||
fi
|
||||
[ -n "${local_pkg_name}" ] && rm -rf ${local_pkg_name}
|
||||
}
|
||||
|
|
|
@ -161,17 +161,16 @@ if(PLATFORM_ARM64)
|
|||
endif()
|
||||
if(SUPPORT_TRAIN)
|
||||
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/ DESTINATION ${RUNTIME_INC_DIR}
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "*registry.h" EXCLUDE)
|
||||
else()
|
||||
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/ DESTINATION ${RUNTIME_INC_DIR}
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "train*" EXCLUDE)
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "train*" EXCLUDE
|
||||
PATTERN "*registry.h" EXCLUDE)
|
||||
endif()
|
||||
install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_LIB_NAME}.so DESTINATION ${RUNTIME_LIB_DIR}
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_LIB_NAME}.a DESTINATION ${RUNTIME_LIB_DIR}
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
install(FILES ${TOP_DIR}/mindspore/lite/build/src/registry/libmslite_kernel_reg.so
|
||||
DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
if(ENABLE_MODEL_OBF)
|
||||
install(FILES ${TOP_DIR}/mindspore/lite/tools/obfuscator/lib/android-aarch64/libmsdeobfuscator-lite.so
|
||||
DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
|
@ -207,17 +206,16 @@ elseif(PLATFORM_ARM32)
|
|||
endif()
|
||||
if(SUPPORT_TRAIN)
|
||||
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/ DESTINATION ${RUNTIME_INC_DIR}
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "*registry.h" EXCLUDE)
|
||||
else()
|
||||
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/ DESTINATION ${RUNTIME_INC_DIR}
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "train*" EXCLUDE)
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "train*" EXCLUDE
|
||||
PATTERN "*registry.h" EXCLUDE)
|
||||
endif()
|
||||
install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_LIB_NAME}.so DESTINATION ${RUNTIME_LIB_DIR}
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_LIB_NAME}.a DESTINATION ${RUNTIME_LIB_DIR}
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
install(FILES ${TOP_DIR}/mindspore/lite/build/src/registry/libmslite_kernel_reg.so
|
||||
DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
if(ENABLE_MODEL_OBF)
|
||||
install(FILES ${TOP_DIR}/mindspore/lite/tools/obfuscator/lib/android-aarch32/libmsdeobfuscator-lite.so
|
||||
DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
|
@ -249,11 +247,11 @@ elseif(WIN32)
|
|||
if(ENABLE_CONVERTER)
|
||||
install(TARGETS converter_lite RUNTIME DESTINATION ${CONVERTER_ROOT_DIR}/converter
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/registry/ DESTINATION ${CONVERTER_ROOT_DIR}/include/registry
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
||||
install(FILES ${LIB_LIST} DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
install(FILES ${TOP_DIR}/build/mindspore/tools/converter/registry/libmslite_converter_plugin_reg.dll
|
||||
DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
install(FILES ${TOP_DIR}/build/mindspore/src/registry/libmslite_kernel_reg.dll
|
||||
DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
install(FILES ${glog_LIBPATH}/../bin/libglog.dll DESTINATION ${CONVERTER_ROOT_DIR}/lib
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
install(FILES ${NNACL_FILES} DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
|
@ -287,10 +285,11 @@ elseif(WIN32)
|
|||
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
if(SUPPORT_TRAIN)
|
||||
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/ DESTINATION ${RUNTIME_INC_DIR}
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "*registry.h" EXCLUDE)
|
||||
else()
|
||||
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/ DESTINATION ${RUNTIME_INC_DIR}
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "train*" EXCLUDE)
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "train*" EXCLUDE
|
||||
PATTERN "*registry.h" EXCLUDE)
|
||||
endif()
|
||||
install(FILES ${TOP_DIR}/mindspore/core/ir/dtype/type_id.h DESTINATION ${RUNTIME_INC_DIR}/ir/dtype
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
|
@ -302,15 +301,14 @@ elseif(WIN32)
|
|||
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
install(FILES ${TOP_DIR}/build/mindspore/src/${MINDSPORE_LITE_LIB_NAME}.dll DESTINATION ${RUNTIME_LIB_DIR}
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
install(FILES ${TOP_DIR}/build/mindspore/src/registry/libmslite_kernel_reg.dll DESTINATION ${RUNTIME_LIB_DIR}
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
else()
|
||||
if(SUPPORT_TRAIN)
|
||||
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/ DESTINATION ${RUNTIME_INC_DIR}
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "*registry.h" EXCLUDE)
|
||||
else()
|
||||
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/ DESTINATION ${RUNTIME_INC_DIR}
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "train*" EXCLUDE)
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "train*" EXCLUDE
|
||||
PATTERN "*registry.h" EXCLUDE)
|
||||
endif()
|
||||
install(FILES ${TOP_DIR}/mindspore/core/ir/dtype/type_id.h DESTINATION ${RUNTIME_INC_DIR}/ir/dtype
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
|
@ -320,8 +318,6 @@ else()
|
|||
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_LIB_NAME}.a DESTINATION ${RUNTIME_LIB_DIR}
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
install(FILES ${TOP_DIR}/mindspore/lite/build/src/registry/libmslite_kernel_reg.so DESTINATION ${RUNTIME_LIB_DIR}
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
if(ENABLE_MODEL_OBF)
|
||||
install(FILES ${TOP_DIR}/mindspore/lite/tools/obfuscator/bin/linux-x64/msobfuscator
|
||||
DESTINATION ${OBFUSCATOR_ROOT_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
|
@ -329,12 +325,12 @@ else()
|
|||
DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
endif()
|
||||
if(ENABLE_CONVERTER)
|
||||
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/registry/ DESTINATION ${CONVERTER_ROOT_DIR}/include/registry
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
||||
install(TARGETS converter_lite RUNTIME DESTINATION ${CONVERTER_ROOT_DIR}/converter
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
install(FILES ${TOP_DIR}/mindspore/lite/build/tools/converter/registry/libmslite_converter_plugin_reg.so
|
||||
DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
install(FILES ${TOP_DIR}/mindspore/lite/build/src/registry/libmslite_kernel_reg.so
|
||||
DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
install(FILES ${glog_LIBPATH}/libglog.so.0.4.0 DESTINATION ${CONVERTER_ROOT_DIR}/lib RENAME libglog.so.0
|
||||
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
||||
file(GLOB NNACL_FILES GLOB ${NNACL_DIR}/*.h)
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
/**
|
||||
* This is the C++ adaptation and derivative work of Myia (https://github.com/mila-iqia/myia/).
|
||||
*
|
||||
* Copyright 2021 Huawei Technologies Co., Ltd
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef MINDSPORE_CORE_IR_FORMAT_H_
|
||||
#define MINDSPORE_CORE_IR_FORMAT_H_
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace mindspore {
|
||||
enum Format : int64_t {
|
||||
NCHW = 0,
|
||||
NHWC = 1,
|
||||
NHWC4 = 2,
|
||||
HWKC = 3,
|
||||
HWCK = 4,
|
||||
KCHW = 5,
|
||||
CKHW = 6,
|
||||
KHWC = 7,
|
||||
CHWK = 8,
|
||||
HW = 9,
|
||||
HW4 = 10,
|
||||
NC = 11,
|
||||
NC4 = 12,
|
||||
NC4HW4 = 13,
|
||||
NUM_OF_FORMAT = 14,
|
||||
NCDHW = 15,
|
||||
NWC = 16,
|
||||
NCW = 17
|
||||
};
|
||||
} // namespace mindspore
|
||||
#endif // MINDSPORE_CORE_IR_FORMAT_H_
|
|
@ -27,6 +27,7 @@
|
|||
#include "base/base.h"
|
||||
#include "ir/anf.h"
|
||||
#include "ir/dtype/type_id.h"
|
||||
#include "ir/format.h"
|
||||
#include "utils/log_adapter.h"
|
||||
namespace mindspore {
|
||||
typedef std::pair<std::map<std::string, int64_t>, std::map<int64_t, std::string>> AttrConverterPair;
|
||||
|
@ -50,26 +51,6 @@ enum CompareRange {
|
|||
kIncludeRight = 3, // (a,b]
|
||||
kIncludeBoth = 4, // [a,b]
|
||||
};
|
||||
enum Format : int64_t {
|
||||
NCHW = 0,
|
||||
NHWC = 1,
|
||||
NHWC4 = 2,
|
||||
HWKC = 3,
|
||||
HWCK = 4,
|
||||
KCHW = 5,
|
||||
CKHW = 6,
|
||||
KHWC = 7,
|
||||
CHWK = 8,
|
||||
HW = 9,
|
||||
HW4 = 10,
|
||||
NC = 11,
|
||||
NC4 = 12,
|
||||
NC4HW4 = 13,
|
||||
NUM_OF_FORMAT = 14,
|
||||
NCDHW = 15,
|
||||
NWC = 16,
|
||||
NCW = 17
|
||||
};
|
||||
enum ActivationType : int64_t {
|
||||
NO_ACTIVATION = 0,
|
||||
RELU = 1,
|
||||
|
|
|
@ -278,7 +278,6 @@ if(BUILD_MINDDATA STREQUAL "lite_cv")
|
|||
endif()
|
||||
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/registry)
|
||||
add_subdirectory(${CCSRC_DIR}/backend/kernel_compiler/cpu/nnacl build)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/micro/coder)
|
||||
if(NOT APPLE AND ENABLE_TOOLS)
|
||||
|
|
|
@ -14,7 +14,7 @@ CONVERTER="../../../build/tools/converter/converter_lite"
|
|||
if [ ! -f "$CONVERTER" ]; then
|
||||
if ! command -v converter_lite &> /dev/null
|
||||
then
|
||||
tar -xzf ../../../../../output/mindspore-lite-*-train-linux-x64.tar.gz --strip-components 4 --wildcards --no-anchored converter_lite libglog.so.0 libmslite_kernel_reg.so libmslite_converter_plugin_reg.so
|
||||
tar -xzf ../../../../../output/mindspore-lite-*-train-linux-x64.tar.gz --strip-components 4 --wildcards --no-anchored converter_lite libglog.so.0 libmslite_converter_plugin_reg.so
|
||||
if [ -f ./converter_lite ]; then
|
||||
CONVERTER=./converter_lite
|
||||
else
|
||||
|
|
|
@ -19,7 +19,7 @@ CONVERTER="../../../build/tools/converter/converter_lite"
|
|||
if [ ! -f "$CONVERTER" ]; then
|
||||
if ! command -v converter_lite &> /dev/null
|
||||
then
|
||||
tar -xzf ../../../../../output/mindspore-lite-*-train-linux-x64.tar.gz --strip-components 4 --wildcards --no-anchored converter_lite libglog.so.0 libmslite_kernel_reg.so libmslite_converter_plugin_reg.so
|
||||
tar -xzf ../../../../../output/mindspore-lite-*-train-linux-x64.tar.gz --strip-components 4 --wildcards --no-anchored converter_lite libglog.so.0 libmslite_converter_plugin_reg.so
|
||||
if [ -f ./converter_lite ]; then
|
||||
CONVERTER=./converter_lite
|
||||
else
|
||||
|
|
|
@ -47,6 +47,7 @@ set(LITE_SRC
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/common/utils.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/common/graph_util.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/common/dynamic_library_loader.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/common/log_adapter.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/common/string_util.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/common/prim_util.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/common/tensor_util.cc
|
||||
|
@ -75,6 +76,8 @@ set(LITE_SRC
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/cpu_info.cc
|
||||
)
|
||||
|
||||
file(GLOB KERNEL_REG_SRC ${CMAKE_CURRENT_SOURCE_DIR}/registry/*.cc)
|
||||
set(LITE_SRC ${LITE_SRC} ${KERNEL_REG_SRC})
|
||||
if(SUPPORT_GPU STREQUAL opencl)
|
||||
file(GLOB_RECURSE OPENCL_RUNTIME_SRC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/runtime/gpu/opencl/*.cc
|
||||
|
@ -181,6 +184,10 @@ if(SUPPORT_NPU)
|
|||
target_link_libraries(mindspore-lite npu_kernel_mid)
|
||||
target_link_libraries(mindspore-lite_static npu_kernel_mid)
|
||||
endif()
|
||||
if(PLATFORM_ARM32 OR PLATFORM_ARM64)
|
||||
target_link_libraries(mindspore-lite log)
|
||||
target_link_libraries(mindspore-lite_static log)
|
||||
endif()
|
||||
if(BUILD_MINDDATA STREQUAL "lite")
|
||||
target_link_libraries(mindspore-lite minddata_eager_mid minddata-lite)
|
||||
target_link_libraries(mindspore-lite_static minddata_eager_mid)
|
||||
|
@ -192,9 +199,6 @@ if(SUPPORT_TRAIN)
|
|||
target_link_libraries(mindspore-lite_static minddata-lite)
|
||||
endif()
|
||||
|
||||
target_link_libraries(mindspore-lite mslite_kernel_reg)
|
||||
target_link_libraries(mindspore-lite_static mslite_kernel_reg)
|
||||
|
||||
if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
||||
if(NOT APPLE AND PLATFORM_ARM)
|
||||
set(NDK_STRIP
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include "src/kernel_registry.h"
|
||||
#include <utility>
|
||||
#include "include/errorcode.h"
|
||||
#include "src/registry/register_kernel.h"
|
||||
#include "include/registry/register_kernel.h"
|
||||
#include "src/ops/populate/populate_register.h"
|
||||
#include "src/common/version_manager.h"
|
||||
#include "nnacl/pooling_parameter.h"
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
file(GLOB RUNTIME_REG_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cc)
|
||||
if(USE_GLOG)
|
||||
set(RUNTIME_REG_SRC ${RUNTIME_REG_SRC} ${CORE_DIR}/utils/log_adapter.cc)
|
||||
else()
|
||||
set(RUNTIME_REG_SRC ${RUNTIME_REG_SRC} ${CMAKE_CURRENT_SOURCE_DIR}/../common/log_adapter.cc)
|
||||
endif()
|
||||
set_property(SOURCE ${RUNTIME_REG_SRC} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_LITE)
|
||||
add_library(mslite_kernel_reg SHARED ${RUNTIME_REG_SRC})
|
||||
if(PLATFORM_ARM32 OR PLATFORM_ARM64)
|
||||
target_link_libraries(mslite_kernel_reg log)
|
||||
endif()
|
||||
add_dependencies(mslite_kernel_reg fbs_src)
|
|
@ -13,7 +13,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "src/registry/kernel_interface.h"
|
||||
#include "include/registry/kernel_interface.h"
|
||||
#include <set>
|
||||
#include <utility>
|
||||
#include "src/registry/kernel_interface_registry.h"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
*/
|
||||
#include "src/registry/kernel_interface_registry.h"
|
||||
#include <memory>
|
||||
#include "src/registry/kernel_interface.h"
|
||||
#include "include/registry/kernel_interface.h"
|
||||
#include "include/errorcode.h"
|
||||
#include "src/common/log_adapter.h"
|
||||
#include "src/common/version_manager.h"
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <set>
|
||||
#include "src/registry/kernel_interface.h"
|
||||
#include "include/registry/kernel_interface.h"
|
||||
#include "include/model.h"
|
||||
|
||||
namespace mindspore {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "src/registry/register_kernel.h"
|
||||
#include "include/registry/register_kernel.h"
|
||||
#include <set>
|
||||
#include "src/registry/register_kernel_impl.h"
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
#include "src/registry/register_kernel_impl.h"
|
||||
#include "src/registry/register_kernel.h"
|
||||
#include "include/registry/register_kernel.h"
|
||||
#include "include/errorcode.h"
|
||||
#include "src/common/version_manager.h"
|
||||
#include "src/common/log_adapter.h"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include "src/registry/register_kernel.h"
|
||||
#include "include/registry/register_kernel.h"
|
||||
|
||||
using mindspore::schema::PrimitiveType_MAX;
|
||||
using mindspore::schema::PrimitiveType_MIN;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "include/errorcode.h"
|
||||
#include "nnacl/errorcode.h"
|
||||
#include "src/tensorlist.h"
|
||||
#include "src/registry/kernel_interface.h"
|
||||
#include "include/registry/kernel_interface.h"
|
||||
#include "src/kernel_registry.h"
|
||||
|
||||
namespace mindspore {
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "src/common/graph_util.h"
|
||||
#include "src/common/utils.h"
|
||||
#include "src/kernel_registry.h"
|
||||
#include "src/registry/register_kernel.h"
|
||||
#include "include/registry/register_kernel.h"
|
||||
#include "src/lite_kernel_util.h"
|
||||
#include "src/sub_graph_kernel.h"
|
||||
#include "src/ops/populate/populate_register.h"
|
||||
|
@ -49,7 +49,7 @@
|
|||
#if defined(ENABLE_ARM) && defined(ENABLE_FP16)
|
||||
#include "src/runtime/kernel/arm/fp16/fp16_op_handler.h"
|
||||
#endif
|
||||
#include "src/registry/kernel_interface.h"
|
||||
#include "include/registry/kernel_interface.h"
|
||||
|
||||
namespace mindspore::lite {
|
||||
using kernel::KERNEL_ARCH::kCPU;
|
||||
|
|
|
@ -19,6 +19,7 @@ if(ENABLE_CONVERTER)
|
|||
${CCSRC_DIR}/backend/optimizer/common/optimizer.cc
|
||||
)
|
||||
else()
|
||||
set(TEST_LITE_SRC ${LITE_DIR}/src/common/log_adapter.cc)
|
||||
add_compile_definitions(USE_ANDROID_LOG)
|
||||
endif()
|
||||
|
||||
|
@ -107,6 +108,9 @@ set(TEST_LITE_SRC
|
|||
${LITE_DIR}/tools/common/flag_parser.cc
|
||||
)
|
||||
|
||||
file(GLOB KERNEL_REG_SRC ${LITE_DIR}/src/registry/*.cc)
|
||||
set(TEST_LITE_SRC ${TEST_LITE_SRC} ${KERNEL_REG_SRC})
|
||||
|
||||
if(ENABLE_TOOLS)
|
||||
set(TEST_LITE_SRC
|
||||
${TEST_LITE_SRC}
|
||||
|
@ -393,9 +397,6 @@ if(ENABLE_CONVERTER)
|
|||
mindspore::glog
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(lite-test mslite_kernel_reg)
|
||||
|
||||
if(ENABLE_MODEL_OBF)
|
||||
target_link_libraries(lite-test ${OBF_LIB_DIR}/libmsdeobfuscator-lite.so)
|
||||
endif()
|
||||
|
|
|
@ -1482,7 +1482,6 @@ function Run_arm64() {
|
|||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/third_party/hiai_ddk/lib/libhiai_ir_build.so ${benchmark_test_path}/libhiai_ir_build.so || exit 1
|
||||
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/lib/libmindspore-lite.so ${benchmark_test_path}/libmindspore-lite.so || exit 1
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/lib/libmslite_kernel_reg.so ${benchmark_test_path}/libmslite_kernel_reg.so || exit 1
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/tools/benchmark/benchmark ${benchmark_test_path}/benchmark || exit 1
|
||||
|
||||
# adb push all needed files to the phone
|
||||
|
@ -1903,7 +1902,6 @@ function Run_arm32() {
|
|||
cp -a ${arm32_path}/mindspore-lite-${version}-inference-android-aarch32/inference/third_party/hiai_ddk/lib/libhiai_ir.so ${benchmark_test_path}/libhiai_ir.so || exit 1
|
||||
cp -a ${arm32_path}/mindspore-lite-${version}-inference-android-aarch32/inference/third_party/hiai_ddk/lib/libhiai_ir_build.so ${benchmark_test_path}/libhiai_ir_build.so || exit 1
|
||||
cp -a ${arm32_path}/mindspore-lite-${version}-inference-android-aarch32/inference/lib/libmindspore-lite.so ${benchmark_test_path}/libmindspore-lite.so || exit 1
|
||||
cp -a ${arm32_path}/mindspore-lite-${version}-inference-android-aarch32/inference/lib/libmslite_kernel_reg.so ${benchmark_test_path}/libmslite_kernel_reg.so || exit 1
|
||||
cp -a ${arm32_path}/mindspore-lite-${version}-inference-android-aarch32/tools/benchmark/benchmark ${benchmark_test_path}/benchmark || exit 1
|
||||
|
||||
# adb push all needed files to the phone
|
||||
|
@ -1961,7 +1959,6 @@ function Run_arm64_fp16() {
|
|||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/third_party/hiai_ddk/lib/libhiai_ir_build.so ${benchmark_test_path}/libhiai_ir_build.so || exit 1
|
||||
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/lib/libmindspore-lite.so ${benchmark_test_path}/libmindspore-lite.so || exit 1
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/lib/libmslite_kernel_reg.so ${benchmark_test_path}/libmslite_kernel_reg.so || exit 1
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/tools/benchmark/benchmark ${benchmark_test_path}/benchmark || exit 1
|
||||
|
||||
# adb push all needed files to the phone
|
||||
|
@ -2133,7 +2130,6 @@ function Run_armv82_a32_fp16() {
|
|||
cp -a ${armv82_path}/mindspore-lite-${version}-inference-android-aarch32/inference/third_party/hiai_ddk/lib/libhiai_ir.so ${benchmark_test_path}/libhiai_ir.so || exit 1
|
||||
cp -a ${armv82_path}/mindspore-lite-${version}-inference-android-aarch32/inference/third_party/hiai_ddk/lib/libhiai_ir_build.so ${benchmark_test_path}/libhiai_ir_build.so || exit 1
|
||||
cp -a ${armv82_path}/mindspore-lite-${version}-inference-android-aarch32/inference/lib/libmindspore-lite.so ${benchmark_test_path}/libmindspore-lite.so || exit 1
|
||||
cp -a ${armv82_path}/mindspore-lite-${version}-inference-android-aarch32/inference/lib/libmslite_kernel_reg.so ${benchmark_test_path}/libmslite_kernel_reg.so || exit 1
|
||||
cp -a ${armv82_path}/mindspore-lite-${version}-inference-android-aarch32/tools/benchmark/benchmark ${benchmark_test_path}/benchmark || exit 1
|
||||
|
||||
# adb push all needed files to the phone
|
||||
|
@ -2311,7 +2307,6 @@ function Run_gpu() {
|
|||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/third_party/hiai_ddk/lib/libhiai_ir_build.so ${benchmark_test_path}/libhiai_ir_build.so || exit 1
|
||||
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/lib/libmindspore-lite.so ${benchmark_test_path}/libmindspore-lite.so || exit 1
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/lib/libmslite_kernel_reg.so ${benchmark_test_path}/libmslite_kernel_reg.so || exit 1
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/tools/benchmark/benchmark ${benchmark_test_path}/benchmark || exit 1
|
||||
|
||||
# adb push all needed files to the phone
|
||||
|
@ -2464,7 +2459,6 @@ function Run_npu() {
|
|||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/third_party/hiai_ddk/lib/libhiai_ir_build.so ${benchmark_test_path}/libhiai_ir_build.so || exit 1
|
||||
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/lib/libmindspore-lite.so ${benchmark_test_path}/libmindspore-lite.so || exit 1
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/lib/libmslite_kernel_reg.so ${benchmark_test_path}/libmslite_kernel_reg.so || exit 1
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/tools/benchmark/benchmark ${benchmark_test_path}/benchmark || exit 1
|
||||
|
||||
# adb push all needed files to the phone
|
||||
|
|
|
@ -153,7 +153,6 @@ function Run_arm() {
|
|||
fi
|
||||
|
||||
cp -a ${arm_path}/mindspore-lite-${version_arm}-train-android-${process_unit}/train/lib/libmindspore-lite-train.so ${benchmark_train_test_path}/libmindspore-lite-train.so || exit 1
|
||||
cp -a ${arm_path}/mindspore-lite-${version_arm}-train-android-${process_unit}/train/lib/libmslite_kernel_reg.so ${benchmark_train_test_path}/libmslite_kernel_reg.so || exit 1
|
||||
cp -a ${arm_path}/mindspore-lite-${version_arm}-train-android-${process_unit}/tools/benchmark_train/benchmark_train ${benchmark_train_test_path}/benchmark_train || exit 1
|
||||
|
||||
# adb push all needed files to the phone
|
||||
|
|
|
@ -612,7 +612,6 @@ function Run_arm64() {
|
|||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/third_party/hiai_ddk/lib/libhiai_ir_build.so ${benchmark_test_path}/libhiai_ir_build.so || exit 1
|
||||
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/lib/libmindspore-lite.so ${benchmark_test_path}/libmindspore-lite.so || exit 1
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/lib/libmslite_kernel_reg.so ${benchmark_test_path}/libmslite_kernel_reg.so || exit 1
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/tools/benchmark/benchmark ${benchmark_test_path}/benchmark || exit 1
|
||||
|
||||
# adb push all needed files to the phone
|
||||
|
@ -1033,7 +1032,6 @@ function Run_arm32() {
|
|||
cp -a ${arm32_path}/mindspore-lite-${version}-inference-android-aarch32/inference/third_party/hiai_ddk/lib/libhiai_ir.so ${benchmark_test_path}/libhiai_ir.so || exit 1
|
||||
cp -a ${arm32_path}/mindspore-lite-${version}-inference-android-aarch32/inference/third_party/hiai_ddk/lib/libhiai_ir_build.so ${benchmark_test_path}/libhiai_ir_build.so || exit 1
|
||||
cp -a ${arm32_path}/mindspore-lite-${version}-inference-android-aarch32/inference/lib/libmindspore-lite.so ${benchmark_test_path}/libmindspore-lite.so || exit 1
|
||||
cp -a ${arm32_path}/mindspore-lite-${version}-inference-android-aarch32/inference/lib/libmslite_kernel_reg.so ${benchmark_test_path}/libmslite_kernel_reg.so || exit 1
|
||||
cp -a ${arm32_path}/mindspore-lite-${version}-inference-android-aarch32/tools/benchmark/benchmark ${benchmark_test_path}/benchmark || exit 1
|
||||
|
||||
# adb push all needed files to the phone
|
||||
|
@ -1091,7 +1089,6 @@ function Run_arm64_fp16() {
|
|||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/third_party/hiai_ddk/lib/libhiai_ir_build.so ${benchmark_test_path}/libhiai_ir_build.so || exit 1
|
||||
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/lib/libmindspore-lite.so ${benchmark_test_path}/libmindspore-lite.so || exit 1
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/lib/libmslite_kernel_reg.so ${benchmark_test_path}/libmslite_kernel_reg.so || exit 1
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/tools/benchmark/benchmark ${benchmark_test_path}/benchmark || exit 1
|
||||
|
||||
# adb push all needed files to the phone
|
||||
|
@ -1263,7 +1260,6 @@ function Run_armv82_a32_fp16() {
|
|||
cp -a ${armv82_path}/mindspore-lite-${version}-inference-android-aarch32/inference/third_party/hiai_ddk/lib/libhiai_ir.so ${benchmark_test_path}/libhiai_ir.so || exit 1
|
||||
cp -a ${armv82_path}/mindspore-lite-${version}-inference-android-aarch32/inference/third_party/hiai_ddk/lib/libhiai_ir_build.so ${benchmark_test_path}/libhiai_ir_build.so || exit 1
|
||||
cp -a ${armv82_path}/mindspore-lite-${version}-inference-android-aarch32/inference/lib/libmindspore-lite.so ${benchmark_test_path}/libmindspore-lite.so || exit 1
|
||||
cp -a ${armv82_path}/mindspore-lite-${version}-inference-android-aarch32/inference/lib/libmslite_kernel_reg.so ${benchmark_test_path}/libmslite_kernel_reg.so || exit 1
|
||||
cp -a ${armv82_path}/mindspore-lite-${version}-inference-android-aarch32/tools/benchmark/benchmark ${benchmark_test_path}/benchmark || exit 1
|
||||
|
||||
# adb push all needed files to the phone
|
||||
|
|
|
@ -126,7 +126,6 @@ function Run_gpu() {
|
|||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/third_party/hiai_ddk/lib/libhiai_ir_build.so ${benchmark_test_path}/libhiai_ir_build.so || exit 1
|
||||
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/lib/libmindspore-lite.so ${benchmark_test_path}/libmindspore-lite.so || exit 1
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/lib/libmslite_kernel_reg.so ${benchmark_test_path}/libmslite_kernel_reg.so || exit 1
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/tools/benchmark/benchmark ${benchmark_test_path}/benchmark || exit 1
|
||||
|
||||
# adb push all needed files to the phone
|
||||
|
|
|
@ -71,7 +71,6 @@ function Run_npu() {
|
|||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/third_party/hiai_ddk/lib/libhiai_ir_build.so ${benchmark_test_path}/libhiai_ir_build.so || exit 1
|
||||
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/lib/libmindspore-lite.so ${benchmark_test_path}/libmindspore-lite.so || exit 1
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/inference/lib/libmslite_kernel_reg.so ${benchmark_test_path}/libmslite_kernel_reg.so || exit 1
|
||||
cp -a ${arm64_path}/mindspore-lite-${version}-inference-android-aarch64/tools/benchmark/benchmark ${benchmark_test_path}/benchmark || exit 1
|
||||
|
||||
# adb push all needed files to the phone
|
||||
|
|
|
@ -31,7 +31,6 @@ function Run_cropper() {
|
|||
cp -a ./inference/third_party/hiai_ddk/lib/libhiai_ir_build.so "${cropper_test_path}"/libhiai_ir_build.so || exit 1
|
||||
|
||||
cp -a ./inference/lib/libmindspore-lite.a "${cropper_test_path}"/libmindspore-lite.a || exit 1
|
||||
cp -a ./inference/lib/libmslite_kernel_reg.so "${cropper_test_path}"/libmslite_kernel_reg.so || exit 1
|
||||
cp -a ./tools/benchmark/benchmark "${cropper_test_path}"/benchmark || exit 1
|
||||
|
||||
cp -r "${x86_path}"/mindspore-lite-${version}-inference-linux-x64/tools/cropper/ "${cropper_test_path}" || exit 1
|
||||
|
@ -75,7 +74,7 @@ function Run_cropper() {
|
|||
-fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security -O0 -std=c++17 -DARM64=1 -O2 -DNDEBUG -s \
|
||||
-Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,--warn-shared-textrel \
|
||||
-Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -Wl,--no-whole-archive -llog -latomic -lm \
|
||||
-L "${cropper_test_path}" -lmslite_kernel_reg -lhiai -lhiai_ir -lhiai_ir_build \
|
||||
-L "${cropper_test_path}" -lhiai -lhiai_ir -lhiai_ir_build \
|
||||
-shared -o libmindspore-lite.so -Wl,-soname,libmindspore-lite.so
|
||||
|
||||
if [ $? = 0 ]; then
|
||||
|
@ -153,4 +152,4 @@ if [[ $Run_cropper_status == 1 ]]; then
|
|||
fi
|
||||
|
||||
Print_Cropper_Result
|
||||
exit 0
|
||||
exit 0
|
||||
|
|
|
@ -206,7 +206,6 @@ target_link_libraries(converter_lite PRIVATE
|
|||
mindspore::json
|
||||
mindspore::eigen
|
||||
-Wl,--whole-archive mindspore_core -Wl,--no-whole-archive
|
||||
mslite_kernel_reg
|
||||
mindspore::glog
|
||||
mindspore::protobuf
|
||||
mindspore::flatbuffers
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
#include "tools/optimizer/fisson/iter_node_outputs.h"
|
||||
#include "tools/optimizer/fisson/node_out_shapes.h"
|
||||
#include "tools/optimizer/parallel/parallel_pass.h"
|
||||
#include "tools/converter/registry/pass_registry.h"
|
||||
#include "include/registry/pass_registry.h"
|
||||
#include "tools/optimizer/fisson/multi_conv_split_pass.h"
|
||||
|
||||
using std::string;
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "tools/anf_exporter/anf_exporter.h"
|
||||
#include "include/version.h"
|
||||
#include "src/train/train_populate_parameter.h"
|
||||
#include "tools/converter/registry/model_parser_registry.h"
|
||||
#include "include/registry/model_parser_registry.h"
|
||||
#include "src/common/dynamic_library_loader.h"
|
||||
#include "tools/converter/parser/parser_utils.h"
|
||||
#include "tools/converter/import/mindspore_importer.h"
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "schema/inner/model_generated.h"
|
||||
#include "tools/converter/graphdef_transform.h"
|
||||
#include "tools/converter/model_parser.h"
|
||||
#include "tools/converter/registry/model_parser_registry.h"
|
||||
#include "include/registry/model_parser_registry.h"
|
||||
#include "tools/converter/converter_flags.h"
|
||||
#include "tools/converter/anf_transform.h"
|
||||
#include "tools/converter/converter_context.h"
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include <set>
|
||||
#include <unordered_map>
|
||||
#include "tools/converter/model_parser.h"
|
||||
#include "tools/converter/registry/model_parser_registry.h"
|
||||
#include "include/registry/model_parser_registry.h"
|
||||
#include "proto/caffe.pb.h"
|
||||
#include "ops/primitive_c.h"
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include <unordered_map>
|
||||
#include "securec/include/securec.h"
|
||||
#include "tools/converter/model_parser.h"
|
||||
#include "tools/converter/registry/model_parser_registry.h"
|
||||
#include "include/registry/model_parser_registry.h"
|
||||
#include "tools/converter/parser/onnx/onnx_node_parser_registry.h"
|
||||
#include "proto/onnx.pb.h"
|
||||
#include "schema/inner/model_generated.h"
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include "securec/include/securec.h"
|
||||
#include "tools/common/tensor_util.h"
|
||||
#include "tools/converter/model_parser.h"
|
||||
#include "tools/converter/registry/model_parser_registry.h"
|
||||
#include "include/registry/model_parser_registry.h"
|
||||
#include "ops/primitive_c.h"
|
||||
|
||||
namespace mindspore {
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include <vector>
|
||||
#include <set>
|
||||
#include "tools/converter/model_parser.h"
|
||||
#include "tools/converter/registry/model_parser_registry.h"
|
||||
#include "include/registry/model_parser_registry.h"
|
||||
#include "tools/converter/parser/tflite/tflite_node_parser_registry.h"
|
||||
#include "tools/common/tensor_util.h"
|
||||
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
set(KERNEL_REG_DIR ${TOP_DIR}/mindspore/lite/src/registry)
|
||||
file(GLOB CONVERT_REG_SRC
|
||||
pass_registry.cc
|
||||
model_parser_registry.cc
|
||||
)
|
||||
|
||||
set_property(SOURCE ${CONVERT_REG_SRC} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_LITE)
|
||||
add_library(mslite_converter_plugin_reg SHARED ${CONVERT_REG_SRC})
|
||||
|
||||
file(GLOB KERNEL_REG_SRC ${KERNEL_REG_DIR}/*.cc)
|
||||
set(REG_SRC ${CONVERT_REG_SRC}
|
||||
${KERNEL_REG_SRC}
|
||||
${CORE_DIR}/utils/log_adapter.cc
|
||||
${CORE_DIR}/gvar/log_adapter_common.cc
|
||||
${CORE_DIR}/gvar/logging_level.cc)
|
||||
set_property(SOURCE ${REG_SRC} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_LITE)
|
||||
add_library(mslite_converter_plugin_reg SHARED ${REG_SRC})
|
||||
target_link_libraries(mslite_converter_plugin_reg mindspore::glog)
|
||||
add_dependencies(mslite_converter_plugin_reg fbs_src)
|
||||
add_dependencies(mslite_converter_plugin_reg fbs_inner_src)
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "tools/converter/registry/model_parser_registry.h"
|
||||
#include "include/registry/model_parser_registry.h"
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "tools/converter/registry/pass_registry.h"
|
||||
#include <iostream>
|
||||
#include "include/registry/pass_registry.h"
|
||||
#include <unordered_map>
|
||||
#include "src/common/log_adapter.h"
|
||||
|
||||
namespace mindspore {
|
||||
namespace opt {
|
||||
|
@ -27,7 +27,7 @@ PassRegistry *PassRegistry::GetInstance() {
|
|||
|
||||
void PassRegistry::RegPass(int position, const PassPtr &pass) {
|
||||
if (pass == nullptr) {
|
||||
std::cout << "pass is nullptr" << std::endl;
|
||||
MS_LOG(ERROR) << "pass is nullptr.";
|
||||
return;
|
||||
}
|
||||
auto instance = PassRegistry::GetInstance();
|
||||
|
|
|
@ -106,6 +106,8 @@ getCommonFile() {
|
|||
cd "${MINDSPORE_HOME}" || exit 1
|
||||
include_h=()
|
||||
while IFS='' read -r line; do include_h+=("$line"); done < <(ls mindspore/lite/include/*.h)
|
||||
regist_include_h=()
|
||||
while IFS='' read -r line; do regist_include_h+=("$line"); done < <(ls mindspore/lite/include/registry/*kernel*.h)
|
||||
src_files_h=()
|
||||
while IFS='' read -r line; do src_files_h+=("$line"); done < <(ls mindspore/lite/src/*.h)
|
||||
common_files_h=()
|
||||
|
@ -132,7 +134,7 @@ getCommonFile() {
|
|||
mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/infer/common_infer.h
|
||||
mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/errorcode.h
|
||||
)
|
||||
all_files_h=("${include_h[@]}" "${src_files_h[@]}" "${common_files_h[@]}" "${runtime_files_h[@]}" "${others_files_h[@]}")
|
||||
all_files_h=("${include_h[@]}" "${regist_include_h[@]}" "${src_files_h[@]}" "${common_files_h[@]}" "${runtime_files_h[@]}" "${others_files_h[@]}")
|
||||
|
||||
# concat regx
|
||||
REMOVE_LISTS_STR="${all_files_h[0]}"
|
||||
|
@ -152,6 +154,8 @@ getCommonFile() {
|
|||
while IFS='' read -r line; do mindrt_files+=("$line"); done < <(ls ${MINDSPORE_HOME}/mindspore/core/mindrt/src/actor/*.cc)
|
||||
src_files=()
|
||||
while IFS='' read -r line; do src_files+=("$line"); done < <(ls ${MINDSPORE_HOME}/mindspore/lite/src/*.cc)
|
||||
regist_files=()
|
||||
while IFS='' read -r line; do regist_files+=("$line"); done < <(ls ${MINDSPORE_HOME}/mindspore/lite/src/registry/*.cc)
|
||||
common_files=()
|
||||
while IFS='' read -r line; do common_files+=("$line"); done < <(ls ${MINDSPORE_HOME}/mindspore/lite/src/common/*.cc)
|
||||
runtime_files_cc=()
|
||||
|
@ -169,7 +173,7 @@ getCommonFile() {
|
|||
"${MINDSPORE_HOME}"/mindspore/core/utils/status.cc
|
||||
"${MINDSPORE_HOME}"/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/infer/common_infer.c
|
||||
)
|
||||
all_files=("${src_files[@]}" "${common_files[@]}" "${runtime_files_cc[@]}"
|
||||
all_files=("${src_files[@]}" "${regist_files[@]}" "${common_files[@]}" "${runtime_files_cc[@]}"
|
||||
"${runtime_files_c[@]}" "${others_files_c[@]}" "${assembly_files[@]}" "${mindrt_files[@]}"
|
||||
"${cxx_api_files[@]}"
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue