ONE - On-device Neural Engine
Loading...
Searching...
No Matches
luci_interpreter::KernelBuilder Class Reference

#include <KernelBuilder.h>

Collaboration diagram for luci_interpreter::KernelBuilder:

Public Member Functions

 KernelBuilder (const std::unordered_map< const loco::Graph *, RuntimeGraph * > &graph_to_runtime_graph, const std::unordered_map< const loco::Node *, Tensor * > &node_to_tensor)
 
 ~KernelBuilder ()
 
std::unique_ptr< Kernelbuild (const luci::CircleNode *node)
 
- Public Member Functions inherited from luci_interpreter::KernelBuilderHelper
 KernelBuilderHelper (const std::unordered_map< const loco::Graph *, RuntimeGraph * > &graph_to_runtime_graph, const std::unordered_map< const loco::Node *, Tensor * > &node_to_tensor)
 
const TensorgetInputTensor (const loco::Node *node) const
 
const TensorgetOptionalInputTensor (const loco::Node *node) const
 
TensorgetOutputTensor (const loco::Node *node) const
 
std::vector< Tensor * > getOutputTensors (const std::vector< const loco::Node * > &nodes) const
 
RuntimeGraphgetRuntimeGraph (const loco::Graph *graph) const
 
const std::unordered_map< const loco::Graph *, RuntimeGraph * > & graph_to_runtime_graph () const
 
const std::unordered_map< const loco::Node *, Tensor * > & node_to_tensor () const
 

Detailed Description

Definition at line 35 of file KernelBuilder.h.

Constructor & Destructor Documentation

◆ KernelBuilder()

luci_interpreter::KernelBuilder::KernelBuilder ( const std::unordered_map< const loco::Graph *, RuntimeGraph * > &  graph_to_runtime_graph,
const std::unordered_map< const loco::Node *, Tensor * > &  node_to_tensor 
)

Definition at line 107 of file KernelBuilder.cpp.

111{
112 _builder_registry = std::make_unique<KernelBuilderRegistry>();
113}
const std::unordered_map< const loco::Graph *, RuntimeGraph * > & graph_to_runtime_graph() const
const std::unordered_map< const loco::Node *, Tensor * > & node_to_tensor() const
KernelBuilderHelper(const std::unordered_map< const loco::Graph *, RuntimeGraph * > &graph_to_runtime_graph, const std::unordered_map< const loco::Node *, Tensor * > &node_to_tensor)

◆ ~KernelBuilder()

luci_interpreter::KernelBuilder::~KernelBuilder ( )

Definition at line 115 of file KernelBuilder.cpp.

116{
117 // Need to define in this CPP to hide KernelBuilderRegistry internals.
118 // This destructor deletes _builder_registry
119}

Member Function Documentation

◆ build()

std::unique_ptr< Kernel > luci_interpreter::KernelBuilder::build ( const luci::CircleNode node)

Definition at line 121 of file KernelBuilder.cpp.

122{
123 auto specific_builder = _builder_registry->get_kernel_builder_func(node->opcode());
124 if (specific_builder != nullptr)
125 return specific_builder(node, *this);
126
127 std::string msg = "Unsupported operator: ";
128 msg += toString(node->opcode()) + " in " + std::string(node->name());
129 throw std::invalid_argument(msg.c_str());
130}
const std::string toString(luci::CircleOpcode opcode)
NodeName name(void) const
virtual CircleOpcode opcode(void) const =0

References luci::CircleNode::name(), and luci::CircleNode::opcode().

Referenced by luci_interpreter::GraphLoader::loadOperators().


The documentation for this class was generated from the following files: