diff --git a/ge/graph/load/model_manager/davinci_model.cc b/ge/graph/load/model_manager/davinci_model.cc index 231ef755..9954ceaf 100755 --- a/ge/graph/load/model_manager/davinci_model.cc +++ b/ge/graph/load/model_manager/davinci_model.cc @@ -147,7 +147,6 @@ DavinciModel::DavinciModel(int32_t priority, const std::shared_ptrStop(); + if (data_inputer_ != nullptr) { + data_inputer_->Stop(); + } if (thread_id_.joinable()) { thread_id_.join(); } + if (shrink_id_.joinable()) { + shrink_id_.join(); + } + return SUCCESS; } @@ -2820,8 +2823,6 @@ Status DavinciModel::ModelRunStop() { LockRunFlg(); GE_MAKE_GUARD(tmp_lock, [&] { UnlockRunFlg(); }); - GE_IF_BOOL_EXEC(!run_flg_, return SUCCESS); - GE_CHK_STATUS_RET(DestroyThread(), "DestoyThead failed."); return SUCCESS; diff --git a/ge/graph/load/model_manager/davinci_model.h b/ge/graph/load/model_manager/davinci_model.h index 8ed82912..31cc9939 100755 --- a/ge/graph/load/model_manager/davinci_model.h +++ b/ge/graph/load/model_manager/davinci_model.h @@ -907,6 +907,7 @@ class DavinciModel { vector output_memory_size_list_; thread thread_id_; + thread shrink_id_; shared_ptr listener_; diff --git a/tests/ut/ge/graph/load/davinci_model_unittest.cc b/tests/ut/ge/graph/load/davinci_model_unittest.cc index 5f08f425..c90a4997 100644 --- a/tests/ut/ge/graph/load/davinci_model_unittest.cc +++ b/tests/ut/ge/graph/load/davinci_model_unittest.cc @@ -284,7 +284,9 @@ TEST_F(UtestDavinciModel, init_unknown) { memcpy_async->set_op_index(2); EXPECT_EQ(model.Assign(ge_model), SUCCESS); + ProfilingManager::Instance().is_load_profiling_ = true; EXPECT_EQ(model.Init(), SUCCESS); + ProfilingManager::Instance().is_load_profiling_ = false; EXPECT_EQ(model.input_addrs_list_.size(), 1); EXPECT_EQ(model.output_addrs_list_.size(), 1);