MLIR 23.0.0git
mlir::quant::QuantileType Class Reference

#include "mlir/Dialect/Quant/IR/QuantTypes.h"

Inheritance diagram for mlir::quant::QuantileType:

Public Types

using ImplType = detail::QuantileTypeStorage
Public Types inherited from mlir::detail::StorageUserBase< ConcreteType, BaseType, StorageType, detail::TypeUniquer, Traits... >
using Base
 Utility declarations for the concrete attribute class.
using ImplType
using HasTraitFn

Public Member Functions

Type getStorageType () const
Type getQuantileType () const
ArrayRef< double > getQuantiles () const
 Return the quantile table of this float type.
std::optional< int64_tgetStorageMin () const
 Return the explicit storage minimum, if set.
std::optional< int64_tgetStorageMax () const
 Return the explicit storage maximum, if set.
void print (mlir::AsmPrinter &printer) const
bool shouldDefaultToSigned () const
unsigned getStorageWidth () const
int64_t getDefaultMinimum (bool isSigned) const
int64_t getDefaultMaximum (bool isSigned) const
std::string getStorageTypeName (bool isSigned) const
bool isPacked () const
unsigned getLogicalBitWidth () const
unsigned getElementsPerByte () const
std::optional< unsignedgetPreferredAlignmentBytes () const
Public Member Functions inherited from mlir::detail::StorageUserBase< ConcreteType, BaseType, StorageType, detail::TypeUniquer, Traits... >
ImplTypegetImpl () const
 Utility for easy access to the storage instance.

Static Public Member Functions

static QuantileType get (mlir::MLIRContext *ctx, Type storageType, Type quantileType, ArrayRef< double > quantiles={}, std::optional< int64_t > storageMin=std::nullopt, std::optional< int64_t > storageMax=std::nullopt)
static QuantileType getChecked (function_ref< InFlightDiagnostic()> emitError, mlir::MLIRContext *ctx, Type storageType, Type quantileType, ArrayRef< double > quantiles, std::optional< int64_t > storageMin=std::nullopt, std::optional< int64_t > storageMax=std::nullopt)
static LogicalResult verifyInvariants (function_ref< InFlightDiagnostic()> emitError, Type storageType, Type quantileType, ArrayRef< double > quantiles, std::optional< int64_t > storageMin, std::optional< int64_t > storageMax)
static bool classof (mlir::Type type)
 Methods for support type inquiry through isa, cast, and dyn_cast.
static constexpr llvm::StringLiteral getMnemonic ()
Static Public Member Functions inherited from mlir::detail::StorageUserBase< ConcreteType, BaseType, StorageType, detail::TypeUniquer, Traits... >
static TypeID getTypeID ()
 Return a unique identifier for the concrete type.
static bool classof (T val)
 Provide an implementation of 'classof' that compares the type id of the provided value with that of the concrete type.
static detail::InterfaceMap getInterfaceMap ()
 Returns an interface map for the interfaces registered to this storage user.
static HasTraitFn getHasTraitFn ()
 Returns the function that returns true if the given Trait ID matches the IDs of any of the traits defined by the storage user.
static auto getWalkImmediateSubElementsFn ()
 Returns a function that walks immediate sub elements of a given instance of the storage user.
static auto getReplaceImmediateSubElementsFn ()
 Returns a function that replaces immediate sub elements of a given instance of the storage user.
static void attachInterface (MLIRContext &context)
 Attach the given models as implementations of the corresponding interfaces for the concrete storage user class.
static ConcreteType get (MLIRContext *ctx, Args &&...args)
 Get or create a new ConcreteT instance within the ctx.
static ConcreteType getChecked (const Location &loc, Args &&...args)
 Get or create a new ConcreteT instance within the ctx, defined at the given, potentially unknown, location.
static ConcreteType getChecked (function_ref< InFlightDiagnostic()> emitErrorFn, MLIRContext *ctx, Args... args)
 Get or create a new ConcreteT instance within the ctx.
static ConcreteType getFromOpaquePointer (const void *ptr)
 Get an instance of the concrete type from a void pointer.

Static Public Attributes

static constexpr llvm::StringLiteral name = "quantile"

Additional Inherited Members

Protected Member Functions inherited from mlir::detail::StorageUserBase< ConcreteType, BaseType, StorageType, detail::TypeUniquer, Traits... >
LogicalResult mutate (Args &&...args)
 Mutate the current storage instance.
Static Protected Member Functions inherited from mlir::detail::StorageUserBase< ConcreteType, BaseType, StorageType, detail::TypeUniquer, Traits... >
static LogicalResult verifyInvariants (Args... args)
 Default implementation that just returns success.

Detailed Description

Definition at line 589 of file QuantTypes.h.

Member Typedef Documentation

◆ ImplType

Member Function Documentation

◆ classof()

bool QuantileType::classof ( mlir::Type type)
static

Methods for support type inquiry through isa, cast, and dyn_cast.

Definition at line 613 of file QuantTypes.cpp.

References mlir::TypeID::get(), and mlir::Type::getTypeID().

◆ get()

QuantileType QuantileType::get ( mlir::MLIRContext * ctx,
mlir::Type storageType,
mlir::Type quantileType,
ArrayRef< double > quantiles = {},
std::optional< int64_t > storageMin = std::nullopt,
std::optional< int64_t > storageMax = std::nullopt )
static

◆ getChecked()

QuantileType QuantileType::getChecked ( function_ref< InFlightDiagnostic()> emitError,
mlir::MLIRContext * ctx,
mlir::Type storageType,
mlir::Type quantileType,
ArrayRef< double > quantiles,
std::optional< int64_t > storageMin = std::nullopt,
std::optional< int64_t > storageMax = std::nullopt )
static

◆ getDefaultMaximum()

int64_t QuantileType::getDefaultMaximum ( bool isSigned) const

Definition at line 648 of file QuantTypes.cpp.

References getStorageMax(), and getStorageWidth().

◆ getDefaultMinimum()

int64_t QuantileType::getDefaultMinimum ( bool isSigned) const

Definition at line 656 of file QuantTypes.cpp.

References getStorageMin(), and getStorageWidth().

◆ getElementsPerByte()

unsigned QuantileType::getElementsPerByte ( ) const

Definition at line 685 of file QuantTypes.cpp.

References getStorageWidth().

◆ getLogicalBitWidth()

unsigned QuantileType::getLogicalBitWidth ( ) const

Definition at line 683 of file QuantTypes.cpp.

References getStorageWidth().

◆ getMnemonic()

constexpr llvm::StringLiteral mlir::quant::QuantileType::getMnemonic ( )
inlinestaticconstexpr

Definition at line 638 of file QuantTypes.h.

◆ getPreferredAlignmentBytes()

std::optional< unsigned > QuantileType::getPreferredAlignmentBytes ( ) const

Definition at line 690 of file QuantTypes.cpp.

◆ getQuantiles()

ArrayRef< double > QuantileType::getQuantiles ( ) const

Return the quantile table of this float type.

Definition at line 625 of file QuantTypes.cpp.

References getQuantiles().

Referenced by getQuantiles(), getStorageTypeName(), and printQuantileType().

◆ getQuantileType()

mlir::Type QuantileType::getQuantileType ( ) const

Definition at line 621 of file QuantTypes.cpp.

References getQuantileType().

Referenced by getQuantileType(), getStorageTypeName(), and printQuantileType().

◆ getStorageMax()

std::optional< int64_t > QuantileType::getStorageMax ( ) const

Return the explicit storage maximum, if set.

Definition at line 633 of file QuantTypes.cpp.

References getStorageMax().

Referenced by getDefaultMaximum(), getStorageMax(), getStorageTypeName(), and printQuantileType().

◆ getStorageMin()

std::optional< int64_t > QuantileType::getStorageMin ( ) const

Return the explicit storage minimum, if set.

Definition at line 629 of file QuantTypes.cpp.

References getStorageMin().

Referenced by getDefaultMinimum(), getStorageMin(), getStorageTypeName(), and printQuantileType().

◆ getStorageType()

mlir::Type QuantileType::getStorageType ( ) const

◆ getStorageTypeName()

std::string QuantileType::getStorageTypeName ( bool isSigned) const

◆ getStorageWidth()

unsigned QuantileType::getStorageWidth ( ) const

◆ isPacked()

bool QuantileType::isPacked ( ) const

Definition at line 681 of file QuantTypes.cpp.

References getStorageWidth().

◆ print()

void mlir::quant::QuantileType::print ( mlir::AsmPrinter & printer) const

◆ shouldDefaultToSigned()

bool QuantileType::shouldDefaultToSigned ( ) const

Definition at line 637 of file QuantTypes.cpp.

References getStorageType().

◆ verifyInvariants()

LogicalResult QuantileType::verifyInvariants ( function_ref< InFlightDiagnostic()> emitError,
Type storageType,
Type quantileType,
ArrayRef< double > quantiles,
std::optional< int64_t > storageMin,
std::optional< int64_t > storageMax )
static

Member Data Documentation

◆ name

llvm::StringLiteral mlir::quant::QuantileType::name = "quantile"
staticconstexpr

Definition at line 640 of file QuantTypes.h.


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