diff --git a/torch/csrc/jit/codegen/cuda/iter_visitor.cpp b/torch/csrc/jit/codegen/cuda/iter_visitor.cpp index 6d0dfcc9e908..6a0e6efcaa3d 100644 --- a/torch/csrc/jit/codegen/cuda/iter_visitor.cpp +++ b/torch/csrc/jit/codegen/cuda/iter_visitor.cpp @@ -63,8 +63,9 @@ std::vector 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& stmts, const std::unordered_set& visited) { @@ -79,6 +80,7 @@ void remove_visited( to_erase.pop_back(); } } + } // namespace void IterVisitor::traverseFrom( @@ -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 @@ -217,6 +219,7 @@ struct Inputs : public IterVisitor { return inps.inputs; } }; + } // namespace std::unordered_set IterVisitor::getTerminatingOutputs( diff --git a/torch/csrc/jit/codegen/cuda/iter_visitor.h b/torch/csrc/jit/codegen/cuda/iter_visitor.h index 832f2a41507c..2ed699fa6814 100644 --- a/torch/csrc/jit/codegen/cuda/iter_visitor.h +++ b/torch/csrc/jit/codegen/cuda/iter_visitor.h @@ -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); } @@ -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& 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 diff --git a/torch/csrc/jit/codegen/cuda/transform_iter.h b/torch/csrc/jit/codegen/cuda/transform_iter.h index 925179babfa3..9b33f96ef764 100644 --- a/torch/csrc/jit/codegen/cuda/transform_iter.h +++ b/torch/csrc/jit/codegen/cuda/transform_iter.h @@ -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(