Skip to content

Commit

Permalink
Return stream ids to free pool when skipping.
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
  • Loading branch information
mzient committed Sep 2, 2024
1 parent 6aebb84 commit 01e9a1c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dali/pipeline/executor/executor2/stream_assignment.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ class StreamAssignment<StreamPolicy::PerOperator> {
// GPU nodes.
bool keep_stream_id = stream_id.has_value();

if (stream_id.has_value())
free_stream_ids_.insert(*stream_id);

graph::Visit v(node);
if (!v) {
assert(stream_assignment_[idx].value_or(kInvalidStreamIdx) <= stream_idx);
Expand All @@ -246,8 +249,6 @@ class StreamAssignment<StreamPolicy::PerOperator> {

stream_assignment_[idx] = stream_id;

if (stream_id.has_value())
free_stream_ids_.insert(*stream_id);
for (auto &output_desc : node->outputs) {
for (auto *out : output_desc.consumers) {
auto out_stream_id = NextStreamId(out->consumer, stream_id);
Expand Down

0 comments on commit 01e9a1c

Please sign in to comment.