My Project
LinalgTypes.h
Go to the documentation of this file.
1 //===- LinalgTypes.h - Linalg Types ---------------------------------------===//
2 //
3 // Part of the MLIR 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_LINALG_LINALGTYPES_H_
10 #define MLIR_DIALECT_LINALG_LINALGTYPES_H_
11 
12 #include "mlir/IR/Dialect.h"
13 #include "mlir/IR/Types.h"
14 
15 namespace mlir {
16 class MLIRContext;
17 
18 namespace linalg {
20  Range = Type::FIRST_LINALG_TYPE,
22 };
23 
24 class LinalgDialect : public Dialect {
25 public:
26  explicit LinalgDialect(MLIRContext *context);
27  static StringRef getDialectNamespace() { return "linalg"; }
28 
30  Type parseType(DialectAsmParser &parser) const override;
31 
33  void printType(Type type, DialectAsmPrinter &os) const override;
34 };
35 
45 class RangeType : public Type::TypeBase<RangeType, Type> {
46 public:
47  // Used for generic hooks in TypeBase.
48  using Base::Base;
50  static RangeType get(MLIRContext *context) {
52  return Base::get(context, LinalgTypes::Range);
53  }
55  static bool kindof(unsigned kind) { return kind == LinalgTypes::Range; }
56 };
57 
58 } // namespace linalg
59 } // namespace mlir
60 
61 #endif // MLIR_DIALECT_LINALG_LINALGTYPES_H_
Definition: LinalgTypes.h:24
Definition: InferTypeOpInterface.cpp:20
static bool kindof(unsigned kind)
Used to implement llvm-style cast.
Definition: LinalgTypes.h:55
Type parseType(DialectAsmParser &parser) const override
Parse a type registered to this dialect.
Definition: LinalgTypes.cpp:39
LinalgTypes
Definition: LinalgTypes.h:19
Definition: Dialect.h:39
Definition: Types.h:84
LinalgDialect(MLIRContext *context)
Definition: LinalgTypes.cpp:27
Definition: LinalgTypes.h:21
Definition: DialectImplementation.h:33
Definition: StorageUniquerSupport.h:30
Definition: MLIRContext.h:34
void printType(Type type, DialectAsmPrinter &os) const override
Print a type registered to this dialect.
Definition: LinalgTypes.cpp:57
static StringRef getDialectNamespace()
Definition: LinalgTypes.h:27
Definition: LinalgTypes.h:20
Definition: DialectImplementation.h:100
Definition: LinalgTypes.h:45