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

#include <ElementwiseBinary.h>

Collaboration diagram for onert::ir::operation::ElementwiseBinary:

Data Structures

struct  Param
 

Public Types

enum  Input { LHS = 0 , RHS }
 
enum class  ElementwiseBinaryType {
  FLOOR_DIV , FLOOR_MOD , LOGICAL_AND , LOGICAL_OR ,
  MAX , MIN
}
 

Public Member Functions

 ElementwiseBinary (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 29 of file ElementwiseBinary.h.

Member Enumeration Documentation

◆ ElementwiseBinaryType

◆ Input

Constructor & Destructor Documentation

◆ ElementwiseBinary()

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

Definition at line 31 of file ElementwiseBinary.cc.

34{
35}
static OperandConstraint createExact(uint32_t exact)

Member Function Documentation

◆ accept()

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

Implements onert::ir::IOperation.

Definition at line 29 of file ElementwiseBinary.cc.

29{ v.visit(*this); }

◆ name()

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

Reimplemented from onert::ir::IOperation.

Definition at line 37 of file ElementwiseBinary.cc.

38{
40 static const std::unordered_map<ElementwiseBinaryType, std::string> name_map{
41 {ElementwiseBinaryType::FLOOR_DIV, std::string{"FloorDiv"}},
42 {ElementwiseBinaryType::FLOOR_MOD, std::string{"FloorMod"}},
43 {ElementwiseBinaryType::LOGICAL_AND, std::string{"LogicalAnd"}},
44 {ElementwiseBinaryType::LOGICAL_OR, std::string{"LogicalOr"}},
45 {ElementwiseBinaryType::MAX, std::string{"Max"}},
46 {ElementwiseBinaryType::MIN, std::string{"Min"}}};
47 return name_map.at(_param.op_type);
48}

References FLOOR_DIV, FLOOR_MOD, LOGICAL_AND, LOGICAL_OR, MAX, MIN, and onert::ir::operation::ElementwiseBinary::Param::op_type.

◆ opcode()

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

Implements onert::ir::IOperation.

Definition at line 60 of file ElementwiseBinary.h.

60{ return OpCode::ElementwiseBinary; }

◆ param()

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

Definition at line 63 of file ElementwiseBinary.h.

63{ return _param; }

Referenced by onert::backend::cpu::KernelGenerator::visit(), and onert::ir::OperationValidator::visit().


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