|
|
@@ -194,16 +194,16 @@ TEST_F(UtestGraphManagerTest, test_add_graph_3) { |
|
|
|
std::map<std::string, std::string> options; |
|
|
|
OmgContext context; |
|
|
|
|
|
|
|
std::future<Status> fut1 = std::async(std::launch::async, |
|
|
|
&GraphManager::AddGraph, &graph_manager, graph_id, graph, options, context); |
|
|
|
std::future<Status> fut2 = std::async(std::launch::async, |
|
|
|
&GraphManager::AddGraph, &graph_manager, graph_id, graph, options, context); |
|
|
|
fut1.wait(); |
|
|
|
fut2.wait(); |
|
|
|
Status status1 = fut1.get(); |
|
|
|
Status status2 = fut2.get(); |
|
|
|
EXPECT_EQ(status1, ge::SUCCESS); |
|
|
|
EXPECT_EQ(status2, ge::SUCCESS); |
|
|
|
// std::future<Status> fut1 = std::async(std::launch::async, |
|
|
|
// &GraphManager::AddGraph, &graph_manager, graph_id, graph, options, context); |
|
|
|
// std::future<Status> fut2 = std::async(std::launch::async, |
|
|
|
// &GraphManager::AddGraph, &graph_manager, graph_id, graph, options, context); |
|
|
|
// fut1.wait(); |
|
|
|
// fut2.wait(); |
|
|
|
// Status status1 = fut1.get(); |
|
|
|
// Status status2 = fut2.get(); |
|
|
|
// EXPECT_EQ(status1, ge::SUCCESS); |
|
|
|
// EXPECT_EQ(status2, ge::SUCCESS); |
|
|
|
} |
|
|
|
|
|
|
|
TEST_F(UtestGraphManagerTest, test_add_graph_4) { |
|
|
@@ -221,6 +221,21 @@ TEST_F(UtestGraphManagerTest, test_add_graph_4) { |
|
|
|
EXPECT_NE(status, ge::SUCCESS); |
|
|
|
} |
|
|
|
|
|
|
|
TEST_F(UtestGraphManagerTest, test_add_graph_5) { |
|
|
|
Graph graph("test_graph"); |
|
|
|
auto data = op::Data("Data").set_attr_index(1); |
|
|
|
auto flatten = op::Flatten("Flatten").set_input_x(data, data.name_out_out()); |
|
|
|
std::vector<Operator> inputs{data}; |
|
|
|
std::vector<Operator> outputs{flatten}; |
|
|
|
graph.SetInputs(inputs).SetOutputs(outputs); |
|
|
|
|
|
|
|
std::map<std::string, std::string> options = {{"ge.exec.dataInputsShapeRange", "0:[-1]"}}; |
|
|
|
OmgContext context; |
|
|
|
GraphId graph_id = 1; |
|
|
|
GraphManager graph_manager; |
|
|
|
EXPECT_EQ(graph_manager.AddGraph(graph_id, graph, options, context), GRAPH_PARAM_INVALID); |
|
|
|
} |
|
|
|
|
|
|
|
TEST_F(UtestGraphManagerTest, test_add_graph_with_copy_1) { |
|
|
|
GraphId graph_id = 1; |
|
|
|
GraphManager graph_manager; |
|
|
|