Skip to content

Commit

Permalink
remove required method
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiics committed Mar 9, 2019
1 parent ee359fb commit a0863b4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 52 deletions.
5 changes: 0 additions & 5 deletions include/tvm/relay/pass.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,6 @@ class PassNode : public RelayNode {
*/
virtual void SetContext(const PassContext& pass_ctx) = 0;

/*!
* \brief Get the required passes for this pass as a vector of std::string.
*/
virtual std::vector<std::string> Required() const = 0;

/*!
* \brief Execute the optimization pass using a functor.
*
Expand Down
47 changes: 0 additions & 47 deletions src/relay/pass/pass_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ class ModulePassNode : public PassNode {
*/
Module operator()(const Module& mod) const final;

/*! \brief Collect the required passes for this module pass. */
std::vector<std::string> Required() const final;

/*!
* \brief Get the pass information/meta data.
*/
Expand Down Expand Up @@ -116,9 +113,6 @@ class FunctionPassNode : public PassNode {
*/
Module operator()(const Module& mod) const final;

/*! \brief Collect the required passes for this module pass. */
std::vector<std::string> Required() const final;

/*!
* \brief Get the pass information/meta data.
*/
Expand Down Expand Up @@ -217,8 +211,6 @@ class SequentialPassNode : public PassNode {
*/
void ResolveDependency(const Module& mod);

std::vector<std::string> Required() const final;

TVM_DLL std::vector<std::string> DisabledPasses() const;

/*!
Expand Down Expand Up @@ -289,19 +281,6 @@ Module ModulePassNode::operator()(const Module& mod) const {
return updated_mod;
}

std::vector<std::string> ModulePassNode::Required() const {
std::vector<std::string> required;
PassInfo pass_info = GetPassInfo();
CHECK(pass_info.defined())
<< "Cannot get the required passes from undefined PassInfo object."
<< "\n";
for (const auto& it : pass_info.operator->()->required) {
const auto* str = it.as<tvm::ir::StringImm>();
required.push_back(str->value);
}
return required;
}

void ModulePassNode::SetContext(const PassContext& pass_ctx) {
pass_ctx_ = pass_ctx;
}
Expand Down Expand Up @@ -352,19 +331,6 @@ bool FunctionPassNode::SkipFunction(const Function& func) const {
return pval && pval->value != 0;
}

std::vector<std::string> FunctionPassNode::Required() const {
std::vector<std::string> required;
PassInfo pass_info = GetPassInfo();
CHECK(pass_info.defined())
<< "Cannot get the required passes from undefined PassInfo object."
<< "\n";
for (const auto& it : pass_info.operator->()->required) {
const auto* str = it.as<tvm::ir::StringImm>();
required.push_back(str->value);
}
return required;
}

SequentialPass SequentialPassNode::make(PassInfo pass_info,
tvm::Array<Pass> passes,
tvm::Array<tvm::Expr> disabled) {
Expand All @@ -388,19 +354,6 @@ Module SequentialPassNode::operator()(const Module& module) const {
return mod;
}

std::vector<std::string> SequentialPassNode::Required() const {
std::vector<std::string> required;
PassInfo pass_info = GetPassInfo();
CHECK(pass_info.defined())
<< "Cannot get the required passes from undefined PassInfo object."
<< "\n";
for (const auto& it : pass_info.operator->()->required) {
const auto* str = it.as<tvm::ir::StringImm>();
required.push_back(str->value);
}
return required;
}

void SequentialPassNode::ResolveDependency(const Module& mod) {
// TODO(zhiics) Implement it.
// 1. Consider the required passes for each pass.
Expand Down

0 comments on commit a0863b4

Please sign in to comment.