MLIR  22.0.0git
GPUToROCDLPass.h
Go to the documentation of this file.
1 //===- GPUToROCDLPass.h - Convert GPU kernel to ROCDL 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_GPUTOROCDL_GPUTOROCDLPASS_H_
9 #define MLIR_CONVERSION_GPUTOROCDL_GPUTOROCDLPASS_H_
10 
13 #include <memory>
14 
15 namespace mlir {
16 class Pass;
17 class LLVMTypeConverter;
18 class ConversionTarget;
19 class RewritePatternSet;
20 
21 template <typename OpT>
22 class OperationPass;
23 
24 namespace amdgpu {
25 struct Chipset;
26 } // namespace amdgpu
27 
28 namespace gpu {
29 class GPUModuleOp;
30 } // namespace gpu
31 
32 #define GEN_PASS_DECL_CONVERTGPUOPSTOROCDLOPS
33 #include "mlir/Conversion/Passes.h.inc"
34 
35 /// Collect a set of patterns to convert from the GPU dialect to ROCDL.
36 /// If `runtime` is Unknown, gpu.printf will not be lowered
37 /// The resulting pattern set should be run over a gpu.module op
38 void populateGpuToROCDLConversionPatterns(const LLVMTypeConverter &converter,
39  RewritePatternSet &patterns,
40  gpu::amd::Runtime runtime,
41  amdgpu::Chipset chipset);
42 
43 /// Configure target to convert from the GPU dialect to ROCDL.
44 void configureGpuToROCDLConversionLegality(ConversionTarget &target);
45 
46 } // namespace mlir
47 
48 #endif // MLIR_CONVERSION_GPUTOROCDL_GPUTOROCDLPASS_H_
Runtime
Potential runtimes for AMD GPU kernels.
Definition: Runtimes.h:15
Include the generated interface declarations.
void populateGpuToROCDLConversionPatterns(const LLVMTypeConverter &converter, RewritePatternSet &patterns, gpu::amd::Runtime runtime, amdgpu::Chipset chipset)
Collect a set of patterns to convert from the GPU dialect to ROCDL.
void configureGpuToROCDLConversionLegality(ConversionTarget &target)
Configure target to convert from the GPU dialect to ROCDL.
const FrozenRewritePatternSet & patterns
Represents the amdgpu gfx chipset version, e.g., gfx90a, gfx942, gfx1103.
Definition: Chipset.h:22