--- /dev/null
+#include "Dumper.h"
+
+#include <string>
+
+#include "logging.h"
+
+namespace neurun
+{
+namespace codegen
+{
+
+using namespace ::internal::tflite::op;
+
+void Dumper::visit(const Conv2D::implicit::Node &node)
+{
+ VERBOSE(LIR) << "* Conv2D(Implicit)" << std::endl;
+ VERBOSE(LIR) << " - Inputs : IFM(" << node.param().ifm_index << ") Kernel("
+ << node.param().ker_index << ") Bias(" << node.param().bias_index << ")"
+ << std::endl;
+ VERBOSE(LIR) << " - Output : OFM(" << node.param().ofm_index << ")" << std::endl;
+}
+
+void Dumper::visit(const MaxPool2D::implicit::Node &node)
+{
+ VERBOSE(LIR) << "* MaxPool2D(Implicit)" << std::endl;
+ VERBOSE(LIR) << " - Inputs : IFM(" << node.param().ifm_index << ")" << std::endl;
+ VERBOSE(LIR) << " - Output : OFM(" << node.param().ofm_index << ")" << std::endl;
+}
+
+void Dumper::visit(const AvgPool2D::implicit::Node &node)
+{
+ VERBOSE(LIR) << "* AvgPool2D(Implicit)" << std::endl;
+ VERBOSE(LIR) << " - Inputs : IFM(" << node.param().ifm_index << ")" << std::endl;
+ VERBOSE(LIR) << " - Output : OFM(" << node.param().ofm_index << ")" << std::endl;
+}
+
+void Dumper::visit(const Concat::Node &node)
+{
+ VERBOSE(LIR) << "* Concat" << std::endl;
+ std::string inputs;
+ for (auto i : node.param().ifm_indexes)
+ {
+ inputs += std::to_string(i) + ",";
+ }
+ VERBOSE(LIR) << " - Inputs : IFM(" << inputs << ")" << std::endl;
+ VERBOSE(LIR) << " - Output : OFM(" << node.param().ofm_index << ")" << std::endl;
+}
+
+void Dumper::visit(const FullyConnected::Node &node)
+{
+ VERBOSE(LIR) << "* FullyConnected" << std::endl;
+ VERBOSE(LIR) << " - Inputs : IFM(" << node.param().input_index << ") Weight("
+ << node.param().weight_index << ") Bias(" << node.param().bias_index << ")"
+ << std::endl;
+ VERBOSE(LIR) << " - Output : OFM(" << node.param().output_index << ")" << std::endl;
+}
+
+void Dumper::visit(const Reshape::Node &node)
+{
+ VERBOSE(LIR) << "* Reshape" << std::endl;
+ VERBOSE(LIR) << " - Inputs : IFM(" << node.param().input_index << ") Shape("
+ << node.param().shape_index << ")" << std::endl;
+ VERBOSE(LIR) << " - Output : OFM(" << node.param().output_index << ")" << std::endl;
+}
+
+void Dumper::visit(const Softmax::Node &node)
+{
+ VERBOSE(LIR) << "* Softmax" << std::endl;
+ VERBOSE(LIR) << " - Inputs : IFM(" << node.param().input_index << ")" << std::endl;
+ VERBOSE(LIR) << " - Output : OFM(" << node.param().output_index << ")" << std::endl;
+}
+
+void Dumper::visit(const TensorConvert::CpuFromCommon::Node &node)
+{
+ VERBOSE(LIR) << "CpuFromCommon" << std::endl;
+ // NOTE No details for this node. Soon will be removed.
+}
+
+void Dumper::visit(const TensorConvert::CpuToCommon::Node &node)
+{
+ VERBOSE(LIR) << "CpuToCommon" << std::endl;
+ // NOTE No details for this node. Soon will be removed.
+}
+
+void Dumper::visit(const TensorConvert::AclFromCommon::Node &node)
+{
+ VERBOSE(LIR) << "AclFromCommon" << std::endl;
+ // NOTE No details for this node. Soon will be removed.
+}
+
+void Dumper::visit(const TensorConvert::AclToCommon::Node &node)
+{
+ VERBOSE(LIR) << "AclToCommon" << std::endl;
+ // NOTE No details for this node. Soon will be removed.
+}
+
+} // namespace codegen
+} // namespace neurun
--- /dev/null
+#ifndef __NEURUN_CODEGEN_DUMPER_H__
+#define __NEURUN_CODEGEN_DUMPER_H__
+
+#include "internal/op/NodeVisitor.h"
+
+namespace neurun
+{
+namespace codegen
+{
+
+class Dumper : public ::internal::tflite::op::NodeVisitor
+{
+public:
+ Dumper() = default;
+
+public:
+ void visit(const ::internal::tflite::op::Conv2D::implicit::Node &node) override;
+ void visit(const ::internal::tflite::op::MaxPool2D::implicit::Node &node) override;
+ void visit(const ::internal::tflite::op::AvgPool2D::implicit::Node &node) override;
+ void visit(const ::internal::tflite::op::Concat::Node &node) override;
+ void visit(const ::internal::tflite::op::FullyConnected::Node &node) override;
+ void visit(const ::internal::tflite::op::Reshape::Node &node) override;
+ void visit(const ::internal::tflite::op::Softmax::Node &node) override;
+ void visit(const ::internal::tflite::op::TensorConvert::CpuFromCommon::Node &node) override;
+ void visit(const ::internal::tflite::op::TensorConvert::CpuToCommon::Node &node) override;
+ void visit(const ::internal::tflite::op::TensorConvert::AclFromCommon::Node &node) override;
+ void visit(const ::internal::tflite::op::TensorConvert::AclToCommon::Node &node) override;
+};
+
+} // namespace codegen
+} // namespace neurun
+
+#endif // __NEURUN_CODEGEN_DUMPER_H__
#include "model.h"
#include "logging.h"
+#include "codegen/Dumper.h"
#include "codegen/IPlanBuilder.h"
#include "codegen/BackendResolver.h"
#include "codegen/Planner.h"
std::reverse(std::begin(operations), std::end(operations));
}
+ // Dump ops
+ for (const auto op : operations)
+ {
+ op->accept(neurun::codegen::Dumper{});
+ }
+
::internal::BackendManager backend_manager{plan};
neurun::codegen::BackendResolver backend_resolver{backend_manager};
neurun::codegen::PlanBuilder plan_builder{plan};