13#ifndef MLIR_DIALECT_TOSA_IR_TOSAOPS_H
14#define MLIR_DIALECT_TOSA_IR_TOSAOPS_H
32#include "mlir/Dialect/Tosa/IR/TosaEnums.h.inc"
33#include "mlir/Dialect/Tosa/IR/TosaOpsDialect.h.inc"
40#include "mlir/Dialect/Tosa/IR/TosaAvailability.h.inc"
48 DenseElementsAttr &varShapeAttr,
50 Attribute &initialValueAttr);
52 DenseElementsAttr varShapeAttr,
54 Attribute initialValueAttr);
56#include "mlir/Dialect/Tosa/IR/TosaInterfaces.h.inc"
65template <
typename ConcreteType>
67 :
public TraitBase<ConcreteType, TosaElementwiseOperator> {};
71template <
typename ConcreteType>
73 :
public TraitBase<ConcreteType, TosaResolvableShapeOperands> {
81template <
typename ConcreteType>
86template <
typename ConcreteType>
88 :
public TraitBase<ConcreteType, TosaShapeOperatorWithSameRanks> {
112#define GET_ATTRDEF_CLASSES
113#include "mlir/Dialect/Tosa/IR/TosaAttributes.h.inc"
115#define GET_TYPEDEF_CLASSES
116#include "mlir/Dialect/Tosa/IR/TosaOpsTypesBase.h.inc"
118#define GET_OP_CLASSES
119#include "mlir/Dialect/Tosa/IR/TosaOps.h.inc"
126 Type srcElemType,
int64_t zp = 0);
Helper class for implementing traits.
This class indicates that an op is tosa-elementwise (permits broadcasting, unlike Elementwise trait).
This class verifies that tosa shape operands are compile time resolvable.
static LogicalResult verifyTrait(Operation *op)
This class indicates that op operates on tosa shape types.
static LogicalResult verifyTrait(Operation *op)
This class indicates that op operates on tosa shape types.
Operation is the basic unit of execution within MLIR.
A special type of RewriterBase that coordinates the application of a rewrite pattern on the current I...
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
LogicalResult verifyTosaShapeOperatorWithSameRanks(Operation *op)
LogicalResult verifyTosaResolvableShapeOperands(Operation *op)
RankedTensorType getVariableType(VariableOp variableOp)
ParseResult parseVariableOpTypeOrInitialValue(OpAsmParser &parser, DenseElementsAttr &varShapeAttr, TypeAttr &typeAttr, Attribute &initialValueAttr)
constexpr int64_t kInferableDimSize
Represents a dimension in the shape of a tensor that can be inferred based on the other provided dime...
void printVariableOpTypeOrInitialValue(OpAsmPrinter &p, Operation *op, DenseElementsAttr varShapeAttr, TypeAttr typeAttr, Attribute initialValueAttr)
unsigned getBitWidth(Type type)
std::optional< Value > createZeroPointTensor(OpBuilder &builder, Location loc, Type srcElemType, int64_t zp=0)
bool isa_tosa_shape_type(mlir::Type t)
Value createPadConstTensor(OpBuilder &builder, Location loc, Value src, int32_t val=0)
Include the generated interface declarations.