Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add using OpVisitor::visit; to various OpVisitors to avoid overload warnings for some compilers #6337

Merged
merged 2 commits into from
Oct 26, 2021
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
2 changes: 2 additions & 0 deletions apps/hannk/interpreter/interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ namespace {

// TODO: maybe move this to a separate file? Not sure if it's complex enough to be worthy or not.
class TensorVisitor : public OpVisitor {
using OpVisitor::visit;

virtual void visit_tensor(const TensorPtr &t) = 0;

void visit(OpGroup *g) override {
Expand Down
6 changes: 6 additions & 0 deletions apps/hannk/interpreter/transforms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ namespace {
template<typename T>
T *cast_op(Op *x) {
class Caster : public OpVisitor {
using OpVisitor::visit;

public:
T *result = nullptr;

Expand Down Expand Up @@ -293,6 +295,8 @@ void replace_consumers(const TensorPtr &from, const TensorPtr &to) {

// Find ops that need padding and add an explicit pad op.
class PadForOps : public OpVisitor {
using OpVisitor::visit;

void pad_for_op(Op *op, int input_idx, int output_idx) {
TensorPtr input = op->input(input_idx);
TensorPtr output = op->output(output_idx);
Expand Down Expand Up @@ -387,6 +391,8 @@ class PadForOps : public OpVisitor {
};

class FusePadOps : public OpVisitor {
using OpVisitor::visit;

void visit(PadOp *op) override {
if (op->input()->producers().size() != 1 || op->input()->consumers().size() != 1) {
return;
Expand Down