|
|
@@ -664,19 +664,22 @@ namespace { |
|
|
|
return SUCCESS; |
|
|
|
} |
|
|
|
|
|
|
|
Status CheckNoAicore(const ComputeGraphPtr &graph, bool &no_aicore) { |
|
|
|
bool CheckNoAicore(const ComputeGraphPtr &graph) { |
|
|
|
for (const auto &node : graph->GetDirectNode()) { |
|
|
|
GE_CHECK_NOTNULL(node); |
|
|
|
if (node == nullptr) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
auto op_desc = node->GetOpDesc(); |
|
|
|
GE_CHECK_NOTNULL(op_desc); |
|
|
|
if (op_desc == nullptr) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
if (op_desc->GetOpEngineName() == kAIcoreEngine) { |
|
|
|
no_aicore = false; |
|
|
|
return SUCCESS; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
return SUCCESS; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
} // namespace |
|
|
|
|
|
|
|
Status GeGenerator::CheckForSingleOp(OpDescPtr &op_desc, const vector<GeTensor> &inputs, |
|
|
|
const vector<GeTensor> &outputs) { |
|
|
@@ -758,9 +761,7 @@ Status GeGenerator::BuildSingleOp(OpDescPtr &op_desc, const vector<GeTensor> &in |
|
|
|
|
|
|
|
bool all_shape = false; |
|
|
|
(void)AttrUtils::GetBool(op_desc, kAicpuAllshape, all_shape); |
|
|
|
bool no_aicore = true; |
|
|
|
GE_CHK_STATUS_RET(CheckNoAicore(root_graph, no_aicore), "[Check][NoAicore] failed."); |
|
|
|
if (all_shape && no_aicore) { |
|
|
|
if (all_shape && CheckNoAicore(root_graph)) { |
|
|
|
GELOGD("Get aicpu all_shape kernel!"); |
|
|
|
vector<GeTensor> inputs_dynamic; |
|
|
|
vector<GeTensor> outputs_dynamic; |
|
|
|