fix himix200 bulid
This commit is contained in:
parent
8729b60a90
commit
382c1a42cb
|
@ -4,8 +4,7 @@ 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
|
||||
add_executable(benchmark
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/main.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/run_benchmark.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/benchmark_base.cc
|
||||
|
@ -13,36 +12,14 @@ if(NOT TARGET_HIMIX200)
|
|||
${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((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)
|
||||
endif()
|
||||
else()
|
||||
else()
|
||||
target_link_libraries(benchmark mindspore-lite mindspore::json pthread)
|
||||
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)
|
||||
endif()
|
||||
|
|
|
@ -33,12 +33,6 @@
|
|||
#include <asm/unistd.h>
|
||||
#include <unistd.h>
|
||||
#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 {
|
||||
|
|
|
@ -33,12 +33,6 @@
|
|||
#include <asm/unistd.h>
|
||||
#include <unistd.h>
|
||||
#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<std::string> &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
|
||||
|
|
|
@ -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_
|
||||
|
|
|
@ -33,12 +33,6 @@
|
|||
#include <asm/unistd.h>
|
||||
#include <unistd.h>
|
||||
#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 {
|
||||
|
|
|
@ -22,9 +22,6 @@ namespace lite {
|
|||
int RunBenchmark(int argc, const char **argv) {
|
||||
BenchmarkFlags flags;
|
||||
Option<std::string> 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;
|
||||
|
|
Loading…
Reference in New Issue