Class InputType

Inheritance Relationships

Base Type

  • public mlir::Type::TypeBase< InputType, ::mlir::Type, detail::InputTypeStorage, ::mlir::dfg::TypeInterface::Trait >

Class Documentation

class InputType : public mlir::Type::TypeBase<InputType, ::mlir::Type, detail::InputTypeStorage, ::mlir::dfg::TypeInterface::Trait>

Public Functions

void print(::mlir::AsmPrinter &odsPrinter) const

Prints an InputType in its assembly format <[shape x] type>.

Emits <, the dimension list (omitting the trailing x for scalar types), the element type, and >.

::llvm::ArrayRef<int64_t> getShape() const
Type getElementType() const

Public Static Functions

static InputType get(::mlir::MLIRContext *context, ::llvm::ArrayRef<int64_t> shape, Type elementType)
static InputType getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, ::llvm::ArrayRef<int64_t> shape, Type elementType)
static InputType get(Type elementType)

Creates an InputType for a scalar element type with no shape dimensions.

This is the simplest form of InputType where the channel carries a single scalar value of the given elementType. Equivalent to calling InputType::get({}, elementType).

static InputType getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, Type elementType)
static InputType get(ArrayRef<int64_t> shape, Type elementType)

Creates an InputType with an explicit shape and element type.

The shape defines the number of elements along each dimension. All dimensions must be static (non-negative). Pass an empty shape for a scalar channel.

static InputType getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ArrayRef<int64_t> shape, Type elementType)
static InputType get(ShapedType shapedType)

Creates an InputType from an existing ShapedType.

Convenience builder that decomposes shapedType into its shape and scalar element type, then constructs the corresponding InputType. Useful when adapting memref or tensor types to DFG channel types.

static InputType getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ShapedType shapedType)
static ::llvm::LogicalResult verify(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::llvm::ArrayRef<int64_t> shape, Type elementType)

Verifies the invariants of an InputType.

Checks that elementType is a scalar (not a ShapedType) and that every dimension in shape is non-negative (i.e. static).

static ::llvm::LogicalResult verifyInvariants(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::llvm::ArrayRef<int64_t> shape, Type elementType)
static inline constexpr ::llvm::StringLiteral getMnemonic()
static ::mlir::Type parse(::mlir::AsmParser &odsParser)

Parses an InputType from its assembly format <[shape x] type>.

Expects a < delimiter, an optional dimension list (e.g. 2x3x), a scalar element type, and a closing >. Returns an empty Type on any parse failure.

Public Static Attributes

static constexpr ::llvm::StringLiteral name = "dfg.input"
static constexpr ::llvm::StringLiteral dialectName = "dfg"