| @@ -663,23 +663,23 @@ namespace { | |||||
| } | } | ||||
| return SUCCESS; | return SUCCESS; | ||||
| } | } | ||||
| } | |||||
| bool CheckNoAicore(const ComputeGraphPtr &graph) { | |||||
| for (const auto &node : graph->GetDirectNode()) { | |||||
| if (node == nullptr) { | |||||
| continue; | |||||
| } | |||||
| auto op_desc = node->GetOpDesc(); | |||||
| if (op_desc == nullptr) { | |||||
| continue; | |||||
| } | |||||
| if (op_desc->GetOpEngineName() == kAIcoreEngine) { | |||||
| return false; | |||||
| } | |||||
| bool GeGenerator::CheckNoAicore(const ComputeGraphPtr &graph) { | |||||
| for (const auto &node : graph->GetDirectNode()) { | |||||
| if (node == nullptr) { | |||||
| continue; | |||||
| } | |||||
| auto op_desc = node->GetOpDesc(); | |||||
| if (op_desc == nullptr) { | |||||
| continue; | |||||
| } | |||||
| if (op_desc->GetOpEngineName() == kAIcoreEngine) { | |||||
| return false; | |||||
| } | } | ||||
| return true; | |||||
| } | } | ||||
| } // namespace | |||||
| return true; | |||||
| } | |||||
| Status GeGenerator::CheckForSingleOp(OpDescPtr &op_desc, const vector<GeTensor> &inputs, | Status GeGenerator::CheckForSingleOp(OpDescPtr &op_desc, const vector<GeTensor> &inputs, | ||||
| const vector<GeTensor> &outputs) { | const vector<GeTensor> &outputs) { | ||||
| @@ -97,6 +97,7 @@ class GE_FUNC_VISIBILITY GeGenerator { | |||||
| Status BuildSingleOp(OpDescPtr &op_desc, const vector<GeTensor> &inputs, const vector<GeTensor> &outputs, | Status BuildSingleOp(OpDescPtr &op_desc, const vector<GeTensor> &inputs, const vector<GeTensor> &outputs, | ||||
| const string &model_file_name, OpEngineType engine_type, ModelBufferData &model_buff, | const string &model_file_name, OpEngineType engine_type, ModelBufferData &model_buff, | ||||
| bool is_offline = true); | bool is_offline = true); | ||||
| bool CheckNoAicore(const ComputeGraphPtr &graph); | |||||
| Status CheckForSingleOp(OpDescPtr &op_desc, const vector<GeTensor> &inputs, const vector<GeTensor> &outputs); | Status CheckForSingleOp(OpDescPtr &op_desc, const vector<GeTensor> &inputs, const vector<GeTensor> &outputs); | ||||
| class Impl; | class Impl; | ||||
| @@ -87,6 +87,13 @@ TEST_F(UtestGeGenerator, test_build_single_op_online) { | |||||
| EXPECT_EQ(generator.BuildSingleOpModel(op_desc, inputs, outputs, ENGINE_AIVECTOR, model_buffer), FAILED); | EXPECT_EQ(generator.BuildSingleOpModel(op_desc, inputs, outputs, ENGINE_AIVECTOR, model_buffer), FAILED); | ||||
| } | } | ||||
| TEST_F(UtestGeGenerator, test_build_single_op_online) { | |||||
| GeGenerator generator; | |||||
| generator.Initialize({}); | |||||
| auto graph = MakeGraph(); | |||||
| EXPECT_EQ(generator.CheckNoAicore(graph), true); | |||||
| } | |||||
| TEST_F(UtestGeGenerator, test_graph_manager) { | TEST_F(UtestGeGenerator, test_graph_manager) { | ||||
| GraphManager graph_manager; | GraphManager graph_manager; | ||||
| GraphPartitioner graph_partitioner; | GraphPartitioner graph_partitioner; | ||||