MLIR 22.0.0git
VectorToGPU.h
Go to the documentation of this file.
1//===- VectorToGPU.h - Convert vector to GPU dialect ------------*- 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_CONVERSION_VECTORTOGPU_VECTORTOGPU_H
10#define MLIR_CONVERSION_VECTORTOGPU_VECTORTOGPU_H
11
13
14namespace mlir {
15class MLIRContext;
16class Pass;
18
19#define GEN_PASS_DECL_CONVERTVECTORTOGPU
20#include "mlir/Conversion/Passes.h.inc"
21
22/// Patterns to transform vector ops into a canonical form to convert to MMA
23/// matrix operations. If `useNvGpu` is true, then the patterns will populated
24/// will prepare for conversion to `nvgpu` mma operations rather than the `gpu`
25/// dialect WMMA operations.
26void populatePrepareVectorToMMAPatterns(RewritePatternSet &patterns,
27 bool useNvGpu = false);
28
29/// Convert vector ops to MMA matrix operations nested under `rootOp`. This will
30/// convert slice of operations that can be legally converted to MMA operations.
31/// The rest of the vector operations are left untouched.
32LogicalResult convertVectorToMMAOps(RewriterBase &rewriter, Operation *rootOp);
33
34/// Convert vector ops ops nested under `rootOp` to vector and GPU operaitons
35/// compatible with the `nvvm.mma.sync` lowering path. This will convert a slice
36/// of operations that can be legally lowered on this path while the rest of
37/// the vector operations are left untouched.
38LogicalResult convertVectorToNVVMCompatibleMMASync(RewriterBase &rewriter,
39 Operation *rootOp);
40
41/// Convert from vector to GPU ops.
42std::unique_ptr<Pass> createConvertVectorToGPUPass(bool useNvGpu = false);
43
44} // namespace mlir
45
46#endif // MLIR_CONVERSION_VECTORTOGPU_VECTORTOGPU_H
MLIRContext is the top-level object for a collection of MLIR operations.
Definition MLIRContext.h:63
The abstract base pass class.
Definition Pass.h:51
Include the generated interface declarations.
void populatePrepareVectorToMMAPatterns(RewritePatternSet &patterns, bool useNvGpu=false)
Patterns to transform vector ops into a canonical form to convert to MMA matrix operations.
const FrozenRewritePatternSet & patterns
LogicalResult convertVectorToNVVMCompatibleMMASync(RewriterBase &rewriter, Operation *rootOp)
Convert vector ops ops nested under rootOp to vector and GPU operaitons compatible with the nvvm....
std::unique_ptr< Pass > createConvertVectorToGPUPass(bool useNvGpu=false)
Convert from vector to GPU ops.
LogicalResult convertVectorToMMAOps(RewriterBase &rewriter, Operation *rootOp)
Convert vector ops to MMA matrix operations nested under rootOp.