提交 174d308c 编写于 作者: H hangq

add mindspore lite

上级 1f4222ed
...@@ -4,6 +4,20 @@ mindspore/lib ...@@ -4,6 +4,20 @@ mindspore/lib
output output
*.ir *.ir
# flatbuffer
mindspore/lite/tools/converter/parser/tflite/schema_generated.h
mindspore/lite/tools/converter/parser/caffe/caffe.pb.cc
mindspore/lite/tools/converter/parser/caffe/caffe.pb.h
mindspore/lite/tools/converter/parser/onnx/onnx.pb.h
mindspore/lite/tools/converter/parser/onnx/onnx.pb.h
mindspore/lite/tools/converter/schema/*.h
mindspore/lite/tools/converter/schema/inner
mindspore/lite/schema/*.h
mindspore/lite/schema/inner
mindspore/lite/src/runtime/kernel/opencl/cl/fp16/*.inc
mindspore/lite/src/runtime/kernel/opencl/cl/fp32/*.inc
# Cmake files # Cmake files
CMakeFiles/ CMakeFiles/
cmake_install.cmake cmake_install.cmake
...@@ -71,5 +85,3 @@ test_temp_summary_event_file/ ...@@ -71,5 +85,3 @@ test_temp_summary_event_file/
mindspore/version.py mindspore/version.py
mindspore/default_config.py mindspore/default_config.py
mindspore/.commit_id mindspore/.commit_id
onnx.proto
mindspore/ccsrc/onnx.proto
[submodule "third_party/flatbuffers"] [submodule "third_party/flatbuffers"]
path = third_party/flatbuffers path = third_party/flatbuffers
url = https://github.com/google/flatbuffers.git url = https://github.com/google/flatbuffers.git
ignore = all
[submodule "third_party/googletest"] [submodule "third_party/googletest"]
path = third_party/googletest path = third_party/googletest
url = https://github.com/google/googletest.git url = https://github.com/google/googletest.git
...@@ -10,9 +11,16 @@ ...@@ -10,9 +11,16 @@
[submodule "third_party/protobuf"] [submodule "third_party/protobuf"]
path = third_party/protobuf path = third_party/protobuf
url = https://github.com/protocolbuffers/protobuf.git url = https://github.com/protocolbuffers/protobuf.git
ignore = all
[submodule "akg"] [submodule "akg"]
path = akg path = akg
url = https://gitee.com/mindspore/akg.git url = https://gitee.com/mindspore/akg.git
[submodule "graphengine"] [submodule "graphengine"]
path = graphengine path = graphengine
url = https://gitee.com/mindspore/graphengine.git url = https://gitee.com/mindspore/graphengine.git
[submodule "third_party/OpenCL-CLHPP"]
path = third_party/OpenCL-CLHPP
url = https://github.com/KhronosGroup/OpenCL-CLHPP.git
[submodule "third_party/OpenCL-Headers"]
path = third_party/OpenCL-Headers
url = https://github.com/KhronosGroup/OpenCL-Headers.git
...@@ -25,7 +25,8 @@ usage() ...@@ -25,7 +25,8 @@ usage()
echo "Usage:" echo "Usage:"
echo "bash build.sh [-d] [-r] [-v] [-c on|off] [-t on|off] [-g on|off] [-h] [-b ge] [-m infer|train] \\" echo "bash build.sh [-d] [-r] [-v] [-c on|off] [-t on|off] [-g on|off] [-h] [-b ge] [-m infer|train] \\"
echo " [-a on|off] [-Q on|off] [-p on|off] [-i] [-L] [-R] [-D on|off] [-j[n]] [-e gpu|d|cpu] \\" echo " [-a on|off] [-Q on|off] [-p on|off] [-i] [-L] [-R] [-D on|off] [-j[n]] [-e gpu|d|cpu] \\"
echo " [-P on|off] [-z [on|off]] [-M on|off] [-V 9.2|10.1] [-I] [-K] [-B on|off] [-w on|off] [-E] [-l on|off]" echo " [-P on|off] [-z [on|off]] [-M on|off] [-V 9.2|10.1] [-I arm64|arm32|x86_64] [-K] \\"
echo " [-B on|off] [-w on|off] [-E] [-l on|off]"
echo "" echo ""
echo "Options:" echo "Options:"
echo " -d Debug mode" echo " -d Debug mode"
...@@ -51,7 +52,7 @@ usage() ...@@ -51,7 +52,7 @@ usage()
echo " -z Compile dataset & mindrecord, default on" echo " -z Compile dataset & mindrecord, default on"
echo " -M Enable MPI and NCCL for GPU training, gpu default on" echo " -M Enable MPI and NCCL for GPU training, gpu default on"
echo " -V Specify the minimum required cuda version, default CUDA 10.1" echo " -V Specify the minimum required cuda version, default CUDA 10.1"
echo " -I Compile predict, default off" echo " -I Compile lite"
echo " -K Compile with AKG, default on" echo " -K Compile with AKG, default on"
echo " -s Enable serving module, default off" echo " -s Enable serving module, default off"
echo " -w Enable acl module, default off" echo " -w Enable acl module, default off"
...@@ -93,9 +94,10 @@ checkopts() ...@@ -93,9 +94,10 @@ checkopts()
COMPILE_MINDDATA="on" COMPILE_MINDDATA="on"
ENABLE_MPI="off" ENABLE_MPI="off"
CUDA_VERSION="10.1" CUDA_VERSION="10.1"
COMPILE_PREDICT="off" COMPILE_LITE="off"
LITE_PLATFORM=""
SUPPORT_TRAIN="off"
USE_GLOG="on" USE_GLOG="on"
PREDICT_PLATFORM=""
ENABLE_AKG="on" ENABLE_AKG="on"
ENABLE_SERVING="off" ENABLE_SERVING="off"
ENABLE_ACL="off" ENABLE_ACL="off"
...@@ -240,13 +242,16 @@ checkopts() ...@@ -240,13 +242,16 @@ checkopts()
fi fi
;; ;;
I) I)
COMPILE_PREDICT="on" COMPILE_LITE="on"
if [[ "$OPTARG" == "arm64" ]]; then if [[ "$OPTARG" == "arm64" ]]; then
PREDICT_PLATFORM="arm64" LITE_PLATFORM="arm64"
elif [[ "$OPTARG" == "arm32" ]]; then
LITE_PLATFORM="arm32"
elif [[ "$OPTARG" == "x86_64" ]]; then elif [[ "$OPTARG" == "x86_64" ]]; then
PREDICT_PLATFORM="x86_64" ENABLE_CONVERTER="on"
LITE_PLATFORM="x86_64"
else else
echo "-I parameter must be arm64 or x86_64" echo "-I parameter must be arm64、arm32 or x86_64"
exit 1 exit 1
fi fi
;; ;;
...@@ -382,128 +387,247 @@ build_mindspore() ...@@ -382,128 +387,247 @@ build_mindspore()
echo "success to build mindspore project!" echo "success to build mindspore project!"
} }
build_predict() checkndk() {
{ if [ "${ANDROID_NDK}" ]; then
git submodule update --init --recursive third_party/incubator-tvm echo -e "\e[31mANDROID_NDK_PATH=$ANDROID_NDK \e[0m"
echo "start build predict project" else
echo -e "\e[31mplease set ANDROID_NDK_PATH in environment variable for example: export ANDROID_NDK=/root/usr/android-ndk-r20b/ \e[0m"
exit 1
fi
}
git submodule update --init --recursive third_party/flatbuffers gene_flatbuffer() {
git submodule update --init --recursive third_party/googletest FLAT_DIR="${BASEPATH}/mindspore/lite/schema"
git submodule update --init --recursive third_party/protobuf cd ${FLAT_DIR} && rm -rf "${FLAT_DIR}/inner" && mkdir -p "${FLAT_DIR}/inner"
find . -name "*.fbs" -print0 | xargs -0 "${FLATC}" -c -b
find . -name "*.fbs" -print0 | xargs -0 "${FLATC}" -c -b --reflect-types --gen-mutable --reflect-names --gen-object-api -o "${FLAT_DIR}/inner"
rm -rf "${BASEPATH}/predict/build" FLAT_DIR="${BASEPATH}/mindspore/lite/tools/converter/parser/tflite"
mkdir -pv "${BASEPATH}/predict/build" cd ${FLAT_DIR}
rm -rf "${BASEPATH}/predict/output" find . -name "*.fbs" -print0 | xargs -0 "${FLATC}" -c -b --reflect-types --gen-mutable --reflect-names --gen-object-api -o "${FLAT_DIR}/"
mkdir -pv "${BASEPATH}/predict/output" }
if [[ "$PREDICT_PLATFORM" == "arm64" ]]; then build_flatbuffer() {
if [ "${ANDROID_NDK}" ]; then cd ${BASEPATH}
echo -e "\e[31mANDROID_NDK_PATH=$ANDROID_NDK \e[0m" FLATC="${BASEPATH}"/third_party/flatbuffers/build/flatc
else if [[ ! -f "${FLATC}" ]]; then
echo -e "\e[31mplease set ANDROID_NDK_PATH in environment variable for example: export ANDROID_NDK=/root/usr/android-ndk-r16b/ \e[0m" git submodule update --init --recursive third_party/flatbuffers
exit 1 cd ${BASEPATH}/third_party/flatbuffers
fi rm -rf build && mkdir -pv build && cd build && cmake .. && make -j$THREAD_NUM
gene_flatbuffer
fi fi
if [[ "${INC_BUILD}" == "off" ]]; then
gene_flatbuffer
fi
}
#build flatbuf gene_protobuf() {
cd "${BASEPATH}/third_party/flatbuffers" PROTO_SRC_DIR="${BASEPATH}/mindspore/lite/tools/converter/parser/caffe"
rm -rf build && mkdir -p build && cd build && cmake .. && make -j$THREAD_NUM find ${PROTO_SRC_DIR} -name "*.proto" -print0 | xargs -0 "${PROTOC}" -I"${PROTO_SRC_DIR}" --cpp_out="${PROTO_SRC_DIR}"
FLATC="${BASEPATH}"/third_party/flatbuffers/build/flatc PROTO_SRC_DIR="${BASEPATH}/mindspore/lite/tools/converter/parser/onnx"
cd "${BASEPATH}"/predict/schema && mkdir -p "${BASEPATH}"/predict/schema/inner find ${PROTO_SRC_DIR} -name "*.proto" -print0 | xargs -0 "${PROTOC}" -I"${PROTO_SRC_DIR}" --cpp_out="${PROTO_SRC_DIR}"
find . -name "*.fbs" -print0 | xargs -0 "${FLATC}" -c -b }
find . -name "*.fbs" -print0 | xargs -0 "${FLATC}" -c -b --reflect-types --gen-mutable --reflect-names --gen-object-api -o ${BASEPATH}/predict/schema/inner
# check LLVM_PATH build_protobuf() {
if [ "${LLVM_PATH}" == "" ]; then cd ${BASEPATH}
echo "Please set LLVM_PATH in env for example export LLVM_PATH=/xxxx/bin/llvm-config" PROTOC="${BASEPATH}"/third_party/protobuf/build/bin/protoc
exit if [[ ! -f "${PROTOC}" ]]; then
git submodule update --init --recursive third_party/protobuf
cd ${BASEPATH}/third_party/protobuf
rm -rf build && mkdir -pv build && ./autogen.sh
./configure --prefix=${BASEPATH}/third_party/protobuf/build
make clean && make -j$THREAD_NUM && make install
gene_protobuf
fi
if [[ "${INC_BUILD}" == "off" ]]; then
gene_protobuf
fi fi
}
#build tvm build_gtest() {
tvm_open_source="${BASEPATH}/third_party/incubator-tvm" cd ${BASEPATH}
tvm_kernel_build="${BASEPATH}/predict/module/tvm_kernel" git submodule update --init --recursive third_party/googletest
if [ ! -f "${tvm_kernel_build}"/incubator-tvm/build/libtvm.so ]; then }
rm -fr "${tvm_kernel_build}"/incubator-tvm
cp -fr "${tvm_open_source}" "${tvm_kernel_build}" gene_clhpp() {
mkdir -p "${tvm_kernel_build}"/incubator-tvm/build CL_SRC_DIR="${BASEPATH}/mindspore/lite/src/runtime/kernel/opencl/cl"
patch -d "${tvm_kernel_build}"/incubator-tvm -p1 < "${BASEPATH}"/third_party/patch/predict/0001-RetBugFix-CustomRuntime_v06.patch for sub_dir in "${CL_SRC_DIR}"/*
cp "${tvm_kernel_build}"/lite/src/codegen/llvm/lite_rtfunc_reset.cc "${tvm_kernel_build}"/incubator-tvm/src/codegen/llvm/ do
cp "${tvm_open_source}"/cmake/config.cmake "${tvm_kernel_build}"/incubator-tvm data_type="$(basename ${sub_dir})"
if [ "${LLVM_PATH}" ]; then if [ ! -d ${CL_SRC_DIR}/${data_type} ]; then
sed -i "s#set(USE_LLVM .*)#set(USE_LLVM \"${LLVM_PATH}\")#g" "${tvm_kernel_build}"/incubator-tvm/config.cmake continue
else
echo "need set LLVM_PATH in env for example export LLVM_PATH=/xxxx/bin/llvm-config"
fi fi
cd "${tvm_kernel_build}"/incubator-tvm/build cd ${CL_SRC_DIR}/${data_type}
cmake .. rm -rf *.inc
make -j$THREAD_NUM echo "$(cd "$(dirname $0)"; pwd)"
for file_path in "${CL_SRC_DIR}/${data_type}"/*
do
file="$(basename ${file_path})"
inc_file=`echo ${CL_SRC_DIR}/${data_type}/${file} | sed 's/$/.inc/'`
sed 's/^/\"/;s/$/ \\n\" \\/' ${CL_SRC_DIR}/${data_type}/${file} > ${inc_file}
kernel_name=`echo ${file} | sed s'/.\{3\}$//'`
sed -i "1i\static const char *${kernel_name}_source_${data_type} =\"\\n\" \\" ${inc_file}
sed -i '$a\;' ${inc_file}
done
done
}
gene_ocl_program() {
CL_SRC_DIR="${BASEPATH}/mindspore/lite/src/runtime/kernel/opencl/cl"
SPIRV_DIR=build/spirv
rm -rf ${SPIRV_DIR}
mkdir -pv ${SPIRV_DIR}
for sub_dir in "${CL_SRC_DIR}"/*
do
data_type="$(basename ${sub_dir})"
if [ ! -d ${CL_SRC_DIR}/${data_type} ]; then
continue
fi
#echo $(cd "$(dirname $0)"; pwd)
for file_path in "${CL_SRC_DIR}/${data_type}"/*
do
file="$(basename ${file_path})"
if [ "${file##*.}" != "cl" ]; then
continue
fi
clang -Xclang -finclude-default-header -cl-std=CL2.0 --target=spir64-unknown-unknown -emit-llvm \
-c -O0 -o ${SPIRV_DIR}/${file%.*}.bc ${CL_SRC_DIR}/${data_type}/${file}
done
done
bcs=`ls ${SPIRV_DIR}/*.bc`
llvm-link ${bcs} -o ${SPIRV_DIR}/program.bc
llvm-spirv -o ${SPIRV_DIR}/program.spv ${SPIRV_DIR}/program.bc
CL_PROGRAM_PATH="${BASEPATH}/mindspore/lite/src/runtime/kernel/opencl/cl/program.inc"
echo "#include <vector>" > ${CL_PROGRAM_PATH}
echo "std::vector<unsigned char> g_program_binary = {" >> ${CL_PROGRAM_PATH}
#hexdump -v -e '16/1 "0x%02x, " "\n"' ${SPIRV_DIR}/program.spv >> ${CL_PROGRAM_PATH}
hexdump -v -e '1/1 "0x%02x, "' ${SPIRV_DIR}/program.spv >> ${CL_PROGRAM_PATH}
echo "};" >> ${CL_PROGRAM_PATH}
echo "Compile SPIRV done"
}
build_opencl() {
cd ${BASEPATH}
git submodule update --init third_party/OpenCL-Headers
git submodule update --init third_party/OpenCL-CLHPP
if [[ "${OPENCL_OFFLINE_COMPILE}" == "on" ]]; then
gene_ocl_program
else else
cd "${tvm_kernel_build}"/incubator-tvm/build gene_clhpp
make -j$THREAD_NUM
fi fi
}
#gen op build_lite()
predict_tvm_op_lib_path="${BASEPATH}/predict/module/tvm_kernel/build/lib_x86" {
predict_platform="x86" echo "start build mindspore lite project"
if [[ "$PREDICT_PLATFORM" == "arm64" ]]; then
predict_tvm_op_lib_path="${BASEPATH}/predict/module/tvm_kernel/build/lib_arm64"
predict_platform="arm64"
fi
need_get_libs=true if [[ "${ENABLE_GPU}" == "on" ]]; then
if [ -d "${predict_tvm_op_lib_path}" ]; then build_opencl
file_list=$(ls "${predict_tvm_op_lib_path}")
if [ -n "${file_list}" ]; then
libstime=$(stat -c %Y "${predict_tvm_op_lib_path}"/* | sort -u | tail -n1)
pythontime=$(find "${BASEPATH}"/predict/module/tvm_kernel/lite/python/ -name "*.py" -exec stat -c %Y {} \; |
sort -u | tail -n1)
if [ "${libstime}" -ge "${pythontime}" ]; then
need_get_libs=false
else
rm -fr "${predict_tvm_op_lib_path}"
fi
fi
fi fi
if [[ "${LITE_PLATFORM}" == "x86_64" ]]; then
if $need_get_libs; then build_protobuf
PYTHONPATH_OLD=${PYTHONPATH}
export PYTHONPATH="${tvm_kernel_build}/incubator-tvm/python:${tvm_kernel_build}/incubator-tvm/topi/python:${tvm_kernel_build}/incubator-tvm/nnvm/python:${tvm_kernel_build}/lite/python:"
cd "${BASEPATH}"/predict/module/tvm_kernel/lite/python/at_ops
python3 at_gen_strip.py ${predict_platform}
export PYTHONPATH=${PYTHONPATH_OLD}
fi fi
build_flatbuffer
build_gtest
cd "${BASEPATH}/predict/build" cd "${BASEPATH}/mindspore/lite"
if [[ "$PREDICT_PLATFORM" == "arm64" ]]; then mkdir -pv build
cmake -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" \ cd build
-DANDROID_NATIVE_API_LEVEL=android-19 -DANDROID_NDK="${ANDROID_NDK}" \ BUILD_TYPE="Release"
-DANDROID_TOOLCHAIN_NAME="aarch64-linux-android-clang" -DANDROID_STL="c++_shared" \ if [[ "${DEBUG_MODE}" == "on" ]]; then
-DANDROID_ABI="arm64-v8a" -DENABLE_PREDICT_ARM64=ON -DANDROID_ALLOW_UNDEFINED_SYMBOLS=TRUE .. BUILD_TYPE="Debug"
elif [[ "$PREDICT_PLATFORM" == "x86_64" ]]; then
cmake ..
fi fi
make ${VERBOSE} -j$THREAD_NUM if [[ "${LITE_PLATFORM}" == "arm64" ]]; then
if [[ "$PREDICT_PLATFORM" == "x86_64" ]]; then checkndk
cd "${BASEPATH}/predict/build/test" && ./run_tests.sh cmake -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" -DANDROID_NATIVE_API_LEVEL="19" \
-DANDROID_NDK="${ANDROID_NDK}" -DANDROID_ABI="arm64-v8a" -DANDROID_TOOLCHAIN_NAME="aarch64-linux-android-clang" \
-DANDROID_STL="c++_shared" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DSUPPORT_TRAIN=${SUPPORT_TRAIN} \
-DBUILD_DEVICE=on -DPLATFORM_ARM64=on -DBUILD_CONVERTER=off -DENABLE_NEON=on -DENABLE_FP16="off" \
-DSUPPORT_GPU=${ENABLE_GPU} -DOFFLINE_COMPILE=${OPENCL_OFFLINE_COMPILE} "${BASEPATH}/mindspore/lite"
elif [[ "${LITE_PLATFORM}" == "arm32" ]]; then
checkndk
cmake -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" -DANDROID_NATIVE_API_LEVEL="19" \
-DANDROID_NDK="${ANDROID_NDK}" -DANDROID_ABI="armeabi-v7a" -DANDROID_TOOLCHAIN_NAME="clang" \
-DANDROID_STL="c++_shared" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DBUILD_DEVICE=on -DPLATFORM_ARM32=on -DENABLE_NEON=on -DSUPPORT_TRAIN=${SUPPORT_TRAIN} -DBUILD_CONVERTER=off \
-DSUPPORT_GPU=${ENABLE_GPU} -DOFFLINE_COMPILE=${OPENCL_OFFLINE_COMPILE} "${BASEPATH}/mindspore/lite"
else
cmake -DBUILD_DEVICE=on -DPLATFORM_ARM64=off -DBUILD_CONVERTER=${ENABLE_CONVERTER} -DSUPPORT_TRAIN=${SUPPORT_TRAIN} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DSUPPORT_GPU=${ENABLE_GPU} -DOFFLINE_COMPILE=${OPENCL_OFFLINE_COMPILE} "${BASEPATH}/mindspore/lite"
fi fi
VERBOSE=2 make -j$THREAD_NUM
COMPILE_RET=$?
# copy securec include files if [[ "${COMPILE_RET}" -ne 0 ]]; then
mkdir -p "${BASEPATH}/predict/output/include/securec/include" echo "---------------- mindspore lite: build failed ----------------"
cp "${BASEPATH}"/third_party/securec/include/* "${BASEPATH}"/predict/output/include/securec/include else
mkdir -pv ${BASEPATH}/mindspore/lite/output/
cd "${BASEPATH}/predict/output/" if [[ "$LITE_PLATFORM" == "x86_64" ]]; then
if [[ "$PREDICT_PLATFORM" == "x86_64" ]]; then OUTPUT_DIR=${BASEPATH}/mindspore/lite/output/MSLite-0.5.0-linux_x86_64
tar -cf MSPredict-0.5.0-linux_x86_64.tar.gz include/ lib/ --warning=no-file-changed rm -rf ${OUTPUT_DIR} && mkdir -p ${OUTPUT_DIR} && cd ${OUTPUT_DIR}
elif [[ "$PREDICT_PLATFORM" == "arm64" ]]; then mkdir -p ${OUTPUT_DIR}/converter && mkdir -p ${OUTPUT_DIR}/time_profile
tar -cf MSPredict-0.5.0-linux_aarch64.tar.gz include/ lib/ --warning=no-file-changed mkdir -p ${OUTPUT_DIR}/benchmark && mkdir -p ${OUTPUT_DIR}/include && mkdir -p ${OUTPUT_DIR}/lib
mkdir -p ${OUTPUT_DIR}/third_party
cp ${BASEPATH}/mindspore/lite/build/tools/converter/converter_lite ${OUTPUT_DIR}/converter/
cp ${BASEPATH}/mindspore/lite/build/tools/benchmark/benchmark ${OUTPUT_DIR}/benchmark/
cp ${BASEPATH}/mindspore/lite/include/*.h ${OUTPUT_DIR}/include/
mkdir -p ${OUTPUT_DIR}/include/ir/dtype/
cp ${BASEPATH}/mindspore/core/ir/dtype/type_id.h ${OUTPUT_DIR}/include/ir/dtype/
mkdir -p ${OUTPUT_DIR}/include/schema/
cp ${BASEPATH}/mindspore/lite/schema/*.h ${OUTPUT_DIR}/include/schema/
cp ${BASEPATH}/mindspore/lite/build/src/libmindspore-lite.so ${OUTPUT_DIR}/lib/
mkdir -p ${OUTPUT_DIR}/third_party/protobuf/lib
cp -r ${BASEPATH}/third_party/protobuf/build/include/ ${OUTPUT_DIR}/third_party/protobuf/
cp -r ${BASEPATH}/third_party/protobuf/build/lib/libprotobuf.so.19 ${OUTPUT_DIR}/third_party/protobuf/lib/
cp -r ${BASEPATH}/third_party/protobuf/build/lib/libprotobuf.so.19.0.0 ${OUTPUT_DIR}/third_party/protobuf/lib/
mkdir -p ${OUTPUT_DIR}/third_party/flatbuffers
cp -r ${BASEPATH}/third_party/flatbuffers/include/ ${OUTPUT_DIR}/third_party/flatbuffers/
cd ..
tar -cf MSLite-0.5.0-linux_x86_64.tar.gz MSLite-0.5.0-linux_x86_64/ --warning=no-file-changed
elif [[ "$LITE_PLATFORM" == "arm64" ]]; then
OUTPUT_DIR=${BASEPATH}/mindspore/lite/output/MSLite-0.5.0-linux_arm64
rm -rf ${OUTPUT_DIR} && mkdir -p ${OUTPUT_DIR} && cd ${OUTPUT_DIR}
mkdir -p ${OUTPUT_DIR}/time_profile && mkdir -p ${OUTPUT_DIR}/benchmark
mkdir -p ${OUTPUT_DIR}/include && mkdir -p ${OUTPUT_DIR}/lib
mkdir -p ${OUTPUT_DIR}/third_party
cp ${BASEPATH}/mindspore/lite/build/tools/benchmark/benchmark ${OUTPUT_DIR}/benchmark/
cp ${BASEPATH}/mindspore/lite/include/*.h ${OUTPUT_DIR}/include/
mkdir -p ${OUTPUT_DIR}/include/ir/dtype/
cp ${BASEPATH}/mindspore/core/ir/dtype/type_id.h ${OUTPUT_DIR}/include/ir/dtype/
mkdir -p ${OUTPUT_DIR}/include/schema/
cp ${BASEPATH}/mindspore/lite/schema/*.h ${OUTPUT_DIR}/include/schema/
cp ${BASEPATH}/mindspore/lite/build/src/libmindspore-lite.so ${OUTPUT_DIR}/lib/
mkdir -p ${OUTPUT_DIR}/third_party/flatbuffers
cp -r ${BASEPATH}/third_party/flatbuffers/include/ ${OUTPUT_DIR}/third_party/flatbuffers/
cd ..
tar -cf MSLite-0.5.0-linux_arm64.tar.gz MSLite-0.5.0-linux_arm64/ --warning=no-file-changed
elif [[ "$LITE_PLATFORM" == "arm32" ]]; then
OUTPUT_DIR=${BASEPATH}/mindspore/lite/output/MSLite-0.5.0-linux_arm32
rm -rf ${OUTPUT_DIR} && mkdir -p ${OUTPUT_DIR} && cd ${OUTPUT_DIR}
mkdir -p ${OUTPUT_DIR}/time_profile && mkdir -p ${OUTPUT_DIR}/benchmark
mkdir -p ${OUTPUT_DIR}/include && mkdir -p ${OUTPUT_DIR}/lib
mkdir -p ${OUTPUT_DIR}/third_party
cp ${BASEPATH}/mindspore/lite/build/tools/benchmark/benchmark ${OUTPUT_DIR}/benchmark/
cp ${BASEPATH}/mindspore/lite/include/*.h ${OUTPUT_DIR}/include/
mkdir -p ${OUTPUT_DIR}/include/ir/dtype/
cp ${BASEPATH}/mindspore/core/ir/dtype/type_id.h ${OUTPUT_DIR}/include/ir/dtype/
mkdir -p ${OUTPUT_DIR}/include/schema/
cp ${BASEPATH}/mindspore/lite/schema/*.h ${OUTPUT_DIR}/include/schema/
cp ${BASEPATH}/mindspore/lite/build/src/libmindspore-lite.so ${OUTPUT_DIR}/lib/
mkdir -p ${OUTPUT_DIR}/third_party/flatbuffers
cp -r ${BASEPATH}/third_party/flatbuffers/include/ ${OUTPUT_DIR}/third_party/flatbuffers/
cd ..
tar -cf MSLite-0.5.0-linux_arm32.tar.gz MSLite-0.5.0-linux_arm32/ --warning=no-file-changed
fi
echo "---------------- mindspore lite: build success ----------------"
fi fi
echo "success to build predict project!"
} }
if [[ "X$COMPILE_PREDICT" = "Xon" ]]; then if [[ "X$COMPILE_LITE" = "Xon" ]]; then
build_predict build_lite
echo "---------------- mindspore: build end ----------------"
exit exit
else else
build_mindspore build_mindspore
......
file(GLOB_RECURSE _IR_SRC_LIST ./*.cc dtype/*.cc) file(GLOB_RECURSE _IR_SRC_LIST ./*.cc dtype/*.cc)
file(GLOB_RECURSE _IR_LITE_SRC_FILES
./lite/tensor.cc
)
list(REMOVE_ITEM _IR_SRC_LIST ${_IR_LITE_SRC_FILES})
set_property(SOURCE ${_IR_SRC_LIST} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_IR) set_property(SOURCE ${_IR_SRC_LIST} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_IR)
add_library(_mindspore_ir_obj OBJECT ${_IR_SRC_LIST}) add_library(_mindspore_ir_obj OBJECT ${_IR_SRC_LIST})
/**
* Copyright 2020 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.
*/
#include <vector>
#include <utility>
#include "ir/lite/tensor.h"
#include "securec/include/securec.h"
namespace mindspore {
namespace tensor {
#define kMaxMallocSize 1024 * 1024 * 100
Tensor::Tensor(const TypeId data_type, const std::vector<int> &shape) : MetaTensor(data_type, shape) {}
Tensor::Tensor(const TypePtr &type_ptr, const std::vector<int> &shape) : MetaTensor(type_ptr, shape) {}
Tensor::Tensor(const Tensor &tensor) : MetaTensor(tensor) {
this->data_type_ = tensor.data_type_;
this->shape_ = tensor.shape_;
auto ret = CopyTensorData(tensor);
if (0 != ret) {
MS_LOG(EXCEPTION) << "CopyTensorData error";
}
}
int Tensor::CopyTensorData(const Tensor &srcTensor) {
if (srcTensor.data_ == nullptr) {
MS_LOG(ERROR) << "data of srcTensor is nullptr";
return -1;
}
size_t data_size = this->Size();
MS_ASSERT(data_size == tensor.Size());
if (this->data_ == nullptr) {
if (data_size > kMaxMallocSize) {
MS_LOG(ERROR) << "Malloc size is too big while coping data, " << data_size << " bytes";
return -1;
}
this->data_ = malloc(data_size);
}
memcpy_s(this->data_, data_size, tensor.data_, tensor.Size());
return 0;
}
Tensor::~Tensor() {
if (nullptr != this->data_) {
free(this->data_);
}
}
Tensor &Tensor::operator=(const Tensor &tensor) {
if (&tensor == this) {
return *this;
}
this->shape_ = tensor.shape_;
this->data_type_ = tensor.data_type_;
auto ret = CopyTensorData(tensor);
if (0 != ret) {
MS_LOG(EXCEPTION) << "CopyTensorData error";
}
return *this;
}
bool Tensor::operator==(const Tensor &tensor) {
return data_ == tensor.data_ && shape_ == tensor.shape_ && data_type_ == tensor.data_type_;
}
bool Tensor::operator==(const Value &other) const {
if (other.isa<Tensor>()) {
auto other_ = static_cast<const Tensor &>(other);
return *this == other_;
} else {
return false;
}
}
} // namespace tensor
} // namespace mindspore
...@@ -75,8 +75,6 @@ int MetaTensor::ElementsNum() const { ...@@ -75,8 +75,6 @@ int MetaTensor::ElementsNum() const {
return std::accumulate(shape_.begin(), shape_.end(), 1LL, std::multiplies<int>()); return std::accumulate(shape_.begin(), shape_.end(), 1LL, std::multiplies<int>());
} }
TypePtr MetaTensor::Dtype() const { return TypeIdToType(data_type_); }
TypePtr MetaTensor::SetDtype(const TypePtr type_ptr) { TypePtr MetaTensor::SetDtype(const TypePtr type_ptr) {
if (type_ptr == nullptr) { if (type_ptr == nullptr) {
MS_LOG(ERROR) << "Dtype to be set is nullptr."; MS_LOG(ERROR) << "Dtype to be set is nullptr.";
......
...@@ -37,5 +37,7 @@ abstract::AbstractBasePtr MetaTensor::ToAbstract() { ...@@ -37,5 +37,7 @@ abstract::AbstractBasePtr MetaTensor::ToAbstract() {
abs_tensor->set_value(shared_from_base<MetaTensor>()); abs_tensor->set_value(shared_from_base<MetaTensor>());
return abs_tensor; return abs_tensor;
} }
TypePtr MetaTensor::Dtype() const { return TypeIdToType(data_type_); }
} // namespace tensor } // namespace tensor
} // namespace mindspore } // namespace mindspore
...@@ -31,7 +31,7 @@ class ParamValue { ...@@ -31,7 +31,7 @@ class ParamValue {
ParamValue(const ParamValue &other) = default; ParamValue(const ParamValue &other) = default;
~ParamValue() = default; virtual ~ParamValue() = default;
tensor::MetaTensorPtr value() const { return value_; } tensor::MetaTensorPtr value() const { return value_; }
void set_value(const tensor::MetaTensorPtr &value) { value_ = value; } void set_value(const tensor::MetaTensorPtr &value) { value_ = value; }
......
...@@ -17,11 +17,15 @@ ...@@ -17,11 +17,15 @@
#include "utils/log_adapter.h" #include "utils/log_adapter.h"
#include <unistd.h> #include <unistd.h>
#include <sys/time.h>
#include <map> #include <map>
#ifndef USE_ANDROID_LOG
#include "debug/trace.h" #include "debug/trace.h"
#endif
// namespace to support utils module definition // namespace to support utils module definition
namespace mindspore { namespace mindspore {
#ifndef USE_ANDROID_LOG
#ifdef USE_GLOG #ifdef USE_GLOG
static std::string GetTime() { static std::string GetTime() {
#define BUFLEN 80 #define BUFLEN 80
...@@ -125,6 +129,7 @@ static int GetSlogLevel(MsLogLevel level) { ...@@ -125,6 +129,7 @@ static int GetSlogLevel(MsLogLevel level) {
} }
} }
#endif #endif
#endif
static std::string ExceptionTypeToString(ExceptionType type) { static std::string ExceptionTypeToString(ExceptionType type) {
#define _TO_STRING(x) #x #define _TO_STRING(x) #x
...@@ -184,7 +189,24 @@ static const char *GetSubModuleName(SubModuleId module_id) { ...@@ -184,7 +189,24 @@ static const char *GetSubModuleName(SubModuleId module_id) {
return sub_module_names[module_id % NUM_SUBMODUES]; return sub_module_names[module_id % NUM_SUBMODUES];
} }
const char *EnumStrForMsLogLevel(MsLogLevel level) {
if (level == DEBUG) {
return "DEBUG";
} else if (level == INFO) {
return "INFO";
} else if (level == WARNING) {
return "WARNING";
} else if (level == ERROR) {
return "ERROR";
} else if (level == EXCEPTION) {
return "EXCEPTION";
} else {
return "NO_LEVEL";
}
}
void LogWriter::OutputLog(const std::ostringstream &msg) const { void LogWriter::OutputLog(const std::ostringstream &msg) const {
#ifndef USE_ANDROID_LOG
#ifdef USE_GLOG #ifdef USE_GLOG
auto submodule_name = GetSubModuleName(submodule_); auto submodule_name = GetSubModuleName(submodule_);
google::LogMessage("", 0, GetGlogLevel(log_level_)).stream() google::LogMessage("", 0, GetGlogLevel(log_level_)).stream()
...@@ -197,6 +219,10 @@ void LogWriter::OutputLog(const std::ostringstream &msg) const { ...@@ -197,6 +219,10 @@ void LogWriter::OutputLog(const std::ostringstream &msg) const {
Dlog(static_cast<int>(slog_module_id), GetSlogLevel(log_level_), "[%s:%d] %s] %s", location_.file_, location_.line_, Dlog(static_cast<int>(slog_module_id), GetSlogLevel(log_level_), "[%s:%d] %s] %s", location_.file_, location_.line_,
location_.func_, str_msg.c_str()); location_.func_, str_msg.c_str());
#endif #endif
#else
printf("%s [%s:%d] %s] %s\n:", EnumStrForMsLogLevel(log_level_), location_.file_, location_.line_, location_.func_,
msg.str().c_str());
#endif
} }
void LogWriter::operator<(const LogStream &stream) const noexcept { void LogWriter::operator<(const LogStream &stream) const noexcept {
...@@ -218,8 +244,10 @@ void LogWriter::operator^(const LogStream &stream) const { ...@@ -218,8 +244,10 @@ void LogWriter::operator^(const LogStream &stream) const {
} }
oss << msg.str(); oss << msg.str();
#ifndef USE_ANDROID_LOG
trace::TraceGraphEval(); trace::TraceGraphEval();
trace::GetEvalStackInfo(oss); trace::GetEvalStackInfo(oss);
#endif
if (exception_handler_ != nullptr) { if (exception_handler_ != nullptr) {
exception_handler_(exception_type_, oss.str()); exception_handler_(exception_type_, oss.str());
......
...@@ -25,11 +25,13 @@ ...@@ -25,11 +25,13 @@
#include <functional> #include <functional>
#include "utils/overload.h" #include "utils/overload.h"
#include "./securec.h" #include "./securec.h"
#ifndef USE_ANDROID_LOG
#ifdef USE_GLOG #ifdef USE_GLOG
#include "glog/logging.h" #include "glog/logging.h"
#else #else
#include "toolchain/slog.h" #include "toolchain/slog.h"
#endif #endif
#endif
// NOTICE: when relative path of 'log_adapter.h' changed, macro 'LOG_HDR_FILE_REL_PATH' must be changed // NOTICE: when relative path of 'log_adapter.h' changed, macro 'LOG_HDR_FILE_REL_PATH' must be changed
#define LOG_HDR_FILE_REL_PATH "mindspore/core/utils/log_adapter.h" #define LOG_HDR_FILE_REL_PATH "mindspore/core/utils/log_adapter.h"
...@@ -129,6 +131,8 @@ enum SubModuleId : int { ...@@ -129,6 +131,8 @@ enum SubModuleId : int {
#define SUBMODULE_ID mindspore::SubModuleId::SM_ME #define SUBMODULE_ID mindspore::SubModuleId::SM_ME
#endif #endif
const char *EnumStrForMsLogLevel(MsLogLevel level);
#if defined(_WIN32) || defined(_WIN64) #if defined(_WIN32) || defined(_WIN64)
extern int g_ms_submodule_log_levels[] __attribute__((dllexport)); extern int g_ms_submodule_log_levels[] __attribute__((dllexport));
#else #else
......
cmake_minimum_required(VERSION 3.14)
project (Lite)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3.0)
message(FATAL_ERROR "GCC vesion ${CMAKE_CXX_COMPILER_VERSION} must not be less than 7.3.0")
endif ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
set(TOP_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../..)
set(CORE_DIR ${TOP_DIR}/mindspore/core)
set(CCSRC_DIR ${TOP_DIR}/mindspore/ccsrc)
include_directories(${TOP_DIR})
include_directories(${CORE_DIR})
include_directories(${CCSRC_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${TOP_DIR}/third_party)
include_directories(${TOP_DIR}/third_party/flatbuffers/include)
include(${TOP_DIR}/cmake/utils.cmake)
include(${TOP_DIR}/cmake/external_libs/json.cmake)
include(${TOP_DIR}/cmake/dependency_securec.cmake)
set(CMAKE_VERBOSE_MAKEFILE on)
add_compile_definitions(USE_ANDROID_LOG)
add_compile_definitions(NO_DLIB)
add_compile_options(-fPIC)
option(BUILD_DEVICE "if build device" on)
option(SUPPORT_TRAIN "if build for on-device train" off)
option(PLATFORM_ARM64 "if build device for arm64" off)
option(PLATFORM_ARM32 "if build device for arm32" off)
option(BUILD_CONVERTER "if build converter" on)
option(ENABLE_FP16 "if build fp16 ops" off)
option(SUPPORT_GPU "if support gpu" off)
option(OFFLINE_COMPILE "if offline compile OpenCL kernel" off)
if (BUILD_DEVICE)
add_compile_definitions(BUILD_DEVICE)
endif()
if (SUPPORT_TRAIN)
add_compile_definitions(SUPPORT_TRAIN)
endif()
if (ENABLE_NEON)
add_compile_definitions(ENABLE_NEON)
endif ()
if (ENABLE_FP16)
add_compile_definitions(ENABLE_FP16)
endif ()
if (SUPPORT_GPU)
add_definitions(-DUSE_OPENCL_WRAPPER)
add_definitions(-DMS_OPENCL_PROFILE=false)
add_definitions(-DCL_HPP_TARGET_OPENCL_VERSION=200)
add_compile_definitions(SUPPORT_GPU)
if(OFFLINE_COMPILE)
add_compile_definitions(PROGRAM_WITH_IL)
endif()
include_directories(${TOP_DIR}/third_party/OpenCL-Headers)
include_directories(${TOP_DIR}/third_party/OpenCL-CLHPP/include)
endif()
set(ANF_SRC
${CMAKE_CURRENT_SOURCE_DIR}/../core/ir/meta_tensor.cc
${CCSRC_DIR}/gvar/logging_level.cc
${CCSRC_DIR}/gvar/typeid_manager.cc
${CMAKE_CURRENT_SOURCE_DIR}/../core/base/base.cc
${CMAKE_CURRENT_SOURCE_DIR}/../core/utils/log_adapter.cc
)
if (BUILD_CONVERTER)
if (PLATFORM_ARM64 OR PLATFORM_ARM32)
MESSAGE(FATAL_ERROR "Cannot build converter in arm platform")
endif()
find_package(Python3 3.7 COMPONENTS Interpreter Development)
if(Python3_FOUND)
set(PYTHON_INCLUDE_DIRS "${Python3_INCLUDE_DIRS}")
set(PYTHON_LIBRARIES "${Python3_LIBRARIES}")
if (WIN32)
if (Python3_DIR)
message("Python3_DIR set already: " ${Python3_DIR})
else()
string(LENGTH ${PYTHON_LIBRARIES} PYTHON_LIBRARIES_LEN)
string(LENGTH "libpythonxx.a" Python3_NAME_LEN)
math(EXPR Python3_DIR_LEN ${PYTHON_LIBRARIES_LEN}-${Python3_NAME_LEN})
string(SUBSTRING ${Python3_LIBRARIES} 0 ${Python3_DIR_LEN} Python3_DIR)
message("Python3_DIR: " ${Python3_DIR})
endif()
link_directories(${Python3_DIR})
endif()
else()
find_python_package(py_inc py_lib)
set(PYTHON_INCLUDE_DIRS "${py_inc}")
set(PYTHON_LIBRARIES "${py_lib}")
endif()
include_directories(${PYTHON_INCLUDE_DIRS})
include(${TOP_DIR}/cmake/external_libs/pybind11.cmake)
include(${TOP_DIR}/cmake/external_libs/eigen.cmake)
include_directories(${TOP_DIR}/third_party/protobuf/build/include)
link_directories(${TOP_DIR}/third_party/protobuf/build/lib)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tools/converter)
add_subdirectory(src/common/anf_exporter)
endif()
if (BUILD_DEVICE)
if (PLATFORM_ARM32 OR PLATFORM_ARM64)
if (NOT DEFINED ENV{ANDROID_NDK})
message(FATAL_ERROR "env ANDROID_NDK should be setted for ARM compile")
endif()
add_compile_definitions(ENABLE_ARM)
endif()
if (PLATFORM_ARM32)
add_definitions(-mfloat-abi=softfp -mfpu=neon)
add_compile_definitions(ENABLE_ARM32)
endif()
if (PLATFORM_ARM64)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=armv8.2-a+dotprod+fp16")
add_compile_definitions(ENABLE_ARM64)
endif()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tools/benchmark)
# add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test)
endif()
#!/usr/bin/env bash
set -e
CUR_DIR=$(cd "$(dirname $0)"; pwd)
BASE_DIR=${CUR_DIR}/../../
usage()
{
echo "Usage:"
echo "bash build.sh [-d] [-a arm64|arm32] [-j[n]] [-m] [-f] [-g] [-c] [-s] [-o]"
echo ""
echo "Options:"
echo " -d Enable Debug"
echo " -c Enable compile converter, default off"
echo " -m Enable Incremental compilation"
echo " -a Select ARM platform, default off"
echo " -j[n] Set the threads when building, default: -j8"
echo " -f Compile fp16 ops"
echo " -g Enable gpu compile"
echo " -s Support train"
echo " -o Offline compile OpenCL kernel"
}
checkopts()
{
# Init default values of build options
THREAD_NUM="8"
BUILD_TYPE="Release"
BUILD_DEVICE_PLATFORM="off"
MAKE_ONLY="off"
ENABLE_FP16="off"
ENABLE_GPU="off"
ENABLE_CONVERTER="off"
SUPPORT_TRAIN="off"
OFFLINE_COMPILE="off"
# Process the options
while getopts 'j:da:mfcsgo' opt
do
OPTARG=$(echo ${OPTARG} | tr '[A-Z]' '[a-z]')
case "${opt}" in
m)
MAKE_ONLY="on"
echo "Incremental compilation"
;;
d)
BUILD_TYPE="Debug"
echo "Build Debug version"
;;
j)
THREAD_NUM=$OPTARG
;;
a)
if [[ "X$OPTARG" == "Xarm64" ]]; then
BUILD_DEVICE_PLATFORM="arm64"
echo "Enable arm64"
elif [[ "X$OPTARG" == "Xarm32" ]]; then
BUILD_DEVICE_PLATFORM="arm32"
echo "Enable arm32"
else
echo "-I parameter must be arm64 or arm32"
exit 1
fi
;;
c)
ENABLE_CONVERTER="on"
echo "Enable converter"
;;
s)
SUPPORT_TRAIN="on"
echo "Support train"
;;
f)
ENABLE_FP16="on"
echo "Enable fp16"
;;
g)
ENABLE_GPU="on"
echo "Enable gpu"
;;
o)
OFFLINE_COMPILE="on"
echo "OpenCL kernel offline compile"
;;
*)
echo "Unknown option ${opt}!"
usage
exit 1
esac
done
}
checkndk() {
if [ "${ANDROID_NDK}" ]; then
echo -e "\e[31mANDROID_NDK_PATH=$ANDROID_NDK \e[0m"
else
echo -e "\e[31mplease set ANDROID_NDK_PATH in environment variable for example: export ANDROID_NDK=/root/usr/android-ndk-r16b/ \e[0m"
exit 1
fi
}
gene_flatbuffer() {
FLAT_DIR="${BASE_DIR}/mindspore/lite/schema"
cd ${FLAT_DIR} && rm -rf "${FLAT_DIR}/inner" && mkdir -p "${FLAT_DIR}/inner"
find . -name "*.fbs" -print0 | xargs -0 "${FLATC}" -c -b
find . -name "*.fbs" -print0 | xargs -0 "${FLATC}" -c -b --reflect-types --gen-mutable --reflect-names --gen-object-api -o "${FLAT_DIR}/inner"
FLAT_DIR="${BASE_DIR}/mindspore/lite/tools/converter/parser/tflite"
cd ${FLAT_DIR}
find . -name "*.fbs" -print0 | xargs -0 "${FLATC}" -c -b --reflect-types --gen-mutable --reflect-names --gen-object-api -o "${FLAT_DIR}/"
}
build_flatbuffer() {
cd ${BASE_DIR}
FLATC="${BASE_DIR}"/third_party/flatbuffers/build/flatc
if [[ ! -f "${FLATC}" ]]; then
git submodule update --init --recursive third_party/flatbuffers
cd ${BASE_DIR}/third_party/flatbuffers
rm -rf build && mkdir -pv build && cd build && cmake .. && make -j$THREAD_NUM
gene_flatbuffer
fi
if [[ "${MAKE_ONLY}" == "off" ]]; then
gene_flatbuffer
fi
}
gene_protobuf() {
PROTO_SRC_DIR="${BASE_DIR}/mindspore/lite/tools/converter/parser/caffe"
find ${PROTO_SRC_DIR} -name "*.proto" -print0 | xargs -0 "${PROTOC}" -I"${PROTO_SRC_DIR}" --cpp_out="${PROTO_SRC_DIR}"
PROTO_SRC_DIR="${BASE_DIR}/mindspore/lite/tools/converter/parser/onnx"
find ${PROTO_SRC_DIR} -name "*.proto" -print0 | xargs -0 "${PROTOC}" -I"${PROTO_SRC_DIR}" --cpp_out="${PROTO_SRC_DIR}"
}
build_protobuf() {
cd ${BASE_DIR}
PROTOC="${BASE_DIR}"/third_party/protobuf/build/bin/protoc
if [[ ! -f "${PROTOC}" ]]; then
git submodule update --init --recursive third_party/protobuf
cd ${BASE_DIR}/third_party/protobuf
rm -rf build && mkdir -pv build && ./autogen.sh
./configure --prefix=${BASE_DIR}/third_party/protobuf/build
make clean && make -j$THREAD_NUM && make install
gene_protobuf
fi
if [[ "${MAKE_ONLY}" == "off" ]]; then
gene_protobuf
fi
}
build_gtest() {
cd ${BASE_DIR}
git submodule update --init --recursive third_party/googletest
}
gene_clhpp() {
CL_SRC_DIR="${BASE_DIR}/mindspore/lite/src/runtime/kernel/opencl/cl"
for sub_dir in "${CL_SRC_DIR}"/*
do
data_type="$(basename ${sub_dir})"
if [ ! -d ${CL_SRC_DIR}/${data_type} ]; then
continue
fi
cd ${CL_SRC_DIR}/${data_type}
rm -rf *.inc
echo "$(cd "$(dirname $0)"; pwd)"
for file_path in "${CL_SRC_DIR}/${data_type}"/*
do
file="$(basename ${file_path})"
inc_file=`echo ${CL_SRC_DIR}/${data_type}/${file} | sed 's/$/.inc/'`
sed 's/^/\"/;s/$/ \\n\" \\/' ${CL_SRC_DIR}/${data_type}/${file} > ${inc_file}
kernel_name=`echo ${file} | sed s'/.\{3\}$//'`
sed -i "1i\static const char *${kernel_name}_source_${data_type} =\"\\n\" \\" ${inc_file}
sed -i '$a\;' ${inc_file}
done
done
}
gene_ocl_program() {
CL_SRC_DIR="${BASE_DIR}/mindspore/lite/src/runtime/kernel/opencl/cl"
SPIRV_DIR=build/spirv
rm -rf ${SPIRV_DIR}
mkdir -pv ${SPIRV_DIR}
for sub_dir in "${CL_SRC_DIR}"/*
do
data_type="$(basename ${sub_dir})"
if [ ! -d ${CL_SRC_DIR}/${data_type} ]; then
continue
fi
#echo $(cd "$(dirname $0)"; pwd)
for file_path in "${CL_SRC_DIR}/${data_type}"/*
do
file="$(basename ${file_path})"
if [ "${file##*.}" != "cl" ]; then
continue
fi
clang -Xclang -finclude-default-header -cl-std=CL2.0 --target=spir64-unknown-unknown -emit-llvm \
-c -O0 -o ${SPIRV_DIR}/${file%.*}.bc ${CL_SRC_DIR}/${data_type}/${file}
done
done
bcs=`ls ${SPIRV_DIR}/*.bc`
llvm-link ${bcs} -o ${SPIRV_DIR}/program.bc
llvm-spirv -o ${SPIRV_DIR}/program.spv ${SPIRV_DIR}/program.bc
CL_PROGRAM_PATH="${BASE_DIR}/mindspore/lite/src/runtime/kernel/opencl/cl/program.inc"
echo "#include <vector>" > ${CL_PROGRAM_PATH}
echo "std::vector<unsigned char> g_program_binary = {" >> ${CL_PROGRAM_PATH}
#hexdump -v -e '16/1 "0x%02x, " "\n"' ${SPIRV_DIR}/program.spv >> ${CL_PROGRAM_PATH}
hexdump -v -e '1/1 "0x%02x, "' ${SPIRV_DIR}/program.spv >> ${CL_PROGRAM_PATH}
echo "};" >> ${CL_PROGRAM_PATH}
echo "Compile SPIRV done"
}
build_opencl() {
cd ${BASE_DIR}
git submodule update --init third_party/OpenCL-Headers
git submodule update --init third_party/OpenCL-CLHPP
if [[ "${OFFLINE_COMPILE}" == "on" ]]; then
gene_ocl_program
else
gene_clhpp
fi
}
buildlite() {
if [[ "${MAKE_ONLY}" == "off" ]]; then
cd ${CUR_DIR}
rm -rf build
mkdir -pv build
cd build
if [[ "${BUILD_DEVICE_PLATFORM}" == "arm64" ]]; then
checkndk
cmake -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" -DANDROID_NATIVE_API_LEVEL="19" \
-DANDROID_NDK="${ANDROID_NDK}" -DANDROID_ABI="arm64-v8a" -DANDROID_TOOLCHAIN_NAME="aarch64-linux-android-clang" \
-DANDROID_STL="c++_shared" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DSUPPORT_TRAIN=${SUPPORT_TRAIN} \
-DBUILD_DEVICE=on -DPLATFORM_ARM64=on -DBUILD_CONVERTER=off -DENABLE_NEON=on -DENABLE_FP16="${ENABLE_FP16}" \
-DSUPPORT_GPU=${ENABLE_GPU} -DOFFLINE_COMPILE=${OFFLINE_COMPILE} ..
elif [[ "${BUILD_DEVICE_PLATFORM}" == "arm32" ]]; then
checkndk
cmake -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" -DANDROID_NATIVE_API_LEVEL="19" \
-DANDROID_NDK="${ANDROID_NDK}" -DANDROID_ABI="armeabi-v7a" -DANDROID_TOOLCHAIN_NAME="clang" \
-DANDROID_STL="c++_shared" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DBUILD_DEVICE=on -DPLATFORM_ARM32=on -DENABLE_NEON=on -DSUPPORT_TRAIN=${SUPPORT_TRAIN} -DBUILD_CONVERTER=off \
-DSUPPORT_GPU=${ENABLE_GPU} -DOFFLINE_COMPILE=${OFFLINE_COMPILE} ..
else
cmake -DBUILD_DEVICE=on -DPLATFORM_ARM64=off -DBUILD_CONVERTER=${ENABLE_CONVERTER} -DSUPPORT_TRAIN=${SUPPORT_TRAIN} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DSUPPORT_GPU=${ENABLE_GPU} -DOFFLINE_COMPILE=${OFFLINE_COMPILE} ..
fi
else
cd ${CUR_DIR}/build
fi
VERBOSE=2 make -j$THREAD_NUM
}
echo "---------------- mindspore lite: build start ----------------"
checkopts "$@"
build_flatbuffer
if [[ "${ENABLE_CONVERTER}" == "on" ]]; then
build_protobuf
fi
if [[ "${ENABLE_GPU}" == "on" ]]; then
build_opencl
fi
build_gtest
buildlite
COMPILE_RET=$?
if [[ "${COMPILE_RET}" -ne 0 ]]; then
echo "---------------- mindspore lite: build failed ----------------"
else
echo "---------------- mindspore lite: build success ----------------"
fi
此差异已折叠。
# CMake generated Testfile for
# Source directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/third_party/googletest
# Build directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-cloud/googletest
#
# This file includes the relevant testing commands required for
# testing this directory and lists subdirectories to be tested as well.
subdirs("googlemock")
# CMake generated Testfile for
# Source directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/third_party/googletest/googlemock
# Build directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-cloud/googletest/googlemock
#
# This file includes the relevant testing commands required for
# testing this directory and lists subdirectories to be tested as well.
subdirs("gtest")
# CMake generated Testfile for
# Source directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/third_party/googletest/googletest
# Build directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-cloud/googletest/googlemock/gtest
#
# This file includes the relevant testing commands required for
# testing this directory and lists subdirectories to be tested as well.
####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
####### Any changes to this file will be overwritten by the next CMake run ####
####### The input file was Config.cmake.in ########
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
macro(set_and_check _var _file)
set(${_var} "${_file}")
if(NOT EXISTS "${_file}")
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
endif()
endmacro()
macro(check_required_components _NAME)
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(NOT ${_NAME}_${comp}_FOUND)
if(${_NAME}_FIND_REQUIRED_${comp})
set(${_NAME}_FOUND FALSE)
endif()
endif()
endforeach()
endmacro()
####################################################################################
include(CMakeFindDependencyMacro)
if (ON)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_dependency(Threads)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/GTestTargets.cmake")
check_required_components("")
# This is a basic version file for the Config-mode of find_package().
# It is used by write_basic_package_version_file() as input file for configure_file()
# to create a version-file which can be installed along a config.cmake file.
#
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
# the requested version string are exactly the same and it sets
# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version.
# The variable CVF_VERSION must be set before calling configure_file().
set(PACKAGE_VERSION "1.9.0")
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
# if the installed project requested no architecture check, don't perform the check
if("FALSE")
return()
endif()
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
return()
endif()
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8")
math(EXPR installedBits "8 * 8")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif()
libdir=/usr/local/lib
includedir=/usr/local/include
Name: gmock
Description: GoogleMock (without main() function)
Version: 1.9.0
URL: https://github.com/google/googletest
Libs: -L${libdir} -lgmock -pthread
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread
libdir=/usr/local/lib
includedir=/usr/local/include
Name: gmock_main
Description: GoogleMock (with main() function)
Version: 1.9.0
URL: https://github.com/google/googletest
Libs: -L${libdir} -lgmock_main -pthread
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread
libdir=/usr/local/lib
includedir=/usr/local/include
Name: gtest
Description: GoogleTest (without main() function)
Version: 1.9.0
URL: https://github.com/google/googletest
Libs: -L${libdir} -lgtest -pthread
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread
libdir=/usr/local/lib
includedir=/usr/local/include
Name: gtest_main
Description: GoogleTest (with main() function)
Version: 1.9.0
URL: https://github.com/google/googletest
Requires: gtest
Libs: -L${libdir} -lgtest_main -pthread
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread
<?xml version="1.0" encoding="UTF-8"?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6"/>
<Project>
<Option title="optimize"/>
<Option makefile_is_custom="1"/>
<Option compiler="gcc"/>
<Option virtualFolders="CMake Files\;CMake Files\..\;CMake Files\..\..\;CMake Files\..\..\cmake\;CMake Files\..\..\cmake\external_libs\;CMake Files\..\..\..\;CMake Files\..\..\..\..\;CMake Files\..\..\..\..\..\;CMake Files\..\..\..\..\..\..\;CMake Files\..\..\..\..\..\..\..\;CMake Files\..\..\..\..\..\..\..\..\;CMake Files\..\..\..\..\..\..\..\..\home\;CMake Files\..\..\..\..\..\..\..\..\home\hgq\;CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\;CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\pybind11_4ff815e53c2c9c54255c528ad480c451\;CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\pybind11_4ff815e53c2c9c54255c528ad480c451\share\;CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\pybind11_4ff815e53c2c9c54255c528ad480c451\share\cmake\;CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\pybind11_4ff815e53c2c9c54255c528ad480c451\share\cmake\pybind11\;CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\eigen3_951666374a92d62fcd880d2baa7db402\;CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\eigen3_951666374a92d62fcd880d2baa7db402\share\;CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\eigen3_951666374a92d62fcd880d2baa7db402\share\eigen3\;CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\eigen3_951666374a92d62fcd880d2baa7db402\share\eigen3\cmake\;CMake Files\..\..\third_party\;CMake Files\..\..\third_party\securec\;CMake Files\..\..\third_party\securec\src\;CMake Files\tools\;CMake Files\tools\converter\;CMake Files\tools\converter\parser\;CMake Files\tools\converter\parser\caffe\;CMake Files\tools\converter\parser\tflite\;CMake Files\tools\converter\optimizer\;CMake Files\tools\converter\optimizer\fusion\;CMake Files\tools\converter\optimizer\node\;CMake Files\tools\converter\optimizer\graph\;CMake Files\tools\converter\quantizer\;CMake Files\tools\benchmark\;CMake Files\src\;CMake Files\src\common\;CMake Files\src\common\anf_exporter\;CMake Files\src\runtime\;CMake Files\src\runtime\kernel\;CMake Files\src\runtime\kernel\arm\;CMake Files\src\runtime\kernel\arm\opclib\;CMake Files\src\ops\;"/>
<Build>
<Target title="all">
<Option working_dir="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-cloud/src/runtime/kernel/arm/opclib"/>
<Option type="4"/>
<MakeCommands>
<Build command="/usr/bin/make -j8 -f &quot;/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-cloud/src/runtime/kernel/arm/opclib/Makefile&quot; VERBOSE=1 all"/>
<CompileFile command="/usr/bin/make -j8 -f &quot;/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-cloud/src/runtime/kernel/arm/opclib/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -j8 -f &quot;/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-cloud/src/runtime/kernel/arm/opclib/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -j8 -f &quot;/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-cloud/src/runtime/kernel/arm/opclib/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
</Build>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/CMakeLists.txt">
<Option virtualFolder="CMake Files\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../cmake/dependency_securec.cmake">
<Option virtualFolder="CMake Files\..\..\cmake\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../cmake/utils.cmake">
<Option virtualFolder="CMake Files\..\..\cmake\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../cmake/external_libs/eigen.cmake">
<Option virtualFolder="CMake Files\..\..\cmake\external_libs\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../cmake/external_libs/json.cmake">
<Option virtualFolder="CMake Files\..\..\cmake\external_libs\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../cmake/external_libs/pybind11.cmake">
<Option virtualFolder="CMake Files\..\..\cmake\external_libs\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../../../../../../../home/hgq/.mslib/pybind11_4ff815e53c2c9c54255c528ad480c451/share/cmake/pybind11/FindPythonLibsNew.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\pybind11_4ff815e53c2c9c54255c528ad480c451\share\cmake\pybind11\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../../../../../../../home/hgq/.mslib/pybind11_4ff815e53c2c9c54255c528ad480c451/share/cmake/pybind11/pybind11Config.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\pybind11_4ff815e53c2c9c54255c528ad480c451\share\cmake\pybind11\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../../../../../../../home/hgq/.mslib/pybind11_4ff815e53c2c9c54255c528ad480c451/share/cmake/pybind11/pybind11ConfigVersion.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\pybind11_4ff815e53c2c9c54255c528ad480c451\share\cmake\pybind11\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../../../../../../../home/hgq/.mslib/pybind11_4ff815e53c2c9c54255c528ad480c451/share/cmake/pybind11/pybind11Targets.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\pybind11_4ff815e53c2c9c54255c528ad480c451\share\cmake\pybind11\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../../../../../../../home/hgq/.mslib/pybind11_4ff815e53c2c9c54255c528ad480c451/share/cmake/pybind11/pybind11Tools.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\pybind11_4ff815e53c2c9c54255c528ad480c451\share\cmake\pybind11\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../../../../../../../home/hgq/.mslib/eigen3_951666374a92d62fcd880d2baa7db402/share/eigen3/cmake/Eigen3Config.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\eigen3_951666374a92d62fcd880d2baa7db402\share\eigen3\cmake\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../../../../../../../home/hgq/.mslib/eigen3_951666374a92d62fcd880d2baa7db402/share/eigen3/cmake/Eigen3ConfigVersion.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\eigen3_951666374a92d62fcd880d2baa7db402\share\eigen3\cmake\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../../../../../../../home/hgq/.mslib/eigen3_951666374a92d62fcd880d2baa7db402/share/eigen3/cmake/Eigen3Targets.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\eigen3_951666374a92d62fcd880d2baa7db402\share\eigen3\cmake\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../third_party/securec/CMakeLists.txt">
<Option virtualFolder="CMake Files\..\..\third_party\securec\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../third_party/securec/src/CMakeLists.txt">
<Option virtualFolder="CMake Files\..\..\third_party\securec\src\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/tools/converter/CMakeLists.txt">
<Option virtualFolder="CMake Files\tools\converter\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/tools/converter/parser/caffe/CMakeLists.txt">
<Option virtualFolder="CMake Files\tools\converter\parser\caffe\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/tools/converter/parser/tflite/CMakeLists.txt">
<Option virtualFolder="CMake Files\tools\converter\parser\tflite\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/tools/converter/optimizer/CMakeLists.txt">
<Option virtualFolder="CMake Files\tools\converter\optimizer\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/tools/converter/optimizer/fusion/CMakeLists.txt">
<Option virtualFolder="CMake Files\tools\converter\optimizer\fusion\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/tools/converter/optimizer/node/CMakeLists.txt">
<Option virtualFolder="CMake Files\tools\converter\optimizer\node\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/tools/converter/optimizer/graph/CMakeLists.txt">
<Option virtualFolder="CMake Files\tools\converter\optimizer\graph\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/tools/converter/quantizer/CMakeLists.txt">
<Option virtualFolder="CMake Files\tools\converter\quantizer\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/tools/benchmark/CMakeLists.txt">
<Option virtualFolder="CMake Files\tools\benchmark\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/src/CMakeLists.txt">
<Option virtualFolder="CMake Files\src\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/src/common/anf_exporter/CMakeLists.txt">
<Option virtualFolder="CMake Files\src\common\anf_exporter\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/src/runtime/kernel/arm/CMakeLists.txt">
<Option virtualFolder="CMake Files\src\runtime\kernel\arm\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/src/runtime/kernel/arm/opclib/CMakeLists.txt">
<Option virtualFolder="CMake Files\src\runtime\kernel\arm\opclib\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/src/ops/CMakeLists.txt">
<Option virtualFolder="CMake Files\src\ops\"/>
</Unit>
</Project>
</CodeBlocks_project_file>
此差异已折叠。
# CMake generated Testfile for
# Source directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/third_party/googletest
# Build directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-minnie/googletest
#
# This file includes the relevant testing commands required for
# testing this directory and lists subdirectories to be tested as well.
subdirs("googlemock")
# CMake generated Testfile for
# Source directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/third_party/googletest/googlemock
# Build directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-minnie/googletest/googlemock
#
# This file includes the relevant testing commands required for
# testing this directory and lists subdirectories to be tested as well.
subdirs("gtest")
# CMake generated Testfile for
# Source directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/third_party/googletest/googletest
# Build directory: /mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-minnie/googletest/googlemock/gtest
#
# This file includes the relevant testing commands required for
# testing this directory and lists subdirectories to be tested as well.
####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
####### Any changes to this file will be overwritten by the next CMake run ####
####### The input file was Config.cmake.in ########
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
macro(set_and_check _var _file)
set(${_var} "${_file}")
if(NOT EXISTS "${_file}")
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
endif()
endmacro()
macro(check_required_components _NAME)
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(NOT ${_NAME}_${comp}_FOUND)
if(${_NAME}_FIND_REQUIRED_${comp})
set(${_NAME}_FOUND FALSE)
endif()
endif()
endforeach()
endmacro()
####################################################################################
include(CMakeFindDependencyMacro)
if (ON)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_dependency(Threads)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/GTestTargets.cmake")
check_required_components("")
# This is a basic version file for the Config-mode of find_package().
# It is used by write_basic_package_version_file() as input file for configure_file()
# to create a version-file which can be installed along a config.cmake file.
#
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
# the requested version string are exactly the same and it sets
# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version.
# The variable CVF_VERSION must be set before calling configure_file().
set(PACKAGE_VERSION "1.9.0")
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
# if the installed project requested no architecture check, don't perform the check
if("FALSE")
return()
endif()
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
return()
endif()
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8")
math(EXPR installedBits "8 * 8")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif()
libdir=/usr/local/lib
includedir=/usr/local/include
Name: gmock
Description: GoogleMock (without main() function)
Version: 1.9.0
URL: https://github.com/google/googletest
Libs: -L${libdir} -lgmock -pthread
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread
libdir=/usr/local/lib
includedir=/usr/local/include
Name: gmock_main
Description: GoogleMock (with main() function)
Version: 1.9.0
URL: https://github.com/google/googletest
Libs: -L${libdir} -lgmock_main -pthread
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread
libdir=/usr/local/lib
includedir=/usr/local/include
Name: gtest
Description: GoogleTest (without main() function)
Version: 1.9.0
URL: https://github.com/google/googletest
Libs: -L${libdir} -lgtest -pthread
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread
libdir=/usr/local/lib
includedir=/usr/local/include
Name: gtest_main
Description: GoogleTest (with main() function)
Version: 1.9.0
URL: https://github.com/google/googletest
Requires: gtest
Libs: -L${libdir} -lgtest_main -pthread
Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -pthread
<?xml version="1.0" encoding="UTF-8"?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6"/>
<Project>
<Option title="optimize"/>
<Option makefile_is_custom="1"/>
<Option compiler="gcc"/>
<Option virtualFolders="CMake Files\;CMake Files\..\;CMake Files\..\..\;CMake Files\..\..\cmake\;CMake Files\..\..\cmake\external_libs\;CMake Files\..\..\..\;CMake Files\..\..\..\..\;CMake Files\..\..\..\..\..\;CMake Files\..\..\..\..\..\..\;CMake Files\..\..\..\..\..\..\..\;CMake Files\..\..\..\..\..\..\..\..\;CMake Files\..\..\..\..\..\..\..\..\home\;CMake Files\..\..\..\..\..\..\..\..\home\hgq\;CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\;CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\pybind11_4ff815e53c2c9c54255c528ad480c451\;CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\pybind11_4ff815e53c2c9c54255c528ad480c451\share\;CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\pybind11_4ff815e53c2c9c54255c528ad480c451\share\cmake\;CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\pybind11_4ff815e53c2c9c54255c528ad480c451\share\cmake\pybind11\;CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\eigen3_951666374a92d62fcd880d2baa7db402\;CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\eigen3_951666374a92d62fcd880d2baa7db402\share\;CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\eigen3_951666374a92d62fcd880d2baa7db402\share\eigen3\;CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\eigen3_951666374a92d62fcd880d2baa7db402\share\eigen3\cmake\;CMake Files\..\..\third_party\;CMake Files\..\..\third_party\securec\;CMake Files\..\..\third_party\securec\src\;CMake Files\tools\;CMake Files\tools\converter\;CMake Files\tools\converter\parser\;CMake Files\tools\converter\parser\caffe\;CMake Files\tools\converter\parser\tflite\;CMake Files\tools\converter\optimizer\;CMake Files\tools\converter\optimizer\fusion\;CMake Files\tools\converter\optimizer\node\;CMake Files\tools\converter\optimizer\graph\;CMake Files\tools\converter\quantizer\;CMake Files\tools\benchmark\;CMake Files\src\;CMake Files\src\common\;CMake Files\src\common\anf_exporter\;CMake Files\src\runtime\;CMake Files\src\runtime\kernel\;CMake Files\src\runtime\kernel\arm\;CMake Files\src\runtime\kernel\arm\opclib\;CMake Files\src\ops\;"/>
<Build>
<Target title="all">
<Option working_dir="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-minnie/src/runtime/kernel/arm/opclib"/>
<Option type="4"/>
<MakeCommands>
<Build command="/usr/bin/make -j8 -f &quot;/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-minnie/src/runtime/kernel/arm/opclib/Makefile&quot; VERBOSE=1 all"/>
<CompileFile command="/usr/bin/make -j8 -f &quot;/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-minnie/src/runtime/kernel/arm/opclib/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -j8 -f &quot;/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-minnie/src/runtime/kernel/arm/opclib/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -j8 -f &quot;/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/cmake-build-minnie/src/runtime/kernel/arm/opclib/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
</Build>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/CMakeLists.txt">
<Option virtualFolder="CMake Files\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../cmake/dependency_securec.cmake">
<Option virtualFolder="CMake Files\..\..\cmake\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../cmake/utils.cmake">
<Option virtualFolder="CMake Files\..\..\cmake\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../cmake/external_libs/eigen.cmake">
<Option virtualFolder="CMake Files\..\..\cmake\external_libs\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../cmake/external_libs/json.cmake">
<Option virtualFolder="CMake Files\..\..\cmake\external_libs\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../cmake/external_libs/pybind11.cmake">
<Option virtualFolder="CMake Files\..\..\cmake\external_libs\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../../../../../../../home/hgq/.mslib/pybind11_4ff815e53c2c9c54255c528ad480c451/share/cmake/pybind11/FindPythonLibsNew.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\pybind11_4ff815e53c2c9c54255c528ad480c451\share\cmake\pybind11\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../../../../../../../home/hgq/.mslib/pybind11_4ff815e53c2c9c54255c528ad480c451/share/cmake/pybind11/pybind11Config.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\pybind11_4ff815e53c2c9c54255c528ad480c451\share\cmake\pybind11\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../../../../../../../home/hgq/.mslib/pybind11_4ff815e53c2c9c54255c528ad480c451/share/cmake/pybind11/pybind11ConfigVersion.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\pybind11_4ff815e53c2c9c54255c528ad480c451\share\cmake\pybind11\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../../../../../../../home/hgq/.mslib/pybind11_4ff815e53c2c9c54255c528ad480c451/share/cmake/pybind11/pybind11Targets.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\pybind11_4ff815e53c2c9c54255c528ad480c451\share\cmake\pybind11\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../../../../../../../home/hgq/.mslib/pybind11_4ff815e53c2c9c54255c528ad480c451/share/cmake/pybind11/pybind11Tools.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\pybind11_4ff815e53c2c9c54255c528ad480c451\share\cmake\pybind11\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../../../../../../../home/hgq/.mslib/eigen3_951666374a92d62fcd880d2baa7db402/share/eigen3/cmake/Eigen3Config.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\eigen3_951666374a92d62fcd880d2baa7db402\share\eigen3\cmake\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../../../../../../../home/hgq/.mslib/eigen3_951666374a92d62fcd880d2baa7db402/share/eigen3/cmake/Eigen3ConfigVersion.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\eigen3_951666374a92d62fcd880d2baa7db402\share\eigen3\cmake\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../../../../../../../home/hgq/.mslib/eigen3_951666374a92d62fcd880d2baa7db402/share/eigen3/cmake/Eigen3Targets.cmake">
<Option virtualFolder="CMake Files\..\..\..\..\..\..\..\..\home\hgq\.mslib\eigen3_951666374a92d62fcd880d2baa7db402\share\eigen3\cmake\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../third_party/securec/CMakeLists.txt">
<Option virtualFolder="CMake Files\..\..\third_party\securec\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/../../third_party/securec/src/CMakeLists.txt">
<Option virtualFolder="CMake Files\..\..\third_party\securec\src\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/tools/converter/CMakeLists.txt">
<Option virtualFolder="CMake Files\tools\converter\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/tools/converter/parser/caffe/CMakeLists.txt">
<Option virtualFolder="CMake Files\tools\converter\parser\caffe\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/tools/converter/parser/tflite/CMakeLists.txt">
<Option virtualFolder="CMake Files\tools\converter\parser\tflite\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/tools/converter/optimizer/CMakeLists.txt">
<Option virtualFolder="CMake Files\tools\converter\optimizer\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/tools/converter/optimizer/fusion/CMakeLists.txt">
<Option virtualFolder="CMake Files\tools\converter\optimizer\fusion\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/tools/converter/optimizer/node/CMakeLists.txt">
<Option virtualFolder="CMake Files\tools\converter\optimizer\node\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/tools/converter/optimizer/graph/CMakeLists.txt">
<Option virtualFolder="CMake Files\tools\converter\optimizer\graph\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/tools/converter/quantizer/CMakeLists.txt">
<Option virtualFolder="CMake Files\tools\converter\quantizer\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/tools/benchmark/CMakeLists.txt">
<Option virtualFolder="CMake Files\tools\benchmark\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/src/CMakeLists.txt">
<Option virtualFolder="CMake Files\src\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/src/common/anf_exporter/CMakeLists.txt">
<Option virtualFolder="CMake Files\src\common\anf_exporter\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/src/runtime/kernel/arm/CMakeLists.txt">
<Option virtualFolder="CMake Files\src\runtime\kernel\arm\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/src/runtime/kernel/arm/opclib/CMakeLists.txt">
<Option virtualFolder="CMake Files\src\runtime\kernel\arm\opclib\"/>
</Unit>
<Unit filename="/mnt/data/workspace/OpenAI/Huawei/mindspore/mindspore/lite/src/ops/CMakeLists.txt">
<Option virtualFolder="CMake Files\src\ops\"/>
</Unit>
</Project>
</CodeBlocks_project_file>
/**
* Copyright 2020 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_LITE_INCLUDE_CONTEXT_H_
#define MINDSPORE_LITE_INCLUDE_CONTEXT_H_
#include <string>
#include <memory>
#include "include/ms_tensor.h"
namespace mindspore::lite {
class Allocator;
enum CpuBindMode {
MID_CPU = -1, /**< bind mid cpu first */
HIGHER_CPU = 1, /**< bind higher cpu first */
NO_BIND = 0 /**< no bind */
};
typedef enum { DT_CPU, DT_GPU, DT_NPU } DeviceType;
// brief NPUContext defined by MindSpore predict
typedef struct {
int freq{3};
int fmkType{0};
int modelType{0};
int deviceType{0};
std::string modelName = "default";
} NPUContext;
// brief DeviceContext defined by MindSpore predict
typedef struct {
DeviceType type;
// DLContext primary;
NPUContext npuCtx;
} DeviceContext;
// brief Context defined by MindSpore predict
class MS_API Context {
public:
// brief Constructor of MindSpore predict context using default value for parameters
//
// return Instance of MindSpore predict context.
Context();
// brief Constructor of MindSpore predict context using input value for parameters
//
// param[in] threadNum Define the threadNum during the runtime.
// param[in] allocator Define the allocator for malloc.
// param[in] deviceCtx Define device information during the runtime.
Context(int threadNum, std::shared_ptr<Allocator> allocator, DeviceContext deviceCtx);
// brief Destructor of MindSpore predict context
virtual ~Context();
public:
DeviceContext deviceCtx;
int threadNum = 2;
std::shared_ptr<Allocator> allocator;
CpuBindMode cpuBindMode = MID_CPU;
};
} // namespace mindspore::lite
#endif // MINDSPORE_LITE_INCLUDE_CONTEXT_H_
/**
* Copyright 2020 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_LITE_INCLUDE_ERRORCODE_H_
#define MINDSPORE_LITE_INCLUDE_ERRORCODE_H_
namespace mindspore {
namespace lite {
using STATUS = int;
/* Success */
constexpr int RET_OK = 0; /**< No error occurs. */
/* Common error code, range: [-1, -100]*/
constexpr int RET_ERROR = -1; /**< Common error code. */
constexpr int RET_NULL_PTR = -2; /**< NULL pointer returned.*/
constexpr int RET_PARAM_INVALID = -3; /**< Invalid parameter.*/
constexpr int RET_NO_CHANGE = -4; /**< No change. */
constexpr int RET_SUCCESS_EXIT = -5; /**< No error but exit. */
constexpr int RET_MEMORY_FAILED = -6; /**< Create memory failed. */
/* Executor error code, range: [-101,-200] */
constexpr int RET_OUT_OF_TENSOR_RANGE = -101; /**< Failed to checking range. */
constexpr int RET_INPUT_TENSOR_ERROR = -102; /**< Failed to checking input tensor. */
constexpr int RET_REENTRANT_ERROR = -103; /**< Exist executor running. */
/* Graph error code, range: [-201,-300] */
constexpr int RET_GRAPH_FILE_ERR = -201; /**< Failed to verify graph file. */
/* Node error code, range: [-301,-400] */
constexpr int RET_NOT_FIND_OP = -301; /**< Failed to find operator. */
constexpr int RET_INVALID_OP_NAME = -302; /**< Invalid operator name. */
constexpr int RET_INVALID_OP_ATTR = -303; /**< Invalid operator attr. */
constexpr int RET_OP_EXECUTE_FAILURE = -304; /**< Failed to execution operator. */
/* Tensor error code, range: [-401,-500] */
constexpr int RET_FORMAT_ERR = -401; /**< Failed to checking tensor format. */
} // namespace lite
} // namespace mindspore
#endif // MINDSPORE_LITE_INCLUDE_ERRORCODE_H_
/**
* Copyright 2020 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_LITE_INCLUDE_LITE_SESSION_H
#define MINDSPORE_LITE_INCLUDE_LITE_SESSION_H
#include <memory>
#include <vector>
#include <string>
#include "include/ms_tensor.h"
#include "include/model.h"
#include "include/context.h"
namespace mindspore {
namespace session {
class MS_API LiteSession {
public:
virtual ~LiteSession() = default;
virtual void BindThread(bool ifBind) = 0;
static LiteSession *CreateSession(lite::Context *context);
virtual int CompileGraph(lite::Model *model) = 0;
virtual std::vector<tensor::MSTensor *> GetInputs() = 0;
virtual std::vector<tensor::MSTensor *> GetInputsByName(std::string name) = 0;
virtual int RunGraph() = 0;
virtual std::vector<tensor::MSTensor *> GetOutputs() = 0;
virtual std::vector<tensor::MSTensor *> GetOutputsByName(std::string name) = 0;
};
} // namespace session
} // namespace mindspore
#endif // MINDSPORE_LITE_INCLUDE_LITE_SESSION_H
/**
* Copyright 2020 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_LITE_INCLUDE_MODEL_H
#define MINDSPORE_LITE_INCLUDE_MODEL_H
#include <string>
#include <vector>
#include <memory>
#include "schema/model_generated.h"
namespace mindspore {
class ModelImpl;
namespace lite {
class Primitive;
class Model {
public:
static std::shared_ptr<Model> Import(const char *model_buf, size_t size);
virtual ~Model() = default;
Model() = default;
lite::Primitive *GetOp(const std::string &name) const;
const schema::MetaGraph *GetMetaGraph() const;
std::shared_ptr<ModelImpl> GetModelImpl();
void FreeMetaGraph();
protected:
std::shared_ptr<ModelImpl> modelImpl = nullptr;
};
class ModelBuilder {
public:
struct OutEdge {
std::string nodeId;
size_t outEdgeIndex;
};
ModelBuilder() = default;
virtual ~ModelBuilder() = default;
virtual std::string AddOp(const lite::Primitive &op, const std::vector<OutEdge> &inputs) = 0;
virtual Model *Construct();
};
} // namespace lite
} // namespace mindspore
#endif // MINDSPORE_LITE_INCLUDE_MODEL_H
/**
* Copyright 2020 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_INCLUDE_MS_TENSOR_H_
#define MINDSPORE_INCLUDE_MS_TENSOR_H_
#include <utility>
#include <vector>
#include <memory>
#include "ir/dtype/type_id.h"
namespace mindspore {
#define MS_API __attribute__((visibility("default")))
namespace tensor {
class MS_API MSTensor {
public:
MSTensor() = default;
// brief Create a MSTensor pointer.
//
// param data_type DataTypeId of tensor to be created.
// param shape Shape of tensor to be created.
// return MSTensor pointer.
static MSTensor *CreateTensor(TypeId data_type, const std::vector<int> &shape);
virtual ~MSTensor() = default;
virtual TypeId data_type() const = 0;
virtual TypeId set_data_type(const TypeId data_type) = 0;
virtual std::vector<int> shape() const = 0;
virtual size_t set_shape(const std::vector<int> &shape) = 0;
virtual int DimensionSize(size_t index) const = 0;
// brief Get number of element in MSTensor.
//
// return Number of element in MSTensor.
virtual int ElementsNum() const = 0;
virtual std::size_t hash() const = 0;
// brief Get byte size of data in MSTensor.
//
// return Byte size of data in MSTensor.
virtual size_t Size() const = 0;
// brief Get pointer of data in MSTensor.
//
// The data pointer can be used to both write or read data in MSTensor.
//
// return A pointer points to data in MSTensor.
virtual void *MutableData() const = 0;
};
using MultiTensor = std::vector<std::vector<std::shared_ptr<tensor::MSTensor>>>;
} // namespace tensor
} // namespace mindspore
#endif // MINDSPORE_INCLUDE_MS_TENSOR_H_
/**
* Copyright 2019 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.
*/
include "ops.fbs";
namespace mindspore.schema;
enum NodeType: int {
ValueNode, // const
Parameter, // var
CNode // op
}
table QuantParam {
scale: double;
zeroPoint: int;
min: double = 0;
max: double = 0;
narrowRange: bool = true;
numBits: int = 8;
inited: bool = false;
}
table Tensor {
nodeType: NodeType;
// data type
dataType: int;
// shape
dims: [int];
format: Format;
refCount: int;
offset: int;
data: [ubyte];
quantParams: [QuantParam];
}
union PrimitiveType {
Concat,
SoftMax,
Activation,
Conv2D,
FusedBatchNorm,
CaffeBatchNorm,
BiasAdd,
Pooling,
DepthwiseConv2D,
DeDepthwiseConv2D,
Resize,
DetectionPostProcess,
FullConnection,
Mean,
DeConv2D,
Scale,
Reshape,
Eltwise,
NetOutput,
Add,
Sub,
MatMul,
StridedSlice,
Power,
Slice,
Stack,
Mul,
RealDiv,
Pad,
Maximum,
Minimum,
CaffePReLU,
LeakyReLU,
ArgMax,
ArgMin,
Exp,
Crop,
Range,
Rsqrt,
ExpandDims,
Tile,
Cast,
Shape,
Nchw2Nhwc,
Nhwc2Nchw,
QuantDTypeCast,
Split,
Permute,
FakeQuantWithMinMaxVars,
Equal,
Less,
Greater,
NotEqual,
LessEqual,
GreaterEqual,
Min,
Floor,
Abs,
Neg,
Cos,
Sin,
Sqrt,
Square,
Constant,
Log,
Tan,
Atan,
Asin,
Clip,
Transpose,
Squeeze,
Unsqueeze,
Upsample,
Dropout,
Broadcast,
BroadcastTo,
Lrn,
Prelu,
ZerosLike,
TopK,
SpaceToDepth,
SpaceToBatch,
SparseToDense,
ReverseSequence,
Rank,
Gather,
GatherNd,
Fill,
Elu,
DepthToSpace,
BatchToSpace,
AddN,
Ceil,
EmbeddingLookup,
EmbeddingLookupSparse,
FloorDiv,
FloorMod,
L2Norm,
LocalResponseNormalization,
MatrixDiag,
Reduce,
Reverse,
Round,
Select,
Scatter,
ScatterND,
Unique,
Unstack,
LogicalAnd,
LogicalOr,
LogicalXor,
LogicalNot,
OnnxInt8Quantize,
OnnxInt8Dequantize,
FakeQuantWithMinMax,
FakeQuantWithMinMaxPerChannel,
BatchNormFold,
MulFold,
AddFold,
SquaredDifference,
Flatten,
TupleGetItem,
Div,
Where,
OneHot
}
enum QuantType: int {
QUANT_NONE,
AwareTrainning,
WeightQuant,
PostTraining
}
table Primitive {
value: PrimitiveType;
}
table CNode {
name: string;
nodeType: NodeType = CNode;
primitive: Primitive;
inputIndex: [uint];
outputIndex: [uint];
quantType: QuantType = QUANT_NONE;
}
table MetaGraph {
name: string;
fmkType: int; // 0:tf,1:caffe
inputIndex: [uint];
outputIndex: [uint];
mempoolSize: uint;
nodes: [CNode];
allTensors: [Tensor]; // weight + input + output
}
root_type MetaGraph;
此差异已折叠。
set(LITE_SRC
${CMAKE_CURRENT_SOURCE_DIR}/common/graph_util.cc
${CMAKE_CURRENT_SOURCE_DIR}/runtime/allocator.cc
${CMAKE_CURRENT_SOURCE_DIR}/runtime/runtime_api.cc
${CMAKE_CURRENT_SOURCE_DIR}/runtime/thread_pool.cc
${CMAKE_CURRENT_SOURCE_DIR}/runtime/workspace_pool.cc
${CMAKE_CURRENT_SOURCE_DIR}/ir/tensor.cc
${CMAKE_CURRENT_SOURCE_DIR}/context.cc
${CMAKE_CURRENT_SOURCE_DIR}/executor.cc
${CMAKE_CURRENT_SOURCE_DIR}/kernel_factory.cc
${CMAKE_CURRENT_SOURCE_DIR}/kernel_registry.cc
${CMAKE_CURRENT_SOURCE_DIR}/lite_kernel.cc
${CMAKE_CURRENT_SOURCE_DIR}/model.cc
${CMAKE_CURRENT_SOURCE_DIR}/populate_parameter.cc
${CMAKE_CURRENT_SOURCE_DIR}/scheduler.cc
)
if (SUPPORT_GPU)
list(APPEND LITE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/runtime/kernel/opencl/subgraph_opencl_kernel.cc)
list(APPEND LITE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/runtime/kernel/opencl/utils.cc)
endif()
if (SUPPORT_TRAIN)
set(ANF_SRC
# ${CCSRC_DIR}/common/trans.cc
# ${CCSRC_DIR}/utils/lite/base_ref_utils.cc
# ${CCSRC_DIR}/runtime/kernel/kernel_compiler/kernel_build_info.cc
# ${CCSRC_DIR}/session/lite/anf_runtime_algorithm_extends.cc
# ${CCSRC_DIR}/session/lite/session_basic_extends.cc
# ${CCSRC_DIR}/session/anf_runtime_algorithm.cc
# ${CCSRC_DIR}/session/session_basic.cc
# ${CCSRC_DIR}/session/kernel_graph.cc
# ${CCSRC_DIR}/session/session_factory.cc
# ${CCSRC_DIR}/device/kernel_info.cc
# ${CCSRC_DIR}/device/kernel_runtime.cc
# ${CCSRC_DIR}/device/lite/kernel_runtime_extends.cc
)
set(PASS_SRC)
set(LITE_SRC
${LITE_SRC}
${ANF_SRC}
${PASS_SRC}
${CMAKE_CURRENT_SOURCE_DIR}/common/anf_importer/anf_importer.cc
${CMAKE_CURRENT_SOURCE_DIR}/common/anf_importer/import_from_meta_graph.cc
${CMAKE_CURRENT_SOURCE_DIR}/ir/primitive_value.cc
${CMAKE_CURRENT_SOURCE_DIR}/train/lite_kernel_runtime.cc
${CMAKE_CURRENT_SOURCE_DIR}/train/train_session.cc
${CMAKE_CURRENT_SOURCE_DIR}/train/model_impl.cc
)
else ()
set(LITE_SRC
${LITE_SRC}
${CMAKE_CURRENT_SOURCE_DIR}/lite_session.cc
${CMAKE_CURRENT_SOURCE_DIR}/model_impl.cc
)
endif ()
if (SUPPORT_GPU)
set(LITE_SRC
${LITE_SRC}
${CMAKE_CURRENT_SOURCE_DIR}/runtime/opencl/opencl_executor.cc
${CMAKE_CURRENT_SOURCE_DIR}/runtime/opencl/opencl_allocator.cc
${CMAKE_CURRENT_SOURCE_DIR}/runtime/opencl/opencl_runtime.cc
${CMAKE_CURRENT_SOURCE_DIR}/runtime/opencl/opencl_wrapper.cc
)
endif ()
set(ANF_SRC
${ANF_SRC}
${CMAKE_CURRENT_SOURCE_DIR}/ir/meta_tensor_extends.cc
)
add_library(mindspore-lite SHARED ${LITE_SRC} ${ANF_SRC})
target_link_libraries(mindspore-lite
cpu_kernel_mid_
ops_mid_
${SECUREC_LIBRARY}
mindspore::json
)
add_subdirectory(runtime/kernel/arm)
add_subdirectory(ops)
file(GLOB_RECURSE ANF_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
*.cc
)
add_library(anf_exporter_mid OBJECT
${ANF_SRC_LIST}
)
此差异已折叠。
/**
* This is the C++ adaptation and derivative work of Myia (https://github.com/mila-iqia/myia/).
*
* Copyright 2019 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_LITE_SRC_ANF_EXPORTER_ANF_EXPORTER_H_
#define MINDSPORE_LITE_SRC_ANF_EXPORTER_ANF_EXPORTER_H_
#include <map>
#include <string>
#include <vector>
#include "schema/inner/model_generated.h"
#include "ir/func_graph.h"
namespace mindspore::lite {
class AnfExporter {
public:
AnfExporter() = default;
virtual ~AnfExporter() = default;
schema::MetaGraphT *Export(const FuncGraphPtr &funcGraph);
void SetOpOutputNode(const std::vector<schema::TensorT *> &outputTensors, schema::MetaGraphT *graph,
schema::CNodeT *cnode);
void SetOpInputNode(const CNodePtr &cnode, schema::MetaGraphT *meta_graph, schema::CNodeT *fbNode);
private:
std::map<std::string, int> nodeIdMap;
std::vector<schema::CNodeT *> graphInputNodes;
};
schema::MetaGraphT *Export(const FuncGraphPtr &funcGraph);
} // namespace mindspore::lite
#endif // MINDSPORE_LITE_SRC_ANF_EXPORTER_ANF_EXPORTER_H_
/**
* Copyright 2019 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.
*/
#include "src/common/anf_exporter/anf_populater/anf_activation_populater.h"
#include <vector>
#include <memory>
#include "src/common/anf_exporter/anf_populater/anf_node_populater_registry.h"
#include "ir/func_graph.h"
#include "ir/primitive.h"
namespace mindspore::lite {
int mindspore::lite::AnfActivationPopulater::Parse(mindspore::CNodePtr cnodePtr, schema::CNodeT *node,
std::vector<schema::TensorT *> *outputs) {
auto p = GetCNodePrimitive(cnodePtr);
auto attr = std::make_unique<schema::ActivationT>();
if (p->name() == "ReLU") {
attr->type = schema::ActivationType_RELU;
} else if (p->name() == "Sigmoid") {
attr->type = schema::ActivationType_SIGMOID;
}
node->nodeType = schema::NodeType_CNode;
node->primitive = std::make_unique<schema::PrimitiveT>();
node->primitive->value.type = schema::PrimitiveType_Activation;
node->primitive->value.value = attr.release();
return 0;
}
AnfNodePopulaterRegistrar anfReLUParser("ReLU", new AnfActivationPopulater());
AnfNodePopulaterRegistrar anfSigmoidParser("Sigmoid", new AnfActivationPopulater());
} // namespace mindspore::lite
/**
* Copyright 2019 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_ANF_ACTIVATION_PARSER_H
#define MINDSPORE_ANF_ACTIVATION_PARSER_H
#include "src/common/anf_exporter/anf_populater/anf_node_populater.h"
#include <vector>
namespace mindspore::lite {
class AnfActivationPopulater : public AnfNodePopulater {
public:
AnfActivationPopulater() = default;
~AnfActivationPopulater() override = default;
int Parse(CNodePtr cnodePtr, schema::CNodeT *node, std::vector<schema::TensorT *> *outputs) override;
};
} // namespace mindspore::lite
#endif // MINDSPORE_ANF_ACTIVATION_PARSER_H
/**
* Copyright 2019 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_ANF_BATCHNORM_PARSER_H
#define MINDSPORE_ANF_BATCHNORM_PARSER_H
#include "src/common/anf_exporter/anf_populater/anf_node_populater.h"
#include <vector>
namespace mindspore::lite {
class AnfBatchnormParser : public AnfNodePopulater {
public:
AnfBatchnormParser() = default;
~AnfBatchnormParser() override = default;
int Parse(CNodePtr cnodePtr, schema::CNodeT *node, std::vector<schema::TensorT *> *outputs) override;
};
} // namespace mindspore::lite
#endif // MINDSPORE_ANF_BATCHNORM_PARSER_H
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册