ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::compiler::TensorRegistries Class Reference

#include <TensorRegistries.h>

Public Member Functions

 TensorRegistries ()=default
 
 TensorRegistries (const onert::backend::BackendContexts &backend_contexts, bool include_builtin)
 
std::unordered_set< std::shared_ptr< onert::backend::ITensorRegistry > >::const_iterator begin () const
 
std::unordered_set< std::shared_ptr< onert::backend::ITensorRegistry > >::const_iterator end () const
 
std::shared_ptr< backend::builtin::TensorRegistrygetBuiltinTensorRegistry () const
 
backend::ITensorgetITensor (ir::OperandIndex ind) const
 

Detailed Description

Definition at line 34 of file TensorRegistries.h.

Constructor & Destructor Documentation

◆ TensorRegistries() [1/2]

onert::compiler::TensorRegistries::TensorRegistries ( )
default

◆ TensorRegistries() [2/2]

onert::compiler::TensorRegistries::TensorRegistries ( const onert::backend::BackendContexts backend_contexts,
bool  include_builtin 
)
inline

Definition at line 39 of file TensorRegistries.h.

40 {
41 for (const auto &[backend, ctx] : backend_contexts)
42 {
43 auto tensor_reg = ctx->tensor_registry;
44 if (backend->config()->id() == backend::builtin::Config::ID)
45 {
46 _builtin_tensor_reg =
47 std::dynamic_pointer_cast<backend::builtin::TensorRegistry>(tensor_reg);
48 if (include_builtin)
49 _tensor_regs.insert(tensor_reg);
50 }
51 else
52 {
53 _tensor_regs.insert(tensor_reg);
54 }
55 }
56 }
static std::string ID
Definition Config.h:34

References onert::backend::builtin::Config::ID.

Member Function Documentation

◆ begin()

std::unordered_set< std::shared_ptr< onert::backend::ITensorRegistry > >::const_iterator onert::compiler::TensorRegistries::begin ( ) const
inline

Definition at line 58 of file TensorRegistries.h.

59 {
60 return _tensor_regs.cbegin();
61 }

◆ end()

std::unordered_set< std::shared_ptr< onert::backend::ITensorRegistry > >::const_iterator onert::compiler::TensorRegistries::end ( ) const
inline

Definition at line 62 of file TensorRegistries.h.

63 {
64 return _tensor_regs.cend();
65 }

◆ getBuiltinTensorRegistry()

std::shared_ptr< backend::builtin::TensorRegistry > onert::compiler::TensorRegistries::getBuiltinTensorRegistry ( ) const
inline

Definition at line 67 of file TensorRegistries.h.

68 {
69 return _builtin_tensor_reg;
70 }

◆ getITensor()

backend::ITensor * onert::compiler::TensorRegistries::getITensor ( ir::OperandIndex  ind) const
inline

Definition at line 72 of file TensorRegistries.h.

73 {
74 for (const auto &tensor_reg : _tensor_regs)
75 {
76 auto tensor = tensor_reg->getITensor(ind);
77 if (tensor)
78 return tensor;
79 }
80 return nullptr;
81 }

Referenced by onert::exec::ExecutorBase::ExecutorBase().


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