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

#include <BinaryArithmetic.h>

Collaboration diagram for onert::ir::operation::BinaryArithmetic:

Data Structures

struct  Param
 

Public Types

enum  Input { LHS = 0 , RHS }
 
enum class  ArithmeticType { ADD , SUB , MUL , DIV }
 

Public Member Functions

 BinaryArithmetic (const OperandIndexSequence &inputs, const OperandIndexSequence &outputs, const Param &param)
 
void accept (OperationVisitor &v) const override
 
std::string name () const override
 
OpCode opcode () const final
 
const Paramparam () const
 
- Public Member Functions inherited from onert::ir::Operation
 Operation (OperandConstraint input_constr, const OperandIndexSequence &inputs, const OperandIndexSequence &outputs, OperandConstraint output_constr=OperandConstraint::createAny())
 
 Operation (OperandConstraint input_constr, OperandConstraint output_constr=OperandConstraint::createAny())
 
 Operation (const Operation &)=default
 
 Operation (Operation &&)=default
 
Operationoperator= (const Operation &)=default
 
Operationoperator= (Operation &&)=default
 
virtual ~Operation ()
 
void replaceInputs (const OperandIndex &from, const OperandIndex &to) override
 
void replaceOutputs (const OperandIndex &from, const OperandIndex &to) override
 
OperandIndexSequencegetInputs ()
 
const OperandIndexSequencegetInputs () const override
 
const OperandIndexSequencegetOutputs () const override
 
void setInputs (const OperandIndexSequence &indexes)
 
void setOutputs (const OperandIndexSequence &indexes)
 
- Public Member Functions inherited from onert::ir::IOperation
virtual ~IOperation ()=default
 

Detailed Description

Definition at line 30 of file BinaryArithmetic.h.

Member Enumeration Documentation

◆ ArithmeticType

◆ Input

Constructor & Destructor Documentation

◆ BinaryArithmetic()

onert::ir::operation::BinaryArithmetic::BinaryArithmetic ( const OperandIndexSequence inputs,
const OperandIndexSequence outputs,
const Param param 
)

Definition at line 31 of file BinaryArithmetic.cc.

34{
35}
static OperandConstraint createExact(uint32_t exact)

Member Function Documentation

◆ accept()

void onert::ir::operation::BinaryArithmetic::accept ( OperationVisitor v) const
overridevirtual

Implements onert::ir::IOperation.

Reimplemented in onert::ir::train::operation::BinaryArithmetic.

Definition at line 29 of file BinaryArithmetic.cc.

29{ v.visit(*this); }

◆ name()

std::string onert::ir::operation::BinaryArithmetic::name ( ) const
overridevirtual

Reimplemented from onert::ir::IOperation.

Definition at line 37 of file BinaryArithmetic.cc.

38{
40 static const std::unordered_map<ArithmeticType, std::string> name_map{
41 {ArithmeticType::ADD, std::string{"Add"}},
42 {ArithmeticType::SUB, std::string{"Sub"}},
43 {ArithmeticType::MUL, std::string{"Mul"}},
44 {ArithmeticType::DIV, std::string{"Div"}}};
45 return name_map.at(_param.arithmetic_type);
46}

References ADD, onert::ir::operation::BinaryArithmetic::Param::arithmetic_type, DIV, MUL, and SUB.

◆ opcode()

OpCode onert::ir::operation::BinaryArithmetic::opcode ( ) const
inlinefinalvirtual

Implements onert::ir::IOperation.

Definition at line 60 of file BinaryArithmetic.h.

60{ return OpCode::BinaryArithmetic; }

◆ param()

const Param & onert::ir::operation::BinaryArithmetic::param ( ) const
inline

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