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
14 changes: 13 additions & 1 deletion compiler/luci/pass/include/luci/ModulePass.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,28 @@

#include <luci/IR/Module.h>

#include <stdexcept>

namespace luci
{

class Pass : public logo::Pass
class ModulePass
{
public:
// Run module pass and return false if there was nothing changed
virtual bool run(luci::Module *) = 0;
};

class Pass : public logo::Pass, public ModulePass
{
public:
// NOTE adding dummy run() to make compiler happy with "-Werror=overloaded-virtual="
// clang-format off
bool run(loco::Graph *) override { throw std::runtime_error("Must inherit"); }
bool run(luci::Module *) override { throw std::runtime_error("Must inherit"); }
// clang-format on
};

} // namespace luci

#endif // __LUCI_PASS_MODULE_PASS_H__
11 changes: 8 additions & 3 deletions compiler/luci/pass/src/VerifyQuantizedNodeType.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include <luci/IR/CircleNodes.h>
#include <luci/IR/CircleNodeVisitor.h>

#include <stdexcept>

namespace luci
{

Expand Down Expand Up @@ -129,9 +131,12 @@ class VerifyQuantizedNodeTypeBase : public luci::CircleNodeVisitor<bool>,

// NOTE below nodes has differnent implementation for Qtype/Btype and
// implementations exist in VerifyQuantizedNodeU8Type, VerifyQuantizedNodeS16Type
// bool visit(const luci::CircleLogistic *node);
// bool visit(const luci::CircleSoftmax *node);
// bool visit(const luci::CircleTanh *node);
// NOTE adding dummy visit() to make compiler happy with "-Werror=overloaded-virtual="
// clang-format off
bool visit(const luci::CircleLogistic *) { throw std::runtime_error("Must inherit"); }
bool visit(const luci::CircleSoftmax *) { throw std::runtime_error("Must inherit"); }
bool visit(const luci::CircleTanh *) { throw std::runtime_error("Must inherit"); }
// clang-format on

// TODO: Implement more Ops

Expand Down