Browse Source

split MergeToStreamMergePass, rm useless input param

tags/v1.1.0
chenyemeng 4 years ago
parent
commit
33e12ad183
3 changed files with 6 additions and 9 deletions
  1. +2
    -2
      ge/graph/passes/merge_input_memcpy_pass.cc
  2. +3
    -5
      ge/graph/passes/merge_to_stream_merge_pass.cc
  3. +1
    -2
      ge/graph/passes/merge_to_stream_merge_pass.h

+ 2
- 2
ge/graph/passes/merge_input_memcpy_pass.cc View File

@@ -42,7 +42,7 @@ Status MergeInputMemcpyPass::Run(ComputeGraphPtr graph) {
/// @return Status
///
Status MergeInputMemcpyPass::AddMemcpyAsyncNodes(const ComputeGraphPtr &graph, const NodePtr &node,
bool multi_batch_flag) {
bool multi_batch_flag) {
for (const InDataAnchorPtr &in_data_anchor : node->GetAllInDataAnchors()) {
OutDataAnchorPtr peer_out_anchor = in_data_anchor->GetPeerOutAnchor();
GE_IF_BOOL_EXEC(peer_out_anchor == nullptr, continue);
@@ -74,7 +74,7 @@ Status MergeInputMemcpyPass::AddMemcpyAsyncNodes(const ComputeGraphPtr &graph, c
/// @return ge::NodePtr
///
NodePtr MergeInputMemcpyPass::CreateMemcpyAsyncNode(const ComputeGraphPtr &graph, const std::string &name,
const OutDataAnchorPtr &out_data_anchor, bool multi_batch_flag) {
const OutDataAnchorPtr &out_data_anchor, bool multi_batch_flag) {
OpDescPtr pre_op_desc = out_data_anchor->GetOwnerNode()->GetOpDesc();
GE_CHK_BOOL_EXEC(pre_op_desc != nullptr, return nullptr, "OpDesc of pre node is invalid.");



+ 3
- 5
ge/graph/passes/merge_to_stream_merge_pass.cc View File

@@ -32,7 +32,7 @@ Status MergeToStreamMergePass::Run(ComputeGraphPtr graph) {
OpDescPtr merge_op_desc = node->GetOpDesc();
GE_CHECK_NOTNULL(merge_op_desc);
if (merge_op_desc->HasAttr(ATTR_INSERT_BY_MBATCH)) {
GE_CHK_STATUS_RET(AddActiveNodes(graph, node, true), "Merge add active node failed.");
GE_CHK_STATUS_RET(AddActiveNodes(graph, node), "Merge add active node failed.");
GE_CHK_STATUS_RET(SetStreamLabel(node, node->GetName()), "Set stream label failed");
} else {
GE_CHK_STATUS_RET(ReplaceMergeNode(graph, node), "Add StreamMerge node failed.");
@@ -99,18 +99,16 @@ Status MergeToStreamMergePass::ReplaceMergeNode(const ComputeGraphPtr &graph, co
}
}

return AddActiveNodes(graph, stream_merge, false);
return AddActiveNodes(graph, stream_merge);
}

///
/// @brief Add StreamActive Op before StreamMerge/Merge
/// @param [in] graph
/// @param [in] node
/// @param [in] multi_batch_flag
/// @return Status
///
Status MergeToStreamMergePass::AddActiveNodes(const ComputeGraphPtr &graph, const NodePtr &node,
bool multi_batch_flag) {
Status MergeToStreamMergePass::AddActiveNodes(const ComputeGraphPtr &graph, const NodePtr &node) {
GE_CHK_BOOL_EXEC(node != nullptr, return FAILED, "Param of pre node is null.");
for (const InDataAnchorPtr &in_data_anchor : node->GetAllInDataAnchors()) {
OutDataAnchorPtr peer_out_anchor = in_data_anchor->GetPeerOutAnchor();


+ 1
- 2
ge/graph/passes/merge_to_stream_merge_pass.h View File

@@ -37,10 +37,9 @@ class MergeToStreamMergePass : public GraphPass {
/// @brief Add StreamActive Op as StreamMerge in_node
/// @param [in] graph
/// @param [in] node
/// @param [in] multi_batch_flag
/// @return Status
///
Status AddActiveNodes(const ComputeGraphPtr &graph, const NodePtr &node, bool multi_batch_flag);
Status AddActiveNodes(const ComputeGraphPtr &graph, const NodePtr &node);

///
/// @brief Create Active Op


Loading…
Cancel
Save