Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions torch/csrc/jit/codegen/cuda/iter_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ std::vector<Statement*> IterVisitor::next(Expr* expr, bool respect_compute_at) {
return next_stmts;
}

// Remove any stmt in stmts that is in visited
namespace {

// Remove any stmt in stmts that is in visited
void remove_visited(
std::vector<Statement*>& stmts,
const std::unordered_set<Statement*>& visited) {
Expand All @@ -79,6 +80,7 @@ void remove_visited(
to_erase.pop_back();
}
}

} // namespace

void IterVisitor::traverseFrom(
Expand All @@ -104,7 +106,7 @@ void IterVisitor::traverseFrom(
all_inputs_visited = true;
continue;
}
auto& stmt = current_inputs.back();
const auto& stmt = current_inputs.back();
// Visit stmt when all_inputs_visited is true.
if (all_inputs_visited) {
// Mark visited
Expand Down Expand Up @@ -217,6 +219,7 @@ struct Inputs : public IterVisitor {
return inps.inputs;
}
};

} // namespace

std::unordered_set<Val*> IterVisitor::getTerminatingOutputs(
Expand Down
12 changes: 3 additions & 9 deletions torch/csrc/jit/codegen/cuda/iter_visitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ struct TORCH_CUDA_API IterVisitor : public OptOutDispatch {

// This handle functions is called on every Statement* in topological order,
// starting from outputs to inputs.
virtual void handle(Statement* s) override {
void handle(Statement* s) override {
OptOutDispatch::handle(s);
}
// This handle functions is called on every Expr* in topological order,
// starting from outputs to inputs.
virtual void handle(Expr* e) override {
void handle(Expr* e) override {
OptOutDispatch::handle(e);
}
// This handle functions is called on every Val* in topological order,
// starting from outputs to inputs.
virtual void handle(Val* v) override {
void handle(Val* v) override {
OptOutDispatch::handle(v);
}

Expand Down Expand Up @@ -96,12 +96,6 @@ struct TORCH_CUDA_API IterVisitor : public OptOutDispatch {
bool traverseAllPaths = false,
bool respectComputeAt = false);

void traverseFrom2(
Fusion* const fusion,
const std::vector<Val*>& from,
bool traverseAllPaths = false,
bool respectComputeAt = false);

// from_outputs_only = true start from outputs registered with fusion,
// from_outputs_only = false start from all leaf nodes,
// bool breadth_first = true is not implemented yet
Expand Down
4 changes: 2 additions & 2 deletions torch/csrc/jit/codegen/cuda/transform_iter.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ struct TORCH_CUDA_API ReplayTransformations : public IterVisitor {

// TODO: HANDLE RFACTOR DOMAINS
// We're going to replay this split operation on the corresponding ID
virtual void handle(Split* s) override;
void handle(Split* s) override;

// We're going to replay this merge operation on the corresponding IDs
virtual void handle(Merge* m) override;
void handle(Merge* m) override;

public:
ReplayTransformations(
Expand Down