Browse Source

Add ut.

tags/v1.3.0
zhaozhixuan 3 years ago
parent
commit
7a8a3599e1
1 changed files with 18 additions and 0 deletions
  1. +18
    -0
      tests/ut/ge/hybrid/executor/hybrid_model_async_executor_unittest.cc

+ 18
- 0
tests/ut/ge/hybrid/executor/hybrid_model_async_executor_unittest.cc View File

@@ -86,4 +86,22 @@ TEST_F(UtestHybridModelAsyncExecutor, BuildDeviceTensor) {
auto size = tensor.GetSize();
ASSERT_EQ(size, 100);
}

TEST_F(UtestHybridModelAsyncExecutor, Test_execute_internal) {
ComputeGraphPtr graph = std::make_shared<ComputeGraph>("test");
GeRootModelPtr ge_root_model = make_shared<GeRootModel>(graph);
ge_root_model->SetModelName("test_name");
HybridModel hybrid_model(ge_root_model);

HybridModelExecutor executor(&hybrid_model, 0, nullptr);
ASSERT_EQ(executor.Init(), SUCCESS);
auto &context = executor.context_;
GraphItem graph_item;
SubgraphExecutor subgraph_executor(&graph_item, &context);
HybridModelExecutor::ExecuteArgs args;
std::pair<rtEvent_t, std::pair<rtCallback_t, void *>> eof_entry;
eof_entry.first = nullptr;
context.callback_manager->callback_queue_.Push(eof_entry);
ASSERT_EQ(executor.ExecuteGraphInternal(subgraph_executor, args), SUCCESS);
}
} // namespace ge

Loading…
Cancel
Save