MLIR  20.0.0git
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions
Enums.h File Reference
#include <cassert>
#include <cinttypes>
#include <complex>
#include <optional>
#include <vector>

Go to the source code of this file.

Classes

struct  mlir::sparse_tensor::LevelType
 This enum defines all the sparse representations supportable by the SparseTensor dialect. More...
 

Namespaces

 mlir
 Include the generated interface declarations.
 
 mlir::sparse_tensor
 

Macros

#define MLIR_SPARSETENSOR_FOREVERY_FIXED_O(DO)
 
#define MLIR_SPARSETENSOR_FOREVERY_O(DO)
 
#define MLIR_SPARSETENSOR_FOREVERY_V(DO)
 
#define MLIR_SPARSETENSOR_FOREVERY_V_VAR(DO, ...)
 
#define MLIR_SPARSETENSOR_FOREVERY_V_O(DO)
 

Typedefs

using mlir::sparse_tensor::index_type = uint64_t
 This type is used in the public API at all places where MLIR expects values with the built-in type "index". More...
 
using mlir::sparse_tensor::complex64 = std::complex< double >
 
using mlir::sparse_tensor::complex32 = std::complex< float >
 

Enumerations

enum class  mlir::sparse_tensor::OverheadType : uint32_t {
  mlir::sparse_tensor::kIndex = 0 , mlir::sparse_tensor::kU64 = 1 , mlir::sparse_tensor::kU32 = 2 , mlir::sparse_tensor::kU16 = 3 ,
  mlir::sparse_tensor::kU8 = 4
}
 Encoding of overhead types (both position overhead and coordinate overhead), for "overloading" @newSparseTensor. More...
 
enum class  mlir::sparse_tensor::PrimaryType : uint32_t {
  mlir::sparse_tensor::kF64 = 1 , mlir::sparse_tensor::kF32 = 2 , mlir::sparse_tensor::kF16 = 3 , mlir::sparse_tensor::kBF16 = 4 ,
  mlir::sparse_tensor::kI64 = 5 , mlir::sparse_tensor::kI32 = 6 , mlir::sparse_tensor::kI16 = 7 , mlir::sparse_tensor::kI8 = 8 ,
  mlir::sparse_tensor::kC64 = 9 , mlir::sparse_tensor::kC32 = 10
}
 Encoding of the elemental type, for "overloading" @newSparseTensor. More...
 
enum class  mlir::sparse_tensor::Action : uint32_t { mlir::sparse_tensor::kEmpty = 0 , mlir::sparse_tensor::kFromReader = 1 , mlir::sparse_tensor::kPack = 2 , mlir::sparse_tensor::kSortCOOInPlace = 3 }
 The actions performed by @newSparseTensor. More...
 
enum class  mlir::sparse_tensor::LevelFormat : uint64_t {
  mlir::sparse_tensor::Undef = 0x00000000 , mlir::sparse_tensor::Dense = 0x00010000 , mlir::sparse_tensor::Batch = 0x00020000 , mlir::sparse_tensor::Compressed = 0x00040000 ,
  mlir::sparse_tensor::Singleton = 0x00080000 , mlir::sparse_tensor::LooseCompressed = 0x00100000 , mlir::sparse_tensor::NOutOfM = 0x00200000
}
 This enum defines all supported storage format without the level properties. More...
 
enum class  mlir::sparse_tensor::LevelPropNonDefault : uint64_t { mlir::sparse_tensor::Nonunique = 0x0001 , mlir::sparse_tensor::Nonordered = 0x0002 , mlir::sparse_tensor::SoA = 0x0004 }
 This enum defines all the nondefault properties for storage formats. More...
 

Functions

constexpr bool mlir::sparse_tensor::isFloatingPrimaryType (PrimaryType valTy)
 
constexpr bool mlir::sparse_tensor::isIntegralPrimaryType (PrimaryType valTy)
 
constexpr bool mlir::sparse_tensor::isRealPrimaryType (PrimaryType valTy)
 
constexpr bool mlir::sparse_tensor::isComplexPrimaryType (PrimaryType valTy)
 
constexpr bool mlir::sparse_tensor::encPowOfTwo (LevelFormat fmt)
 
template<LevelFormat... targets>
constexpr bool mlir::sparse_tensor::isAnyOfFmt (LevelFormat fmt)
 
constexpr const char * mlir::sparse_tensor::toFormatString (LevelFormat lvlFmt)
 Returns string representation of the given level format. More...
 
constexpr const char * mlir::sparse_tensor::toPropString (LevelPropNonDefault lvlProp)
 Returns string representation of the given level properties. More...
 
constexpr uint64_t mlir::sparse_tensor::nToBits (uint64_t n)
 
constexpr uint64_t mlir::sparse_tensor::mToBits (uint64_t m)
 
std::optional< LevelType > mlir::sparse_tensor::buildLevelType (LevelFormat lf, const std::vector< LevelPropNonDefault > &properties, uint64_t n=0, uint64_t m=0)
 
std::optional< LevelType > mlir::sparse_tensor::buildLevelType (LevelFormat lf, bool ordered, bool unique, uint64_t n=0, uint64_t m=0)
 
bool mlir::sparse_tensor::isUndefLT (LevelType lt)
 
bool mlir::sparse_tensor::isDenseLT (LevelType lt)
 
bool mlir::sparse_tensor::isBatchLT (LevelType lt)
 
bool mlir::sparse_tensor::isCompressedLT (LevelType lt)
 
bool mlir::sparse_tensor::isLooseCompressedLT (LevelType lt)
 
bool mlir::sparse_tensor::isSingletonLT (LevelType lt)
 
bool mlir::sparse_tensor::isNOutOfMLT (LevelType lt)
 
bool mlir::sparse_tensor::isOrderedLT (LevelType lt)
 
bool mlir::sparse_tensor::isUniqueLT (LevelType lt)
 
bool mlir::sparse_tensor::isWithCrdLT (LevelType lt)
 
bool mlir::sparse_tensor::isWithPosLT (LevelType lt)
 
bool mlir::sparse_tensor::isValidLT (LevelType lt)
 
std::optional< LevelFormat > mlir::sparse_tensor::getLevelFormat (LevelType lt)
 
uint64_t mlir::sparse_tensor::getN (LevelType lt)
 
uint64_t mlir::sparse_tensor::getM (LevelType lt)
 
bool mlir::sparse_tensor::isValidNOutOfMLT (LevelType lt, uint64_t n, uint64_t m)
 
std::string mlir::sparse_tensor::toMLIRString (LevelType lt)
 
constexpr uint64_t mlir::sparse_tensor::encodeDim (uint64_t i, uint64_t cf, uint64_t cm)
 Bit manipulations for affine encoding. More...
 
constexpr uint64_t mlir::sparse_tensor::encodeLvl (uint64_t i, uint64_t c, uint64_t ii)
 
constexpr bool mlir::sparse_tensor::isEncodedFloor (uint64_t v)
 
constexpr bool mlir::sparse_tensor::isEncodedMod (uint64_t v)
 
constexpr bool mlir::sparse_tensor::isEncodedMul (uint64_t v)
 
constexpr uint64_t mlir::sparse_tensor::decodeIndex (uint64_t v)
 
constexpr uint64_t mlir::sparse_tensor::decodeConst (uint64_t v)
 
constexpr uint64_t mlir::sparse_tensor::decodeMulc (uint64_t v)
 
constexpr uint64_t mlir::sparse_tensor::decodeMuli (uint64_t v)
 

Macro Definition Documentation

◆ MLIR_SPARSETENSOR_FOREVERY_FIXED_O

#define MLIR_SPARSETENSOR_FOREVERY_FIXED_O (   DO)
Value:
DO(64, uint64_t) \
DO(32, uint32_t) \
DO(16, uint16_t) \
DO(8, uint8_t)

Definition at line 63 of file Enums.h.

◆ MLIR_SPARSETENSOR_FOREVERY_O

#define MLIR_SPARSETENSOR_FOREVERY_O (   DO)
Value:
DO(0, index_type)
#define MLIR_SPARSETENSOR_FOREVERY_FIXED_O(DO)
Definition: Enums.h:63
uint64_t index_type
This type is used in the public API at all places where MLIR expects values with the built-in type "i...
Definition: Enums.h:47

Definition at line 71 of file Enums.h.

◆ MLIR_SPARSETENSOR_FOREVERY_V

#define MLIR_SPARSETENSOR_FOREVERY_V (   DO)
Value:
DO(F64, double) \
DO(F32, float) \
DO(F16, f16) \
DO(BF16, bf16) \
DO(I64, int64_t) \
DO(I32, int32_t) \
DO(I16, int16_t) \
DO(I8, int8_t) \
DO(C64, complex64) \
DO(C32, complex32)
std::complex< double > complex64
Definition: Enums.h:78
std::complex< float > complex32
Definition: Enums.h:79

Definition at line 96 of file Enums.h.

◆ MLIR_SPARSETENSOR_FOREVERY_V_O

#define MLIR_SPARSETENSOR_FOREVERY_V_O (   DO)
Value:
MLIR_SPARSETENSOR_FOREVERY_V_VAR(DO, 32, uint32_t) \
MLIR_SPARSETENSOR_FOREVERY_V_VAR(DO, 16, uint16_t) \
MLIR_SPARSETENSOR_FOREVERY_V_VAR(DO, 8, uint8_t) \
MLIR_SPARSETENSOR_FOREVERY_V_VAR(DO, 0, index_type)
#define MLIR_SPARSETENSOR_FOREVERY_V_VAR(DO,...)
Definition: Enums.h:109

Definition at line 122 of file Enums.h.

◆ MLIR_SPARSETENSOR_FOREVERY_V_VAR

#define MLIR_SPARSETENSOR_FOREVERY_V_VAR (   DO,
  ... 
)
Value:
DO(F64, double, __VA_ARGS__) \
DO(F32, float, __VA_ARGS__) \
DO(F16, f16, __VA_ARGS__) \
DO(BF16, bf16, __VA_ARGS__) \
DO(I64, int64_t, __VA_ARGS__) \
DO(I32, int32_t, __VA_ARGS__) \
DO(I16, int16_t, __VA_ARGS__) \
DO(I8, int8_t, __VA_ARGS__) \
DO(C64, complex64, __VA_ARGS__) \
DO(C32, complex32, __VA_ARGS__)

Definition at line 109 of file Enums.h.