ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::ir::OperandIndexSequence Class Reference

#include <OperandIndexSequence.h>

Public Member Functions

 OperandIndexSequence (void)=default
 
 OperandIndexSequence (std::initializer_list< OperandIndex > list)
 
 OperandIndexSequence (std::initializer_list< int32_t > list)
 
 OperandIndexSequence (std::initializer_list< uint32_t > list)
 
void append (const OperandIndex &index)
 
void append (const OperandIndexSequence &l)
 
uint32_t size () const
 
const OperandIndexat (IOIndex set_index) const
 
const OperandIndexat (uint32_t index) const
 
bool contains (const OperandIndex &index) const
 
void replace (const OperandIndex &from, const OperandIndex &to)
 
OperandIndexSequence operator| (ir::Remove filter) const
 
bool operator== (const OperandIndexSequence &other) const
 
OperandIndexSequence operator+ (const OperandIndexSequence &other) const
 
std::vector< OperandIndex >::const_iterator begin (void) const
 
std::vector< OperandIndex >::const_iterator end (void) const
 
std::vector< OperandIndex >::iterator begin (void)
 
std::vector< OperandIndex >::iterator end (void)
 

Friends

std::ostream & operator<< (std::ostream &o, const OperandIndexSequence &operand_seq)
 

Detailed Description

Definition at line 36 of file OperandIndexSequence.h.

Constructor & Destructor Documentation

◆ OperandIndexSequence() [1/4]

onert::ir::OperandIndexSequence::OperandIndexSequence ( void  )
default

◆ OperandIndexSequence() [2/4]

onert::ir::OperandIndexSequence::OperandIndexSequence ( std::initializer_list< OperandIndex list)

Definition at line 27 of file OperandIndexSequence.cc.

27 : _vec(list)
28{
29 // DO NOTHING
30}

◆ OperandIndexSequence() [3/4]

onert::ir::OperandIndexSequence::OperandIndexSequence ( std::initializer_list< int32_t >  list)

Definition at line 32 of file OperandIndexSequence.cc.

33{
34 for (auto &&val : list)
35 {
36 _vec.emplace_back(static_cast<uint32_t>(val));
37 }
38}

◆ OperandIndexSequence() [4/4]

onert::ir::OperandIndexSequence::OperandIndexSequence ( std::initializer_list< uint32_t >  list)

Definition at line 40 of file OperandIndexSequence.cc.

41{
42 for (auto &&val : list)
43 {
44 _vec.emplace_back(val);
45 }
46}

Member Function Documentation

◆ append() [1/2]

◆ append() [2/2]

void onert::ir::OperandIndexSequence::append ( const OperandIndexSequence l)
inline

Definition at line 46 of file OperandIndexSequence.h.

46{ _vec.insert(_vec.end(), l.begin(), l.end()); }

◆ at() [1/2]

const OperandIndex & onert::ir::OperandIndexSequence::at ( IOIndex  set_index) const
inline

Definition at line 50 of file OperandIndexSequence.h.

50{ return _vec.at(set_index.value()); }

References onert::util::Index< T, DummyTag >::value().

Referenced by onert::backend::acl_common::AclConstantInitializer::copyInputInitialize(), onert::backend::cpu::findSharedMemoryOperandIndexes(), onert::backend::acl_common::kernelGenFullyConnected(), onert::backend::acl_common::kernelGenLSTM(), onert::compiler::train::pass::LossInsertionPass::run(), onert::backend::cpu::KernelGenerator::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::acl_common::AclConstantInitializer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::backend::acl_common::AclSubTensorAnalyzer::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::compiler::ShapeValidator::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::compiler::ShapeValidator::visit(), onert::compiler::ShapeValidator::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::compiler::ShapeValidator::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::acl_cl::ConstantInitializer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::compiler::ShapeValidator::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::acl_cl::ConstantInitializer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::backend::acl_neon::ConstantInitializer::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::compiler::ShapeValidator::visit(), onert::backend::cpu::KernelGenerator::visit(), onert::compiler::ShapeValidator::visit(), onert::exec::DynamicShapeInferer::visit(), onert::backend::train::KernelGenerator::visit(), onert::backend::train::KernelGenerator::visit(), onert::backend::train::KernelGenerator::visit(), onert::backend::train::KernelGenerator::visit(), onert::backend::train::KernelGenerator::visit(), onert::backend::train::KernelGenerator::visit(), onert::backend::train::KernelGenerator::visit(), onert::backend::train::KernelGenerator::visit(), onert::backend::train::KernelGenerator::visit(), onert::backend::train::KernelGenerator::visit(), onert::backend::train::KernelGenerator::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationValidator::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationDumper::visit(), onert::ir::OperationDumper::visit(), onert::ir::train::UseDefGenerator::visit(), onert::ir::train::UseDefGenerator::visit(), onert::ir::train::UseDefGenerator::visit(), onert::ir::train::UseDefGenerator::visit(), onert::ir::train::UseDefGenerator::visit(), onert::ir::train::UseDefGenerator::visit(), onert::ir::train::UseDefGenerator::visit(), onert::ir::train::UseDefGenerator::visit(), onert::ir::train::UseDefGenerator::visit(), onert::ir::train::UseDefGenerator::visit(), and onert::ir::train::UseDefGenerator::visit().

◆ at() [2/2]

const OperandIndex & onert::ir::OperandIndexSequence::at ( uint32_t  index) const
inline

Definition at line 51 of file OperandIndexSequence.h.

51{ return _vec.at(index); }

◆ begin() [1/2]

std::vector< OperandIndex >::iterator onert::ir::OperandIndexSequence::begin ( void  )
inline

Definition at line 86 of file OperandIndexSequence.h.

86{ return _vec.begin(); }

◆ begin() [2/2]

std::vector< OperandIndex >::const_iterator onert::ir::OperandIndexSequence::begin ( void  ) const
inline

Definition at line 84 of file OperandIndexSequence.h.

84{ return _vec.begin(); }

◆ contains()

bool onert::ir::OperandIndexSequence::contains ( const OperandIndex index) const

◆ end() [1/2]

std::vector< OperandIndex >::iterator onert::ir::OperandIndexSequence::end ( void  )
inline

Definition at line 87 of file OperandIndexSequence.h.

87{ return _vec.end(); }

◆ end() [2/2]

std::vector< OperandIndex >::const_iterator onert::ir::OperandIndexSequence::end ( void  ) const
inline

Definition at line 85 of file OperandIndexSequence.h.

85{ return _vec.end(); }

◆ operator+()

OperandIndexSequence onert::ir::OperandIndexSequence::operator+ ( const OperandIndexSequence other) const

Definition at line 63 of file OperandIndexSequence.cc.

64{
65 OperandIndexSequence ret = *this;
66 ret.append(other);
67 return ret;
68}

References append().

◆ operator==()

bool onert::ir::OperandIndexSequence::operator== ( const OperandIndexSequence other) const

Definition at line 58 of file OperandIndexSequence.cc.

59{
60 return _vec == other._vec;
61}

◆ operator|()

OperandIndexSequence onert::ir::OperandIndexSequence::operator| ( ir::Remove  filter) const
inline

Definition at line 54 of file OperandIndexSequence.h.

55 {
56 switch (filter)
57 {
59 {
60 ir::OperandIndexSequence seq;
61 for (const auto &ind : _vec)
62 if (!seq.contains(ind))
63 seq.append(ind);
64 return seq;
65 }
67 {
68 ir::OperandIndexSequence seq;
69 for (const auto &ind : _vec)
70 if (!ind.undefined())
71 seq.append(ind);
72 return seq;
73 }
74 }
75 return *this;
76 }
bool contains(const OperandIndex &index) const
void append(const OperandIndex &index)

References append(), contains(), onert::ir::DUPLICATED, and onert::ir::UNDEFINED.

◆ replace()

void onert::ir::OperandIndexSequence::replace ( const OperandIndex from,
const OperandIndex to 
)

Definition at line 53 of file OperandIndexSequence.cc.

54{
55 std::replace(_vec.begin(), _vec.end(), from, to);
56}

Referenced by onert::ir::Operation::replaceInputs(), onert::ir::Operation::replaceOutputs(), and onert::compiler::pass::OddOutputPass::run().

◆ size()

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  o,
const OperandIndexSequence operand_seq 
)
friend

Definition at line 70 of file OperandIndexSequence.cc.

71{
72 std::string delimeter;
73 for (const auto &ind : operand_seq._vec)
74 {
75 o << delimeter << ind;
76 delimeter = ',';
77 }
78 return o;
79}

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