1 //===- LvlTypeParser.h - `LevelType` parser ------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef MLIR_DIALECT_SPARSETENSOR_IR_DETAIL_LVLTYPEPARSER_H 10 #define MLIR_DIALECT_SPARSETENSOR_IR_DETAIL_LVLTYPEPARSER_H 11 12 #include "mlir/IR/OpImplementation.h" 13 14 namespace mlir { 15 namespace sparse_tensor { 16 namespace ir_detail { 17 18 class LvlTypeParser { 19 public: 20 LvlTypeParser() = default; 21 FailureOr<uint64_t> parseLvlType(AsmParser &parser) const; 22 23 private: 24 ParseResult parseProperty(AsmParser &parser, uint64_t *properties) const; 25 ParseResult parseStructured(AsmParser &parser, 26 SmallVector<unsigned> *structured) const; 27 }; 28 29 } // namespace ir_detail 30 } // namespace sparse_tensor 31 } // namespace mlir 32 33 #endif // MLIR_DIALECT_SPARSETENSOR_IR_DETAIL_LVLTYPEPARSER_H 34