#ifndef GRAPH_BACKEND_DNNL_PASSES_LOWER_HPP
#define GRAPH_BACKEND_DNNL_PASSES_LOWER_HPP
#include <functional>
#include <memory>
#include <vector>
#include <unordered_map>
#include "graph/interface/c_types_map.hpp"
#include "graph/backend/dnnl/subgraph.hpp"
namespace dnnl {
namespace impl {
namespace graph {
namespace dnnl_impl {
using handler_func = std::function<status_t(
const std::shared_ptr<op_t> &, subgraph_rewriter_t &)>;
template <op_kind_t op_kind>
status_t common_handler(
const std::shared_ptr<op_t> &op, subgraph_rewriter_t &rewriter) {
auto new_op = std::make_shared<op_t>(op_kind);
new_op->merge_attributes(op->get_attributes());
rewriter.replace_op(op, new_op);
insert_empty_scratchpad(new_op);
return status::success;
}
status_t lower_down(std::shared_ptr<subgraph_t> &sg);
} } } }
#endif