From d47d7b378a79f11580eb38d6566a47d28b43cc53 Mon Sep 17 00:00:00 2001 From: zhaozhixuan Date: Sat, 27 Mar 2021 20:25:12 +0800 Subject: [PATCH] Fix bug. --- ge/common/profiling/profiling_manager.cc | 4 ++-- ge/common/profiling/profiling_manager.h | 1 + tests/ut/ge/CMakeLists.txt | 3 --- tests/ut/ge/profiling/ge_profiling_manager_unittest.cc | 6 ------ 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/ge/common/profiling/profiling_manager.cc b/ge/common/profiling/profiling_manager.cc index 58148fe3..fbbf1f04 100644 --- a/ge/common/profiling/profiling_manager.cc +++ b/ge/common/profiling/profiling_manager.cc @@ -291,7 +291,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::Profilin #endif } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfileStepInfo( +FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::ProfileStepInfo( uint64_t index_id, uint64_t model_id, uint16_t tag_id, rtStream_t stream, int32_t device_id) { #ifdef DAVINCI_SUPPORT_PROFILING rtError_t rt_ret = RT_ERROR_NONE; @@ -338,7 +338,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfileStepInfo( } reported_data.append(",") .append("\n"); - ProfilingManager::Instance().ReportData(device_id, reported_data, "step_info"); + ReportData(device_id, reported_data, "step_info"); #endif return SUCCESS; } diff --git a/ge/common/profiling/profiling_manager.h b/ge/common/profiling/profiling_manager.h index f3d47763..ab344204 100755 --- a/ge/common/profiling/profiling_manager.h +++ b/ge/common/profiling/profiling_manager.h @@ -27,6 +27,7 @@ #include "framework/common/ge_types.h" #include "external/register/register_types.h" #include "toolchain/prof_callback.h" +#include "runtime/stream.h" using std::map; using std::string; diff --git a/tests/ut/ge/CMakeLists.txt b/tests/ut/ge/CMakeLists.txt index e8b76ca3..02ff7fcc 100755 --- a/tests/ut/ge/CMakeLists.txt +++ b/tests/ut/ge/CMakeLists.txt @@ -840,7 +840,6 @@ add_library(ge_ut_common STATIC ${COMMON_SRC_FILES} ${PROTO_HDRS}) target_compile_definitions(ge_ut_common PRIVATE google=ascend_private - DAVINCI_SUPPORT_PROFILING $<$:ONLY_COMPILE_OPEN_SRC> ) @@ -862,7 +861,6 @@ add_library(ge_ut_common_format STATIC ${COMMON_SRC_FILES} ${COMMON_FORMAT_SRC_F target_compile_definitions(ge_ut_common_format PRIVATE google=ascend_private - DAVINCI_SUPPORT_PROFILING $<$:ONLY_COMPILE_OPEN_SRC> ) @@ -1113,7 +1111,6 @@ target_compile_options(ut_libge_distinct_load_utest PRIVATE target_compile_definitions(ut_libge_distinct_load_utest PRIVATE google=ascend_private - DAVINCI_SUPPORT_PROFILING $<$:ONLY_COMPILE_OPEN_SRC> ) diff --git a/tests/ut/ge/profiling/ge_profiling_manager_unittest.cc b/tests/ut/ge/profiling/ge_profiling_manager_unittest.cc index 6bcb23d2..3dfbff41 100644 --- a/tests/ut/ge/profiling/ge_profiling_manager_unittest.cc +++ b/tests/ut/ge/profiling/ge_profiling_manager_unittest.cc @@ -78,9 +78,3 @@ TEST_F(UtestGeProfilinganager, plungin_init_) { EXPECT_EQ(ret, INTERNAL_ERROR); ProfilingManager::Instance().prof_cb_.msprofReporterCallback = nullptr; } - -TEST_F(UtestGeProfilinganager, test_step_info) { - ProfilingManager::Instance().prof_cb_.msprofReporterCallback = ReporterCallback; - EXPECT_EQ(ProfilingManager::Instance().ProfileStepInfo(0, 0, 0, nullptr, 0), SUCCESS); - ProfilingManager::Instance().prof_cb_.msprofReporterCallback = nullptr; -}