//===- DimLvlMap.h ----------------------------------------------*- C++ -*-===// // // 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 // //===----------------------------------------------------------------------===// #ifndef MLIR_DIALECT_SPARSETENSOR_IR_DETAIL_DIMLVLMAP_H #define MLIR_DIALECT_SPARSETENSOR_IR_DETAIL_DIMLVLMAP_H #include "Var.h" #include "mlir/Dialect/SparseTensor/IR/SparseTensor.h" #include "llvm/ADT/STLForwardCompat.h" namespace mlir { namespace sparse_tensor { namespace ir_detail { //===----------------------------------------------------------------------===// enum class ExprKind : bool { … }; constexpr VarKind getVarKindAllowedInExpr(ExprKind ek) { … } static_assert …; //===----------------------------------------------------------------------===// class DimLvlExpr { … }; static_assert …; class DimExpr final : public DimLvlExpr { … }; static_assert …; class LvlExpr final : public DimLvlExpr { … }; static_assert …; template <typename U> constexpr bool DimLvlExpr::isa() const { … } template <typename U> constexpr U DimLvlExpr::cast() const { … } template <typename U> constexpr U DimLvlExpr::dyn_cast() const { … } //===----------------------------------------------------------------------===// /// The full `dimVar = dimExpr : dimSlice` specification for a given dimension. class DimSpec final { … }; static_assert …; //===----------------------------------------------------------------------===// /// The full `lvlVar = lvlExpr : lvlType` specification for a given level. class LvlSpec final { … }; static_assert …; //===----------------------------------------------------------------------===// class DimLvlMap final { … }; //===----------------------------------------------------------------------===// } // namespace ir_detail } // namespace sparse_tensor } // namespace mlir #endif // MLIR_DIALECT_SPARSETENSOR_IR_DETAIL_DIMLVLMAP_H