| 1 | //===- VectorToNVGPU.h - Convert vector to NVGPU dialect ------------*- C++ |
| 2 | //-*-===// |
| 3 | // |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 5 | // See https://llvm.org/LICENSE.txt for license information. |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef MLIR_CONVERSION_VECTORTONVGPU_VECTORTONVGPU_H |
| 11 | #define MLIR_CONVERSION_VECTORTONVGPU_VECTORTONVGPU_H |
| 12 | |
| 13 | #include "mlir/IR/PatternMatch.h" |
| 14 | |
| 15 | namespace mlir { |
| 16 | class MLIRContext; |
| 17 | class Pass; |
| 18 | class RewritePatternSet; |
| 19 | |
| 20 | #define GEN_PASS_DECL_CONVERTVECTORTONVGPUPASS |
| 21 | #include "mlir/Conversion/Passes.h.inc" |
| 22 | |
| 23 | /// Populate patterns that prepare vector operations for lowering to |
| 24 | /// `nvgpu.mma.sync` operations. |
| 25 | void populatePrepareVectorToNVMMAPatterns(RewritePatternSet &patterns); |
| 26 | |
| 27 | /// Convert vector ops nested under `rootOp` to vector and GPU operations |
| 28 | /// compatible with the `nvvm.mma.sync` lowering path. This will convert a slice |
| 29 | /// of operations that can be legally lowered on this path while the rest of |
| 30 | /// the vector operations are left untouched. |
| 31 | LogicalResult convertVectorToNVVMCompatibleMMASync(RewriterBase &rewriter, |
| 32 | Operation *rootOp); |
| 33 | } // namespace mlir |
| 34 | |
| 35 | #endif // MLIR_CONVERSION_VECTORTONVGPU_VECTORTONVGPU_H |
| 36 | |