ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 25 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 27 of file ElementwiseBinary.cc.

30{
31}
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 25 of file ElementwiseBinary.cc.

25{ v.visit(*this); }

◆ name()

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

Reimplemented from onert::ir::IOperation.

Definition at line 33 of file ElementwiseBinary.cc.

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

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

56{ return OpCode::ElementwiseBinary; }

◆ param()

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

Definition at line 59 of file ElementwiseBinary.h.

59{ 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: