|
|
@@ -48,23 +48,6 @@ int32_t ReporterCallback(uint32_t moduleId, uint32_t type, void *data, uint32_t |
|
|
|
return -1; |
|
|
|
} |
|
|
|
|
|
|
|
void CreateGraph(Graph &graph) { |
|
|
|
TensorDesc desc(ge::Shape({1, 3, 224, 224})); |
|
|
|
uint32_t size = desc.GetShape().GetShapeSize(); |
|
|
|
desc.SetSize(size); |
|
|
|
auto data = op::Data("Data").set_attr_index(0); |
|
|
|
data.update_input_desc_data(desc); |
|
|
|
data.update_output_desc_out(desc); |
|
|
|
|
|
|
|
auto flatten = op::Flatten("Flatten").set_input_x(data, data.name_out_out()); |
|
|
|
|
|
|
|
std::vector<Operator> inputs{data}; |
|
|
|
std::vector<Operator> outputs{flatten}; |
|
|
|
std::vector<Operator> targets{flatten}; |
|
|
|
// Graph graph("test_graph"); |
|
|
|
graph.SetInputs(inputs).SetOutputs(outputs).SetTargets(targets); |
|
|
|
} |
|
|
|
|
|
|
|
TEST_F(UtestGeProfilinganager, init_success) { |
|
|
|
setenv("PROFILING_MODE", "true", true); |
|
|
|
Options options; |
|
|
@@ -156,23 +139,6 @@ TEST_F(UtestGeProfilinganager, set_step_info_failed) { |
|
|
|
EXPECT_EQ(ret, ge::FAILED); |
|
|
|
} |
|
|
|
|
|
|
|
TEST_F(UtestGeProfilinganager, get_device_from_graph) { |
|
|
|
GraphId graph_id = 1; |
|
|
|
uint32_t device_id = 0; |
|
|
|
GraphManager graph_manager; |
|
|
|
GraphNodePtr graph_node = MakeShared<ge::GraphNode>(graph_id); |
|
|
|
graph_manager.AddGraphNode(graph_id, graph_node); |
|
|
|
graph_manager.SetAddGraphCondition(graph_id, 2); |
|
|
|
Graph graph("test_graph"); |
|
|
|
CreateGraph(graph); |
|
|
|
std::map<std::string, std::string> options; |
|
|
|
OmgContext context; |
|
|
|
Status ret = graph_manager.AddGraph(graph_id, graph, options, context); |
|
|
|
EXPECT_EQ(ret, ge::SUCCESS); |
|
|
|
ret = ProfGetDeviceFormGraphId(graph_id, device_id); |
|
|
|
EXPECT_EQ(ret, ge::SUCCESS); |
|
|
|
} |
|
|
|
|
|
|
|
TEST_F(UtestGeProfilinganager, handle_subscribe_info) { |
|
|
|
ProfCommandHandleType prof_type = kProfCommandhandleModelSubscribe; |
|
|
|
ProfCommandHandleData prof_data; |
|
|
|