MLIR  19.0.0git
TensorInferTypeOpInterfaceImpl.h
Go to the documentation of this file.
1 //===- TensorInferTypeOpInterfaceImpl.h - ---------------------------------===//
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 // This file implements InferTypeOp interface for TensorOps with ExternalModel.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef MLIR_DIALECT_TENSOR_IR_TENSORINFERTYPEOPINTERFACEIMPL_H_
14 #define MLIR_DIALECT_TENSOR_IR_TENSORINFERTYPEOPINTERFACEIMPL_H_
15 
16 #include "mlir/IR/Dialect.h"
17 
18 namespace mlir {
19 namespace tensor {
20 
21 /// Registers external models for Infer Type interfaces for tensor ops.
22 /// Currently, it registers:
23 ///
24 /// * ReifyRankedShapedTypeOpInterface for `tensor.collapse_shape`.
25 /// * ReifyRankedShapedTypeOpInterface for `tensor.expand_shape`.
26 ///
27 /// Unfortunately, a "normal" internal registration is not possible at the
28 /// moment, because of the dependency of the interface implementation for these
29 /// ops on `affine.apply` and Affine dialect already depends on TensorOps. In
30 /// order to break the cyclic dependency (TensorOps->AffineOps->TensorOps) the
31 /// implementation is moved to a separate library.
33  mlir::DialectRegistry &registry);
34 
35 } // namespace tensor
36 } // namespace mlir
37 
38 #endif // MLIR_DIALECT_TENSOR_IR_TENSORINFERTYPEOPINTERFACEIMPL_H_
The DialectRegistry maps a dialect namespace to a constructor for the matching dialect.
void registerInferTypeOpInterfaceExternalModels(mlir::DialectRegistry &registry)
Registers external models for Infer Type interfaces for tensor ops.
Include the generated interface declarations.