Skip to content

Commit

Permalink
tiling: Remove OutputStage::Done()
Browse files Browse the repository at this point in the history
Remove OutputStage::Done() and explicitly test the output interval
size from the top level pipeline. We also set the branch complete flag
with a new helper OutputStage::SetBranchComplete() to be explicit.

Rename OutputStage::BranchComplete() to OutputStage::GetBranchComplete()
for consistency.

Signed-off-by: Naushir Patuck <[email protected]>
  • Loading branch information
naushir committed Aug 1, 2024
1 parent 13b81f8 commit 3a61f12
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
10 changes: 4 additions & 6 deletions src/libpisp/backend/tiling/output_stage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,13 @@ void OutputStage::Reset()
branch_complete_ = false;
}

bool OutputStage::BranchComplete() const
bool OutputStage::GetBranchComplete() const
{
return branch_complete_;
}

bool OutputStage::Done(Dir dir)
void OutputStage::SetBranchComplete()
{
if (output_interval_.End() >= GetOutputImageSize()[dir])
branch_complete_ = true;

return branch_complete_;
branch_complete_ = true;
PISP_LOG(debug, "(" << name_ << ") Setting branch complete");
}
4 changes: 2 additions & 2 deletions src/libpisp/backend/tiling/output_stage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class OutputStage : public BasicStage
virtual void PushEndUp(int output_end, Dir dir);
virtual void PushCropDown(Interval interval, Dir dir);
virtual void Reset();
bool BranchComplete() const;
bool Done(Dir dir);
bool GetBranchComplete() const;
void SetBranchComplete();

private:
Config config_;
Expand Down
9 changes: 8 additions & 1 deletion src/libpisp/backend/tiling/pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,14 @@ int Pipeline::tileDirection(Dir dir, void *mem, size_t num_items, size_t item_si
s->CopyOut(dest, dir);
done = true;
for (auto s : outputs_)
done &= s->Done(dir);
{
if (s->GetBranchComplete())
continue;
else if (s->GetOutputInterval().End() >= s->GetOutputImageSize()[dir])
s->SetBranchComplete();
else
done = false;
}
first_tile_ = false;
}

Expand Down

0 comments on commit 3a61f12

Please sign in to comment.