ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::backend::trix::KernelGenerator Class Reference

#include <KernelGenerator.h>

Collaboration diagram for onert::backend::trix::KernelGenerator:

Public Member Functions

 KernelGenerator (const ir::Graph &graph, const std::shared_ptr< TensorBuilder > &tensor_builder, const std::shared_ptr< basic::TensorRegistry > &tensor_reg, const std::shared_ptr< DevContext > &dev_context)
 
std::unique_ptr< exec::FunctionSequencegenerate (ir::OperationIndex op_ind) override
 
- Public Member Functions inherited from onert::backend::basic::KernelGeneratorBase
virtual ~KernelGeneratorBase ()=default
 
 KernelGeneratorBase (const ir::Graph &graph)
 
- Public Member Functions inherited from onert::ir::OperationVisitor
virtual ~OperationVisitor ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from onert::backend::basic::KernelGeneratorBase
std::unique_ptr< exec::IFunctionreleaseFunction ()
 
- Protected Attributes inherited from onert::backend::basic::KernelGeneratorBase
const ir::Graph_graph
 
std::unique_ptr< exec::IFunction_return_fn
 

Detailed Description

Definition at line 36 of file KernelGenerator.h.

Constructor & Destructor Documentation

◆ KernelGenerator()

onert::backend::trix::KernelGenerator::KernelGenerator ( const ir::Graph graph,
const std::shared_ptr< TensorBuilder > &  tensor_builder,
const std::shared_ptr< basic::TensorRegistry > &  tensor_reg,
const std::shared_ptr< DevContext > &  dev_context 
)

Definition at line 37 of file KernelGenerator.cc.

41 : basic::KernelGeneratorBase{graph}, _ctx(graph.operands()), _operations_ctx{graph.operations()},
42 _tensor_builder(tensor_builder), _tensor_reg{tensor_reg}, _dev_context{dev_context}
43{
44 // DO NOTHING
45}

Member Function Documentation

◆ generate()

std::unique_ptr< exec::FunctionSequence > onert::backend::trix::KernelGenerator::generate ( ir::OperationIndex  op_ind)
overridevirtual

Implements onert::backend::basic::KernelGeneratorBase.

Definition at line 47 of file KernelGenerator.cc.

48{
49 auto ret = std::make_unique<exec::FunctionSequence>();
50 ret->enableDynamicShapeInferer(false);
51
52 const auto &op = _graph.operations().at(ind);
53 op.accept(*this);
54 ret->append(releaseFunction());
55 return ret;
56}
std::unique_ptr< exec::IFunction > releaseFunction()
const Operations & operations() const override
Definition Graph.h:114
const Object & at(const Index &index) const
Get the object that is associated with the given index.

References onert::backend::basic::KernelGeneratorBase::_graph, onert::util::ObjectManager< Index, Object >::at(), onert::ir::Graph::operations(), and onert::backend::basic::KernelGeneratorBase::releaseFunction().


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