Browse Source

!4091 remove securec lib in mindspore lite

Merge pull request !4091 from hangq/master
tags/v0.7.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
9828f7f05e
5 changed files with 15 additions and 13 deletions
  1. +3
    -0
      build.sh
  2. +0
    -1
      mindspore/lite/src/CMakeLists.txt
  3. +2
    -2
      mindspore/lite/tools/benchmark/CMakeLists.txt
  4. +2
    -2
      mindspore/lite/tools/time_profile/CMakeLists.txt
  5. +8
    -8
      mindspore/lite/tools/time_profile/time_profile.cc

+ 3
- 0
build.sh View File

@@ -634,6 +634,7 @@ build_lite()
mkdir -p ${OUTPUT_DIR}/third_party mkdir -p ${OUTPUT_DIR}/third_party
cp ${BASEPATH}/mindspore/lite/build/tools/converter/converter_lite ${OUTPUT_DIR}/converter/ 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/build/tools/benchmark/benchmark ${OUTPUT_DIR}/benchmark/
cp ${BASEPATH}/mindspore/lite/build/tools/time_profile/timeprofile ${OUTPUT_DIR}/time_profile/
cp ${BASEPATH}/mindspore/lite/include/*.h ${OUTPUT_DIR}/include/ cp ${BASEPATH}/mindspore/lite/include/*.h ${OUTPUT_DIR}/include/
mkdir -p ${OUTPUT_DIR}/include/ir/dtype/ mkdir -p ${OUTPUT_DIR}/include/ir/dtype/
cp ${BASEPATH}/mindspore/core/ir/dtype/type_id.h ${OUTPUT_DIR}/include/ir/dtype/ cp ${BASEPATH}/mindspore/core/ir/dtype/type_id.h ${OUTPUT_DIR}/include/ir/dtype/
@@ -657,6 +658,7 @@ build_lite()
mkdir -p ${OUTPUT_DIR}/include && mkdir -p ${OUTPUT_DIR}/lib mkdir -p ${OUTPUT_DIR}/include && mkdir -p ${OUTPUT_DIR}/lib
mkdir -p ${OUTPUT_DIR}/third_party mkdir -p ${OUTPUT_DIR}/third_party
cp ${BASEPATH}/mindspore/lite/build/tools/benchmark/benchmark ${OUTPUT_DIR}/benchmark/ cp ${BASEPATH}/mindspore/lite/build/tools/benchmark/benchmark ${OUTPUT_DIR}/benchmark/
cp ${BASEPATH}/mindspore/lite/build/tools/time_profile/timeprofile ${OUTPUT_DIR}/time_profile/
cp ${BASEPATH}/mindspore/lite/include/*.h ${OUTPUT_DIR}/include/ cp ${BASEPATH}/mindspore/lite/include/*.h ${OUTPUT_DIR}/include/
mkdir -p ${OUTPUT_DIR}/include/ir/dtype/ mkdir -p ${OUTPUT_DIR}/include/ir/dtype/
cp ${BASEPATH}/mindspore/core/ir/dtype/type_id.h ${OUTPUT_DIR}/include/ir/dtype/ cp ${BASEPATH}/mindspore/core/ir/dtype/type_id.h ${OUTPUT_DIR}/include/ir/dtype/
@@ -676,6 +678,7 @@ build_lite()
mkdir -p ${OUTPUT_DIR}/include && mkdir -p ${OUTPUT_DIR}/lib mkdir -p ${OUTPUT_DIR}/include && mkdir -p ${OUTPUT_DIR}/lib
mkdir -p ${OUTPUT_DIR}/third_party mkdir -p ${OUTPUT_DIR}/third_party
cp ${BASEPATH}/mindspore/lite/build/tools/benchmark/benchmark ${OUTPUT_DIR}/benchmark/ cp ${BASEPATH}/mindspore/lite/build/tools/benchmark/benchmark ${OUTPUT_DIR}/benchmark/
cp ${BASEPATH}/mindspore/lite/build/tools/time_profile/timeprofile ${OUTPUT_DIR}/time_profile/
cp ${BASEPATH}/mindspore/lite/include/*.h ${OUTPUT_DIR}/include/ cp ${BASEPATH}/mindspore/lite/include/*.h ${OUTPUT_DIR}/include/
mkdir -p ${OUTPUT_DIR}/include/ir/dtype/ mkdir -p ${OUTPUT_DIR}/include/ir/dtype/
cp ${BASEPATH}/mindspore/core/ir/dtype/type_id.h ${OUTPUT_DIR}/include/ir/dtype/ cp ${BASEPATH}/mindspore/core/ir/dtype/type_id.h ${OUTPUT_DIR}/include/ir/dtype/


+ 0
- 1
mindspore/lite/src/CMakeLists.txt View File

@@ -75,7 +75,6 @@ add_library(mindspore-lite SHARED ${LITE_SRC} ${ANF_SRC})
target_link_libraries(mindspore-lite target_link_libraries(mindspore-lite
cpu_kernel_mid_ cpu_kernel_mid_
ops_mid_ ops_mid_
${SECUREC_LIBRARY}
) )


add_subdirectory(runtime/kernel/arm) add_subdirectory(runtime/kernel/arm)


+ 2
- 2
mindspore/lite/tools/benchmark/CMakeLists.txt View File

@@ -11,7 +11,7 @@ add_executable(benchmark
${COMMON_SRC}) ${COMMON_SRC})


if (PLATFORM_ARM32 OR PLATFORM_ARM64) if (PLATFORM_ARM32 OR PLATFORM_ARM64)
target_link_libraries(benchmark mindspore-lite ${SECUREC_LIBRARY})
target_link_libraries(benchmark mindspore-lite)
else() else()
target_link_libraries(benchmark mindspore-lite ${SECUREC_LIBRARY} pthread)
target_link_libraries(benchmark mindspore-lite pthread)
endif() endif()

+ 2
- 2
mindspore/lite/tools/time_profile/CMakeLists.txt View File

@@ -12,7 +12,7 @@ add_executable(timeprofile
${COMMON_SRC}) ${COMMON_SRC})


if (PLATFORM_ARM32 OR PLATFORM_ARM64) if (PLATFORM_ARM32 OR PLATFORM_ARM64)
target_link_libraries(timeprofile mindspore-lite ${SECUREC_LIBRARY})
target_link_libraries(timeprofile mindspore-lite)
else() else()
target_link_libraries(timeprofile mindspore-lite ${SECUREC_LIBRARY} pthread)
target_link_libraries(timeprofile mindspore-lite pthread)
endif() endif()

+ 8
- 8
mindspore/lite/tools/time_profile/time_profile.cc View File

@@ -112,8 +112,8 @@ int TimeProfile::InitSession() {
int TimeProfile::InitCallbackParameter() { int TimeProfile::InitCallbackParameter() {
// before callback // before callback
before_call_back_ = [&](const std::vector<mindspore::tensor::MSTensor *> &before_inputs, before_call_back_ = [&](const std::vector<mindspore::tensor::MSTensor *> &before_inputs,
const std::vector<mindspore::tensor::MSTensor *> &before_outputs,
const session::CallBackParam &callParam) {
const std::vector<mindspore::tensor::MSTensor *> &before_outputs,
const session::CallBackParam &callParam) {
if (before_inputs.empty()) { if (before_inputs.empty()) {
MS_LOG(INFO) << "The num of beforeInputs is empty"; MS_LOG(INFO) << "The num of beforeInputs is empty";
} }
@@ -134,8 +134,8 @@ int TimeProfile::InitCallbackParameter() {


// after callback // after callback
after_call_back_ = [&](const std::vector<mindspore::tensor::MSTensor *> &after_inputs, after_call_back_ = [&](const std::vector<mindspore::tensor::MSTensor *> &after_inputs,
const std::vector<mindspore::tensor::MSTensor *> &after_outputs,
const session::CallBackParam &call_param) {
const std::vector<mindspore::tensor::MSTensor *> &after_outputs,
const session::CallBackParam &call_param) {
uint64_t opEnd = GetTimeUs(); uint64_t opEnd = GetTimeUs();


if (after_inputs.empty()) { if (after_inputs.empty()) {
@@ -215,25 +215,25 @@ int TimeProfile::PrintResult(const std::vector<std::string> &title,
} }
columns.push_back(iter.first); columns.push_back(iter.first);


len = sprintf_s(stringBuf[1], 100, "%f", iter.second.second / _flags->loop_count_);
len = snprintf(stringBuf[1], sizeof(stringBuf[1]), "%f", iter.second.second / _flags->loop_count_);
if (len > columnLenMax.at(1)) { if (len > columnLenMax.at(1)) {
columnLenMax.at(1) = len + 4; columnLenMax.at(1) = len + 4;
} }
columns.emplace_back(stringBuf[1]); columns.emplace_back(stringBuf[1]);


len = sprintf_s(stringBuf[2], 100, "%f", iter.second.second / op_cost_total_);
len = snprintf(stringBuf[2], sizeof(stringBuf[2]), "%f", iter.second.second / op_cost_total_);
if (len > columnLenMax.at(2)) { if (len > columnLenMax.at(2)) {
columnLenMax.at(2) = len + 4; columnLenMax.at(2) = len + 4;
} }
columns.emplace_back(stringBuf[2]); columns.emplace_back(stringBuf[2]);


len = sprintf_s(stringBuf[3], 100, "%d", iter.second.first);
len = snprintf(stringBuf[3], sizeof(stringBuf[3]), "%d", iter.second.first);
if (len > columnLenMax.at(3)) { if (len > columnLenMax.at(3)) {
columnLenMax.at(3) = len + 4; columnLenMax.at(3) = len + 4;
} }
columns.emplace_back(stringBuf[3]); columns.emplace_back(stringBuf[3]);


len = sprintf_s(stringBuf[4], 100, "%f", iter.second.second);
len = snprintf(stringBuf[4], sizeof(stringBuf[4]), "%f", iter.second.second);
if (len > columnLenMax.at(4)) { if (len > columnLenMax.at(4)) {
columnLenMax.at(4) = len + 4; columnLenMax.at(4) = len + 4;
} }


Loading…
Cancel
Save