@@ -357,7 +357,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void OpUtils::TransDataHWCK2KCH | |||||
const char *w_data = (const char *)input; | const char *w_data = (const char *)input; | ||||
int64_t count = h * w * c * k; | int64_t count = h * w * c * k; | ||||
GE_IF_BOOL_EXEC(count <= 0, GELOGW("Count value must be greater than 0, but count = %ld", count); return ); | |||||
GE_IF_BOOL_EXEC(count <= 0, GELOGW("Count value must be greater than 0, but count = %ld", count); return); | |||||
float *buf = new (std::nothrow) float[count](); | float *buf = new (std::nothrow) float[count](); | ||||
GE_RT_VOID_CHECK_NOTNULL(buf); | GE_RT_VOID_CHECK_NOTNULL(buf); | ||||
float *src_buff = nullptr; | float *src_buff = nullptr; | ||||
@@ -217,7 +217,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ge::Status ProfilingManager::In | |||||
char profiling_mode_temp[MMPA_MAX_PATH] = { 0x00 }; | char profiling_mode_temp[MMPA_MAX_PATH] = { 0x00 }; | ||||
char prof_options_temp[MMPA_MAX_PATH] = { 0x00 }; | char prof_options_temp[MMPA_MAX_PATH] = { 0x00 }; | ||||
(void)mmGetEnv("PROFILING_MODE", profiling_mode_temp, MMPA_MAX_PATH); | (void)mmGetEnv("PROFILING_MODE", profiling_mode_temp, MMPA_MAX_PATH); | ||||
(void)mmGetEnv("PROFILING_OPTIONS", prof_options_temp, MMPA_MAX_PATH ); | |||||
(void)mmGetEnv("PROFILING_OPTIONS", prof_options_temp, MMPA_MAX_PATH); | |||||
const char *profiling_mode = profiling_mode_temp; | const char *profiling_mode = profiling_mode_temp; | ||||
const char *prof_options = prof_options_temp; | const char *prof_options = prof_options_temp; | ||||
if ((profiling_mode == nullptr) || (strcmp("true", profiling_mode) != 0) || (prof_options == nullptr)) { | if ((profiling_mode == nullptr) || (strcmp("true", profiling_mode) != 0) || (prof_options == nullptr)) { | ||||
@@ -282,7 +282,7 @@ Status ModelBuilder::SetInputOutputDesc() { | |||||
void ModelBuilder::AddNodeInputProperty() { | void ModelBuilder::AddNodeInputProperty() { | ||||
for (const ge::NodePtr &node : compute_graph_->GetNodes(compute_graph_->GetGraphUnknownFlag())) { | for (const ge::NodePtr &node : compute_graph_->GetNodes(compute_graph_->GetGraphUnknownFlag())) { | ||||
auto node_op_desc = node->GetOpDesc(); | auto node_op_desc = node->GetOpDesc(); | ||||
GE_IF_BOOL_EXEC(node_op_desc == nullptr, GELOGW("node_op_desc is nullptr!"); return ); | |||||
GE_IF_BOOL_EXEC(node_op_desc == nullptr, GELOGW("node_op_desc is nullptr!"); return); | |||||
vector<string> src_name_list; | vector<string> src_name_list; | ||||
vector<int64_t> src_index_list; | vector<int64_t> src_index_list; | ||||
for (const auto &in_data_anchor : node->GetAllInDataAnchors()) { | for (const auto &in_data_anchor : node->GetAllInDataAnchors()) { | ||||
@@ -309,10 +309,10 @@ void ModelBuilder::AddNodeInputProperty() { | |||||
for (const ge::NodePtr &node : compute_graph_->GetNodes(compute_graph_->GetGraphUnknownFlag())) { | for (const ge::NodePtr &node : compute_graph_->GetNodes(compute_graph_->GetGraphUnknownFlag())) { | ||||
auto node_op_desc = node->GetOpDesc(); | auto node_op_desc = node->GetOpDesc(); | ||||
GE_IF_BOOL_EXEC(node_op_desc == nullptr, GELOGW("node_op_desc is nullptr!"); return ); | |||||
GE_IF_BOOL_EXEC(node_op_desc == nullptr, GELOGW("node_op_desc is nullptr!"); return); | |||||
GE_IF_BOOL_EXEC(node_op_desc->GetType() == NETOUTPUT, continue); | GE_IF_BOOL_EXEC(node_op_desc->GetType() == NETOUTPUT, continue); | ||||
auto out_control_anchor = node->GetOutControlAnchor(); | auto out_control_anchor = node->GetOutControlAnchor(); | ||||
GE_IF_BOOL_EXEC(out_control_anchor == nullptr, GELOGW("out_control_anchor is nullptr"); return ); | |||||
GE_IF_BOOL_EXEC(out_control_anchor == nullptr, GELOGW("out_control_anchor is nullptr"); return); | |||||
vector<string> dst_name_list; | vector<string> dst_name_list; | ||||
vector<int64_t> dst_index_list; | vector<int64_t> dst_index_list; | ||||
string dst_name_temp; | string dst_name_temp; | ||||
@@ -330,7 +330,7 @@ void ModelBuilder::AddNodeInputProperty() { | |||||
dst_name_temp = ""; | dst_name_temp = ""; | ||||
int64_t dst_index = kWrongIndex; // assign an impossible value to dst_index. | int64_t dst_index = kWrongIndex; // assign an impossible value to dst_index. | ||||
for (const auto &in_data_anchor : out_data_anchor->GetPeerInDataAnchors()) { | for (const auto &in_data_anchor : out_data_anchor->GetPeerInDataAnchors()) { | ||||
GE_IF_BOOL_EXEC(in_data_anchor == nullptr, GELOGW("in_data_anchor is nullptr"); return ); | |||||
GE_IF_BOOL_EXEC(in_data_anchor == nullptr, GELOGW("in_data_anchor is nullptr"); return); | |||||
ge::NodePtr dst_node = in_data_anchor->GetOwnerNode(); | ge::NodePtr dst_node = in_data_anchor->GetOwnerNode(); | ||||
dst_name_temp = dst_name_temp.empty() ? dst_node->GetName() : dst_name_temp + ":" + dst_node->GetName(); | dst_name_temp = dst_name_temp.empty() ? dst_node->GetName() : dst_name_temp + ":" + dst_node->GetName(); | ||||
dst_index = in_data_anchor->GetIdx(); | dst_index = in_data_anchor->GetIdx(); | ||||
@@ -38,7 +38,7 @@ void StreamGraphOptimizer::RefreshNodeId(const ComputeGraphPtr &comp_graph, Grap | |||||
continue; | continue; | ||||
} | } | ||||
for (ge::NodePtr &node : subgraph->GetDirectNode()) { | for (ge::NodePtr &node : subgraph->GetDirectNode()) { | ||||
GE_CHECK_NOTNULL_EXEC(node->GetOpDesc(), return ); | |||||
GE_CHECK_NOTNULL_EXEC(node->GetOpDesc(), return); | |||||
if ((node->GetType() == END) || (node->GetType() == PLACEHOLDER)) { | if ((node->GetType() == END) || (node->GetType() == PLACEHOLDER)) { | ||||
node->GetOpDesc()->SetId(static_cast<int64_t>(node_size)); | node->GetOpDesc()->SetId(static_cast<int64_t>(node_size)); | ||||
node_size++; | node_size++; | ||||
@@ -63,7 +63,7 @@ void TransOpWithoutReshapeFusionPass::SetRemainNode( | |||||
continue; | continue; | ||||
} | } | ||||
GELOGI("SetRemainNode node is %s", op_desc->GetName().c_str()); | GELOGI("SetRemainNode node is %s", op_desc->GetName().c_str()); | ||||
GE_IF_BOOL_EXEC(!op_desc->SetExtAttr(kRemainNode, true), GELOGE(INTERNAL_ERROR, "set ext attr failed"); return ); | |||||
GE_IF_BOOL_EXEC(!op_desc->SetExtAttr(kRemainNode, true), GELOGE(INTERNAL_ERROR, "set ext attr failed"); return); | |||||
} | } | ||||
} | } | ||||
@@ -594,7 +594,7 @@ void TransOpWithoutReshapeFusionPass::GetBeginOutDescAndEndInDesc(const int inde | |||||
auto out_owner_node = out_peer_anchor->GetOwnerNode(); | auto out_owner_node = out_peer_anchor->GetOwnerNode(); | ||||
GE_CHECK_NOTNULL_JUST_RETURN(out_owner_node); | GE_CHECK_NOTNULL_JUST_RETURN(out_owner_node); | ||||
auto out_peer_op_desc = out_owner_node->GetOpDesc(); | auto out_peer_op_desc = out_owner_node->GetOpDesc(); | ||||
GE_IF_BOOL_EXEC(out_peer_op_desc == nullptr, GELOGE(INTERNAL_ERROR, "out_peer_op_desc is nullptr"); return ); | |||||
GE_IF_BOOL_EXEC(out_peer_op_desc == nullptr, GELOGE(INTERNAL_ERROR, "out_peer_op_desc is nullptr"); return); | |||||
out_desc = out_peer_op_desc->GetInputDesc(out_peer_anchor->GetIdx()); | out_desc = out_peer_op_desc->GetInputDesc(out_peer_anchor->GetIdx()); | ||||
auto in_peer_anchor = nodes_anchor.back().first; | auto in_peer_anchor = nodes_anchor.back().first; | ||||
@@ -602,7 +602,7 @@ void TransOpWithoutReshapeFusionPass::GetBeginOutDescAndEndInDesc(const int inde | |||||
auto in_owner_node = in_peer_anchor->GetOwnerNode(); | auto in_owner_node = in_peer_anchor->GetOwnerNode(); | ||||
GE_CHECK_NOTNULL_JUST_RETURN(in_owner_node); | GE_CHECK_NOTNULL_JUST_RETURN(in_owner_node); | ||||
auto in_peer_op_desc = in_owner_node->GetOpDesc(); | auto in_peer_op_desc = in_owner_node->GetOpDesc(); | ||||
GE_IF_BOOL_EXEC(in_peer_op_desc == nullptr, GELOGE(INTERNAL_ERROR, "in_peer_op_desc is nullptr"); return ); | |||||
GE_IF_BOOL_EXEC(in_peer_op_desc == nullptr, GELOGE(INTERNAL_ERROR, "in_peer_op_desc is nullptr"); return); | |||||
in_desc = in_peer_op_desc->GetOutputDesc(in_peer_anchor->GetIdx()); | in_desc = in_peer_op_desc->GetOutputDesc(in_peer_anchor->GetIdx()); | ||||
} | } | ||||
@@ -734,7 +734,7 @@ void TransOpWithoutReshapeFusionPass::RemoveNousedNodes(const ComputeGraphPtr &g | |||||
continue; | continue; | ||||
} | } | ||||
GE_IF_BOOL_EXEC(!op_desc->SetExtAttr(kRemainNode, true), GELOGE(INTERNAL_ERROR, "set ext attr failed"); return ); | |||||
GE_IF_BOOL_EXEC(!op_desc->SetExtAttr(kRemainNode, true), GELOGE(INTERNAL_ERROR, "set ext attr failed"); return); | |||||
GELOGI("remove node:%s", node->GetName().c_str()); | GELOGI("remove node:%s", node->GetName().c_str()); | ||||
if (graph->RemoveNode(node) != GRAPH_SUCCESS) { | if (graph->RemoveNode(node) != GRAPH_SUCCESS) { | ||||
GELOGW("remove node failed!node:%s", node->GetName().c_str()); | GELOGW("remove node failed!node:%s", node->GetName().c_str()); | ||||
@@ -217,11 +217,11 @@ void TransposeTransDataPass::CopyInputEdges(NodePtr &origin_node, NodePtr &new_n | |||||
} | } | ||||
OutDataAnchorPtr out_anchor = origin_node->GetInDataAnchor(0)->GetPeerOutAnchor(); | OutDataAnchorPtr out_anchor = origin_node->GetInDataAnchor(0)->GetPeerOutAnchor(); | ||||
new_in_data_anchor->UnlinkAll(); | new_in_data_anchor->UnlinkAll(); | ||||
GE_IF_BOOL_EXEC(new_in_data_anchor->LinkFrom(out_anchor) != GRAPH_SUCCESS, GELOGW("Link failed"); return ); | |||||
GE_IF_BOOL_EXEC(new_in_data_anchor->LinkFrom(out_anchor) != GRAPH_SUCCESS, GELOGW("Link failed"); return); | |||||
// control anchor only link to control anchor | // control anchor only link to control anchor | ||||
GE_IF_BOOL_EXEC( | GE_IF_BOOL_EXEC( | ||||
GraphUtils::CopyInCtrlEdges(origin_node, new_node) != GRAPH_SUCCESS, GELOGW("Copy in ctrl edges failed"); return ); | |||||
GraphUtils::CopyInCtrlEdges(origin_node, new_node) != GRAPH_SUCCESS, GELOGW("Copy in ctrl edges failed"); return); | |||||
} | } | ||||
bool TransposeTransDataPass::TransDataCheckAccuracySupported(const OpDescPtr &op_desc) { | bool TransposeTransDataPass::TransDataCheckAccuracySupported(const OpDescPtr &op_desc) { | ||||
@@ -318,8 +318,8 @@ Status VariableOpPass::FusionIfNeed(const NodePtr &var, VarTransRoad &fusion_roa | |||||
} | } | ||||
Status VariableOpPass::UpdateTransRoad(VarTransRoad &fusion_road, vector<std::string> &first_path_trans_order, | Status VariableOpPass::UpdateTransRoad(VarTransRoad &fusion_road, vector<std::string> &first_path_trans_order, | ||||
map<std::string,std::pair<std::string, bool>> &trans_type_to_changed_desc, | |||||
map<std::string,vector<NodePtr>> &trans_type_to_trans_ops){ | |||||
map<std::string, std::pair<std::string, bool>> &trans_type_to_changed_desc, | |||||
map<std::string, vector<NodePtr>> &trans_type_to_trans_ops){ | |||||
vector<std::string> delete_trans_type; | vector<std::string> delete_trans_type; | ||||
for (auto &trans_type : first_path_trans_order) { | for (auto &trans_type : first_path_trans_order) { | ||||
if (trans_type_to_changed_desc.find(trans_type) == trans_type_to_changed_desc.end()) { | if (trans_type_to_changed_desc.find(trans_type) == trans_type_to_changed_desc.end()) { | ||||
@@ -45,8 +45,8 @@ class VariableOpPass : public GraphPass { | |||||
private: | private: | ||||
Status UpdateTransRoad(VarTransRoad &fusion_road, vector<string> &trans_road_order, | Status UpdateTransRoad(VarTransRoad &fusion_road, vector<string> &trans_road_order, | ||||
map<string,pair<string, bool>> &trans_type_to_changed_desc, | |||||
map<string,vector<NodePtr>> &trans_type_to_trans_ops); | |||||
map<string, pair<string, bool>> &trans_type_to_changed_desc, | |||||
map<string, vector<NodePtr>> &trans_type_to_trans_ops); | |||||
Status DealFusion(const ge::NodePtr &var_node, VarTransRoad &fusion_road, | Status DealFusion(const ge::NodePtr &var_node, VarTransRoad &fusion_road, | ||||
map<string, pair<string, bool>> trans_type_to_changed_desc, | map<string, pair<string, bool>> trans_type_to_changed_desc, | ||||
@@ -1701,7 +1701,7 @@ Status GraphPrepare::PrepareOptimize() { | |||||
try { | try { | ||||
(void)original_graph_passes.AddPass("PrepareOptimize::ShapeOperateOpRemovePass", new ShapeOperateOpRemovePass); | (void)original_graph_passes.AddPass("PrepareOptimize::ShapeOperateOpRemovePass", new ShapeOperateOpRemovePass); | ||||
(void)original_graph_passes.AddPass("PrepareOptimize::ReplaceTransShapePass", new ReplaceTransShapePass); | (void)original_graph_passes.AddPass("PrepareOptimize::ReplaceTransShapePass", new ReplaceTransShapePass); | ||||
(void)original_graph_passes.AddPass("PrepareOptimize::MarkAgnosticPass" , new MarkAgnosticPass); | |||||
(void)original_graph_passes.AddPass("PrepareOptimize::MarkAgnosticPass", new MarkAgnosticPass); | |||||
} catch (std::bad_alloc &e) { | } catch (std::bad_alloc &e) { | ||||
GELOGE(INTERNAL_ERROR, "Add pass failed, bad memory allocation occurs."); | GELOGE(INTERNAL_ERROR, "Add pass failed, bad memory allocation occurs."); | ||||
return INTERNAL_ERROR; | return INTERNAL_ERROR; | ||||
@@ -408,7 +408,7 @@ Status AippOp::ConvertRelatedInputNameToRank() { | |||||
GE_CHECK_NOTNULL(aipp_params_); | GE_CHECK_NOTNULL(aipp_params_); | ||||
string related_input_name = aipp_params_->related_input_name(); | string related_input_name = aipp_params_->related_input_name(); | ||||
if(related_input_name.empty()) { | |||||
if (related_input_name.empty()) { | |||||
return SUCCESS; | return SUCCESS; | ||||
} | } | ||||
@@ -470,7 +470,7 @@ Status InsertNewOpUtil::UpdateDataBySwitchN(const NodePtr &switchn, const NodePt | |||||
} | } | ||||
} | } | ||||
if (max_index >= switchn->GetOpDesc()->GetOutputsSize()) { | if (max_index >= switchn->GetOpDesc()->GetOutputsSize()) { | ||||
string error_msg = "No max size found from switchn node[" + switchn->GetName()+ "]"; | |||||
string error_msg = "No max size found from switchn node[" + switchn->GetName() + "]"; | |||||
GE_ERRORLOG_AND_ERRORMSG(INTERNAL_ERROR, error_msg.c_str()); | GE_ERRORLOG_AND_ERRORMSG(INTERNAL_ERROR, error_msg.c_str()); | ||||
return INTERNAL_ERROR; | return INTERNAL_ERROR; | ||||
} | } | ||||
@@ -308,7 +308,7 @@ void StridedSliceKernel::ExpandStrideWithEllipsisMask(const size_t x_dims_num, | |||||
if (orig_begin_vec.size() < x_dims_num) { | if (orig_begin_vec.size() < x_dims_num) { | ||||
for (size_t j = 1; j < (x_dims_num - orig_begin_vec.size() + 1); ++j) { | for (size_t j = 1; j < (x_dims_num - orig_begin_vec.size() + 1); ++j) { | ||||
orig_begin_vec.insert((orig_begin_vec.begin() + ellipsis_dim + j), 0); | orig_begin_vec.insert((orig_begin_vec.begin() + ellipsis_dim + j), 0); | ||||
orig_end_vec.insert((orig_end_vec.begin() + ellipsis_dim + j), x_dims.at(ellipsis_dim +j)); | |||||
orig_end_vec.insert((orig_end_vec.begin() + ellipsis_dim + j), x_dims.at(ellipsis_dim + j)); | |||||
orig_stride_vec.insert((orig_stride_vec.begin() + ellipsis_dim + j), 1); | orig_stride_vec.insert((orig_stride_vec.begin() + ellipsis_dim + j), 1); | ||||
} | } | ||||
} | } | ||||
@@ -543,7 +543,7 @@ graphStatus aclgrphInferShapeAndType(ge::Graph &graph) { | |||||
} | } | ||||
auto ret = compute_graph->TopologicalSorting(); | auto ret = compute_graph->TopologicalSorting(); | ||||
if(ret != GRAPH_SUCCESS) { | |||||
if (ret != GRAPH_SUCCESS) { | |||||
GELOGE(ret, "Acl topo logical sort failed."); | GELOGE(ret, "Acl topo logical sort failed."); | ||||
return ret; | return ret; | ||||
} | } | ||||