//===- DimLvlMap.cpp ------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "DimLvlMap.h" usingnamespacemlir; usingnamespacemlir::sparse_tensor; usingnamespacemlir::sparse_tensor::ir_detail; //===----------------------------------------------------------------------===// // `DimLvlExpr` implementation. //===----------------------------------------------------------------------===// SymVar DimLvlExpr::castSymVar() const { … } std::optional<SymVar> DimLvlExpr::dyn_castSymVar() const { … } Var DimLvlExpr::castDimLvlVar() const { … } std::optional<Var> DimLvlExpr::dyn_castDimLvlVar() const { … } std::tuple<DimLvlExpr, AffineExprKind, DimLvlExpr> DimLvlExpr::unpackBinop() const { … } //===----------------------------------------------------------------------===// // `DimSpec` implementation. //===----------------------------------------------------------------------===// DimSpec::DimSpec(DimVar var, DimExpr expr, SparseTensorDimSliceAttr slice) : … { … } bool DimSpec::isValid(Ranks const &ranks) const { … } //===----------------------------------------------------------------------===// // `LvlSpec` implementation. //===----------------------------------------------------------------------===// LvlSpec::LvlSpec(LvlVar var, LvlExpr expr, LevelType type) : … { … } bool LvlSpec::isValid(Ranks const &ranks) const { … } //===----------------------------------------------------------------------===// // `DimLvlMap` implementation. //===----------------------------------------------------------------------===// DimLvlMap::DimLvlMap(unsigned symRank, ArrayRef<DimSpec> dimSpecs, ArrayRef<LvlSpec> lvlSpecs) : … { … } bool DimLvlMap::isWF() const { … } AffineMap DimLvlMap::getDimToLvlMap(MLIRContext *context) const { … } AffineMap DimLvlMap::getLvlToDimMap(MLIRContext *context) const { … } //===----------------------------------------------------------------------===//