diff --git a/mindspore/lite/tools/benchmark/CMakeLists.txt b/mindspore/lite/tools/benchmark/CMakeLists.txt index 5da067b177c..5af0da7732e 100644 --- a/mindspore/lite/tools/benchmark/CMakeLists.txt +++ b/mindspore/lite/tools/benchmark/CMakeLists.txt @@ -4,45 +4,22 @@ set(COMMON_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../src/common/file_utils.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../src/common/utils.cc ) -if(NOT TARGET_HIMIX200) - add_executable(benchmark - ${CMAKE_CURRENT_SOURCE_DIR}/main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/run_benchmark.cc - ${CMAKE_CURRENT_SOURCE_DIR}/benchmark_base.cc - ${CMAKE_CURRENT_SOURCE_DIR}/benchmark.cc - ${CMAKE_CURRENT_SOURCE_DIR}/benchmark_unified_api.cc - ${COMMON_SRC}) +add_executable(benchmark + ${CMAKE_CURRENT_SOURCE_DIR}/main.cc + ${CMAKE_CURRENT_SOURCE_DIR}/run_benchmark.cc + ${CMAKE_CURRENT_SOURCE_DIR}/benchmark_base.cc + ${CMAKE_CURRENT_SOURCE_DIR}/benchmark.cc + ${CMAKE_CURRENT_SOURCE_DIR}/benchmark_unified_api.cc + ${COMMON_SRC}) - add_dependencies(benchmark fbs_src) +add_dependencies(benchmark fbs_src) - if(PLATFORM_ARM32 OR PLATFORM_ARM64) - if(SUPPORT_NPU AND ANDROID_STL STREQUAL "c++_static") - target_link_libraries(benchmark mindspore-lite mindspore::json c++_shared) - else() - target_link_libraries(benchmark mindspore-lite mindspore::json) - endif() +if((PLATFORM_ARM32 OR PLATFORM_ARM64) AND NOT TARGET_HIMIX200) + if(SUPPORT_NPU AND ANDROID_STL STREQUAL "c++_static") + target_link_libraries(benchmark mindspore-lite mindspore::json c++_shared) else() - target_link_libraries(benchmark mindspore-lite mindspore::json pthread) + target_link_libraries(benchmark mindspore-lite mindspore::json) endif() -endif() - -if(MSLITE_COMPILE_NNIE AND TARGET_HIMIX200 AND PLATFORM_ARM) - include_directories(${CMAKE_CURRENT_SOURCE_DIR}/nnie/third_patry/hi3516_sdk) - link_directories(${CMAKE_CURRENT_SOURCE_DIR}/nnie/third_patry/hi3516_sdk/lib) - set(CMAKE_SKIP_BUILD_RPATH on) - add_subdirectory(nnie) - add_subdirectory(nnie_proposal) - - add_executable(benchmark - ${CMAKE_CURRENT_SOURCE_DIR}/main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/run_benchmark.cc - ${CMAKE_CURRENT_SOURCE_DIR}/benchmark_base.cc - ${CMAKE_CURRENT_SOURCE_DIR}/benchmark.cc - ${CMAKE_CURRENT_SOURCE_DIR}/benchmark_unified_api.cc - ${COMMON_SRC}) - - add_dependencies(benchmark fbs_src) - - target_link_libraries(benchmark mindspore-lite mindspore::json pthread mslite_proposal - mslite_nnie dl nnie mpi VoiceEngine upvqe dnvqe securec) +else() + target_link_libraries(benchmark mindspore-lite mindspore::json pthread) endif() diff --git a/mindspore/lite/tools/benchmark/benchmark.cc b/mindspore/lite/tools/benchmark/benchmark.cc index 87073fe37b2..fc51f3b3c54 100644 --- a/mindspore/lite/tools/benchmark/benchmark.cc +++ b/mindspore/lite/tools/benchmark/benchmark.cc @@ -33,12 +33,6 @@ #include #include #endif -#ifdef SUPPORT_NNIE -#include "include/hi_common.h" -#include "include/hi_comm_vb.h" -#include "include/mpi_sys.h" -#include "include/mpi_vb.h" -#endif namespace mindspore { namespace lite { diff --git a/mindspore/lite/tools/benchmark/benchmark_base.cc b/mindspore/lite/tools/benchmark/benchmark_base.cc index 4143b25cb37..7b7591be4f7 100644 --- a/mindspore/lite/tools/benchmark/benchmark_base.cc +++ b/mindspore/lite/tools/benchmark/benchmark_base.cc @@ -33,12 +33,6 @@ #include #include #endif -#ifdef SUPPORT_NNIE -#include "include/hi_common.h" -#include "include/hi_comm_vb.h" -#include "include/mpi_sys.h" -#include "include/mpi_vb.h" -#endif namespace mindspore { namespace lite { @@ -539,67 +533,11 @@ int BenchmarkBase::PrintPerfResult(const std::vector &title, } #endif -#ifdef SUPPORT_NNIE -int SvpSysInit() { - HI_S32 ret = HI_SUCCESS; - VB_CONFIG_S struVbConf; - - HI_MPI_SYS_Exit(); - HI_MPI_VB_Exit(); - - memset(&struVbConf, 0, sizeof(VB_CONFIG_S)); - struVbConf.u32MaxPoolCnt = 2; - struVbConf.astCommPool[1].u64BlkSize = 768 * 576 * 2; - struVbConf.astCommPool[1].u32BlkCnt = 1; - - ret = HI_MPI_VB_SetConfig((const VB_CONFIG_S *)&struVbConf); - if (HI_SUCCESS != ret) { - MS_LOG(ERROR) << "Error:HI_MPI_VB_SetConf failed!"; - return RET_ERROR; - } - - ret = HI_MPI_VB_Init(); - if (HI_SUCCESS != ret) { - MS_LOG(ERROR) << "Error:HI_MPI_VB_Init failed!"; - return RET_ERROR; - } - - ret = HI_MPI_SYS_Init(); - if (HI_SUCCESS != ret) { - MS_LOG(ERROR) << "Error:HI_MPI_SYS_Init failed!"; - return RET_ERROR; - } - - return RET_OK; -} - -int SvpSysExit() { - HI_S32 ret = HI_SUCCESS; - - ret = HI_MPI_SYS_Exit(); - if (HI_SUCCESS != ret) { - MS_LOG(ERROR) << "Error:HI_MPI_SYS_Exit failed!"; - return RET_ERROR; - } - - ret = HI_MPI_VB_Exit(); - if (HI_SUCCESS != ret) { - MS_LOG(ERROR) << "Error:HI_MPI_VB_Exit failed!"; - return RET_ERROR; - } - - return RET_OK; -} -#endif - BenchmarkBase::~BenchmarkBase() { for (const auto &iter : this->benchmark_data_) { delete (iter.second); } this->benchmark_data_.clear(); -#ifdef SUPPORT_NNIE - SvpSysExit(); -#endif } } // namespace lite diff --git a/mindspore/lite/tools/benchmark/benchmark_base.h b/mindspore/lite/tools/benchmark/benchmark_base.h index af94d0e5394..ced7a3fc38b 100644 --- a/mindspore/lite/tools/benchmark/benchmark_base.h +++ b/mindspore/lite/tools/benchmark/benchmark_base.h @@ -312,9 +312,5 @@ class MS_API BenchmarkBase { std::mt19937 random_engine_; }; -#ifdef SUPPORT_NNIE -int SvpSysInit(); -int SvpSysExit(); -#endif } // namespace mindspore::lite #endif // MINNIE_BENCHMARK_BENCHMARK_BASE_H_ diff --git a/mindspore/lite/tools/benchmark/benchmark_unified_api.cc b/mindspore/lite/tools/benchmark/benchmark_unified_api.cc index 2d85ee688b6..a3f7a6611ef 100644 --- a/mindspore/lite/tools/benchmark/benchmark_unified_api.cc +++ b/mindspore/lite/tools/benchmark/benchmark_unified_api.cc @@ -33,12 +33,6 @@ #include #include #endif -#ifdef SUPPORT_NNIE -#include "include/hi_common.h" -#include "include/hi_comm_vb.h" -#include "include/mpi_sys.h" -#include "include/mpi_vb.h" -#endif namespace mindspore { namespace lite { diff --git a/mindspore/lite/tools/benchmark/run_benchmark.cc b/mindspore/lite/tools/benchmark/run_benchmark.cc index bffbad9c93d..e83247d179e 100644 --- a/mindspore/lite/tools/benchmark/run_benchmark.cc +++ b/mindspore/lite/tools/benchmark/run_benchmark.cc @@ -22,9 +22,6 @@ namespace lite { int RunBenchmark(int argc, const char **argv) { BenchmarkFlags flags; Option err = flags.ParseFlags(argc, argv); -#ifdef SUPPORT_NNIE - SvpSysInit(); -#endif if (err.IsSome()) { std::cerr << err.Get() << std::endl; std::cerr << flags.Usage() << std::endl;