!5524 fix stream bug

Merge pull request !5524 from gukecai/stream-bug
This commit is contained in:
mindspore-ci-bot 2020-09-03 17:06:07 +08:00 committed by Gitee
commit 6e463f29d3
1 changed files with 2 additions and 3 deletions

View File

@ -736,10 +736,9 @@ void AscendStreamAssign::InsertEventCommonDependHcom(const NotNull<KernelGraphPt
vector<CNodePtr> cnodes = cnode_ptr_list;
uint32_t cur_event_id = resource_manager.ApplyNewEvent();
auto it = cnodes.begin();
while (it != cnodes.end() && (it + 1) != cnodes.end()) {
while (it != cnodes.end()) {
MS_EXCEPTION_IF_NULL(*it);
MS_EXCEPTION_IF_NULL(*(it + 1));
if (IsHcom(*it) && !IsHcom(*(it + 1))) {
if (IsHcom(*it)) {
CNodePtr send_cnode_ptr = CreateSendApplyKernel(graph_ptr, cur_event_id, AnfAlgo::GetStreamId(*it));
it = cnodes.insert(it + 1, send_cnode_ptr);