From 39140fb01af3df91dfc64528869ca0e9144f6c92 Mon Sep 17 00:00:00 2001 From: wangpingan2 Date: Fri, 10 Feb 2023 15:35:14 +0800 Subject: [PATCH] fix windows visual studio compile error. --- .../device/cpu/kernel/nnacl/fp32/pack_fp32.c | 32 +++++++++---------- mindspore/lite/tools/benchmark/CMakeLists.txt | 4 +++ 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32/pack_fp32.c b/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32/pack_fp32.c index 45a6cdeef56..fb86854d53b 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32/pack_fp32.c +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32/pack_fp32.c @@ -1017,52 +1017,52 @@ void RowMajor2Col4MajorParallel(const float *src_ptr, float *dst_ptr, int row, i } } -inline void RowMajor2ColMajor(const float *src_ptr, float *dst_ptr, int row, int col) { +void RowMajor2ColMajor(const float *src_ptr, float *dst_ptr, int row, int col) { RowMajor2ColMajorParallel(src_ptr, dst_ptr, row, col, 0, row); } -inline void RowMajor2RowMajor(const float *src_ptr, float *dst_ptr, int row, int col) { +void RowMajor2RowMajor(const float *src_ptr, float *dst_ptr, int row, int col) { RowMajor2RowMajorParallel(src_ptr, dst_ptr, row, col, 0, row); } -inline void RowMajor2Row4Major(const float *src_ptr, float *dst_ptr, int row, int col) { +void RowMajor2Row4Major(const float *src_ptr, float *dst_ptr, int row, int col) { RowMajor2Row4MajorParallel(src_ptr, dst_ptr, row, col, 0, row); } -inline void RowMajor2Row6Major(const float *src_ptr, float *dst_ptr, int row, int col) { +void RowMajor2Row6Major(const float *src_ptr, float *dst_ptr, int row, int col) { RowMajor2Row6MajorParallel(src_ptr, dst_ptr, row, col, 0, row); } -inline void RowMajor2Row8Major(const float *src_ptr, float *dst_ptr, int row, int col) { +void RowMajor2Row8Major(const float *src_ptr, float *dst_ptr, int row, int col) { RowMajor2Row8MajorParallel(src_ptr, dst_ptr, row, col, 0, row); } -inline void RowMajor2Row12Major(const float *src_ptr, float *dst_ptr, int row, int col) { +void RowMajor2Row12Major(const float *src_ptr, float *dst_ptr, int row, int col) { RowMajor2Row12MajorParallel(src_ptr, dst_ptr, row, col, 0, row); } -inline void RowMajor2Row16Major(const float *src_ptr, float *dst_ptr, int row, int col) { +void RowMajor2Row16Major(const float *src_ptr, float *dst_ptr, int row, int col) { RowMajor2Row16MajorParallel(src_ptr, dst_ptr, row, col, 0, row); } -inline void RowMajor2Row32Major(const float *src_ptr, float *dst_ptr, int col, int row) { +void RowMajor2Row32Major(const float *src_ptr, float *dst_ptr, int col, int row) { RowMajor2Row32MajorParallel(src_ptr, dst_ptr, col, row, 0, col); } -inline void RowMajor2Row64Major(const float *src_ptr, float *dst_ptr, int col, int row) { +void RowMajor2Row64Major(const float *src_ptr, float *dst_ptr, int col, int row) { RowMajor2Row64MajorParallel(src_ptr, dst_ptr, col, row, 0, col); } -inline void RowMajor2Col12Major(const float *src_ptr, float *dst_ptr, int row, int col) { +void RowMajor2Col12Major(const float *src_ptr, float *dst_ptr, int row, int col) { RowMajor2Col12MajorParallel(src_ptr, dst_ptr, row, col, 0, row); } -inline void RowMajor2Col8Major(const float *src_ptr, float *dst_ptr, int row, int col) { +void RowMajor2Col8Major(const float *src_ptr, float *dst_ptr, int row, int col) { RowMajor2Col8MajorParallel(src_ptr, dst_ptr, row, col, 0, row); } -inline void RowMajor2Col16Major(const float *src_ptr, float *dst_ptr, int row, int col) { +void RowMajor2Col16Major(const float *src_ptr, float *dst_ptr, int row, int col) { RowMajor2Col16MajorParallel(src_ptr, dst_ptr, row, col, 0, row); } -inline void RowMajor2Col32Major(const float *src_ptr, float *dst_ptr, int row, int col) { +void RowMajor2Col32Major(const float *src_ptr, float *dst_ptr, int row, int col) { RowMajor2Col32MajorParallel(src_ptr, dst_ptr, row, col, 0, row); } -inline void RowMajor2Col64Major(const float *src_ptr, float *dst_ptr, int row, int col) { +void RowMajor2Col64Major(const float *src_ptr, float *dst_ptr, int row, int col) { RowMajor2Col64MajorParallel(src_ptr, dst_ptr, row, col, 0, row); } -inline void RowMajor2Col6Major(const float *src_ptr, float *dst_ptr, int row, int col) { +void RowMajor2Col6Major(const float *src_ptr, float *dst_ptr, int row, int col) { RowMajor2Col6MajorParallel(src_ptr, dst_ptr, row, col, 0, row); } -inline void RowMajor2Col4Major(const float *src_ptr, float *dst_ptr, int row, int col) { +void RowMajor2Col4Major(const float *src_ptr, float *dst_ptr, int row, int col) { RowMajor2Col4MajorParallel(src_ptr, dst_ptr, row, col, 0, row); } diff --git a/mindspore/lite/tools/benchmark/CMakeLists.txt b/mindspore/lite/tools/benchmark/CMakeLists.txt index bb1194fb226..e4a3f9daccb 100644 --- a/mindspore/lite/tools/benchmark/CMakeLists.txt +++ b/mindspore/lite/tools/benchmark/CMakeLists.txt @@ -79,6 +79,10 @@ if(NOT (MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE)) set(C_SRC ${CMAKE_CURRENT_SOURCE_DIR}/benchmark_c_api.cc) endif() +if(MSVC) + set(COMMON_SRC ${COMMON_SRC} ${CMAKE_CURRENT_SOURCE_DIR}/../converter/converter_context.cc) +endif() + add_executable(benchmark ${CMAKE_CURRENT_SOURCE_DIR}/main.cc ${CMAKE_CURRENT_SOURCE_DIR}/run_benchmark.cc