MLIR  20.0.0git
GPUToNVVMPass.h
Go to the documentation of this file.
1 //===- GPUToNVVMPass.h - Convert GPU kernel to NVVM 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 #ifndef MLIR_CONVERSION_GPUTONVVM_GPUTONVVMPASS_H_
9 #define MLIR_CONVERSION_GPUTONVVM_GPUTONVVMPASS_H_
10 
13 #include <memory>
14 
15 namespace mlir {
16 class LLVMTypeConverter;
17 class ConversionTarget;
18 class RewritePatternSet;
19 class Pass;
20 
21 namespace gpu {
22 class GPUModuleOp;
23 class MMAMatrixType;
24 } // namespace gpu
25 
26 #define GEN_PASS_DECL_CONVERTGPUOPSTONVVMOPS
27 #include "mlir/Conversion/Passes.h.inc"
28 
29 LLVM::LLVMStructType convertMMAToLLVMType(gpu::MMAMatrixType type);
30 
31 /// Configure target to convert from the GPU dialect to NVVM.
32 void configureGpuToNVVMConversionLegality(ConversionTarget &target);
33 
34 /// Collect a set of patterns to convert from the GPU dialect to NVVM.
35 void populateGpuToNVVMConversionPatterns(const LLVMTypeConverter &converter,
36  RewritePatternSet &patterns);
37 
38 /// Populate GpuSubgroupReduce pattern to NVVM. It generates a specific nvvm
39 /// op that is not available on every GPU.
41  const LLVMTypeConverter &converter, RewritePatternSet &patterns);
42 
43 /// Collect a set of patterns to convert WMMA ops from GPU dialect to NVVM.
44 void populateGpuWMMAToNVVMConversionPatterns(const LLVMTypeConverter &converter,
45  RewritePatternSet &patterns);
46 } // namespace mlir
47 
48 #endif // MLIR_CONVERSION_GPUTONVVM_GPUTONVVMPASS_H_
Include the generated interface declarations.
void populateGpuToNVVMConversionPatterns(const LLVMTypeConverter &converter, RewritePatternSet &patterns)
Collect a set of patterns to convert from the GPU dialect to NVVM.
LLVM::LLVMStructType convertMMAToLLVMType(gpu::MMAMatrixType type)
Return the LLVMStructureType corresponding to the MMAMatrixType type.
void configureGpuToNVVMConversionLegality(ConversionTarget &target)
Configure target to convert from the GPU dialect to NVVM.
void populateGpuWMMAToNVVMConversionPatterns(const LLVMTypeConverter &converter, RewritePatternSet &patterns)
Collect a set of patterns to convert WMMA ops from GPU dialect to NVVM.
void populateGpuSubgroupReduceOpLoweringPattern(const LLVMTypeConverter &converter, RewritePatternSet &patterns)
Populate GpuSubgroupReduce pattern to NVVM.