Class PullAsTensorOp

Inheritance Relationships

Base Type

  • public mlir::Op< PullAsTensorOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::RankedTensorType >::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::OpAsmOpInterface::Trait >

Class Documentation

class PullAsTensorOp : public mlir::Op<PullAsTensorOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::RankedTensorType>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::OpAsmOpInterface::Trait>

Public Types

using Adaptor = PullAsTensorOpAdaptor
template<typename RangeT>
using GenericAdaptor = PullAsTensorOpGenericAdaptor<RangeT>
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>
using Properties = FoldAdaptor::Properties

Public Functions

inline ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames()
inline std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index)
inline ::mlir::Operation::operand_range getODSOperands(unsigned index)
inline ::mlir::TypedValue<::mlir::dfg::OutputType> getReadPort()
inline ::mlir::OpOperand &getReadPortMutable()
inline std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index)
inline ::mlir::Operation::result_range getODSResults(unsigned index)
inline ::mlir::TypedValue<::mlir::RankedTensorType> getTokenTensor()
void print(::mlir::OpAsmPrinter &p)

Prints a dfg::PullAsTensorOp in the custom assembly syntax consumed by parse.

Emits readPort : portType; the tensor result type is implicit.

::llvm::LogicalResult verifyInvariantsImpl()
::llvm::LogicalResult verifyInvariants()
::llvm::LogicalResult verify()

Verifies that the source port is shaped.

Pulling a scalar port as a tensor is ill-typed, so it is rejected as a hard error.

void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn)

Assigns a pretty name to the tensor result of a dfg::PullAsTensorOp.

The result is named token_tensorN where N is the count of PullAsTensorOps preceding this one inside the enclosing DFG node, following the same walk-and-count strategy used by PullOp.

Public Static Functions

static inline constexpr ::llvm::StringLiteral getOperationName()
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
static llvm::hash_code computePropertiesHash(const Properties &prop)
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value readPort)

Builds a dfg::PullAsTensorOp that reads an entire shaped port as a ranked tensor.

The result type is a RankedTensorType whose shape and element type are taken from the dfg::OutputType of readPort.

Parameters:

readPort – The shaped dfg::OutputType port to read; scalar ports are rejected by verify.

static PullAsTensorOp create(::mlir::OpBuilder &builder, ::mlir::Location location, Value readPort)
static PullAsTensorOp create(::mlir::ImplicitLocOpBuilder &builder, Value readPort)
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)

Parses a dfg::PullAsTensorOp from its custom assembly syntax.

The expected syntax is:

`dfg.pull_as_tensor` %readPort `:` port-type

No index list is accepted because this operation always reads the full shaped extent of the port. The result type (a RankedTensorType) is derived from the port type and is not written explicitly.

static ::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)

Public Static Attributes

static constexpr int odsIndex_read_port = 0