MLIR  16.0.0git
SCFToGPUPass.h
Go to the documentation of this file.
1 //===- SCFToGPUPass.h - Pass converting loops to GPU kernels ----*- 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_SCFTOGPU_SCFTOGPUPASS_H_
9 #define MLIR_CONVERSION_SCFTOGPU_SCFTOGPUPASS_H_
10 
12 #include "mlir/Support/LLVM.h"
13 
14 #include <memory>
15 
16 namespace mlir {
17 template <typename T>
19 class Pass;
20 
21 /// Create a pass that converts loop nests into GPU kernels. It considers
22 /// top-level affine.for operations as roots of loop nests and converts them to
23 /// the gpu.launch operations if possible.
24 ///
25 /// No check on the size of the block or grid, or on the validity of
26 /// parallelization is performed, it is under the responsibility of the caller
27 /// to strip-mine the loops and to perform the dependence analysis before
28 /// calling the conversion.
29 std::unique_ptr<InterfacePass<FunctionOpInterface>>
30 createAffineForToGPUPass(unsigned numBlockDims, unsigned numThreadDims);
31 std::unique_ptr<InterfacePass<FunctionOpInterface>> createAffineForToGPUPass();
32 
33 /// Creates a pass that converts scf.parallel operations into a gpu.launch
34 /// operation. The mapping of loop dimensions to launch dimensions is derived
35 /// from mapping attributes. See ParallelToGpuLaunchLowering::matchAndRewrite
36 /// for a description of the used attributes.
37 std::unique_ptr<Pass> createParallelLoopToGpuPass();
38 
39 } // namespace mlir
40 
41 #endif // MLIR_CONVERSION_SCFTOGPU_SCFTOGPUPASS_H_
Pass to transform an operation that implements the given interface.
Definition: SCFToGPUPass.h:18
Include the generated interface declarations.
std::unique_ptr< InterfacePass< FunctionOpInterface > > createAffineForToGPUPass(unsigned numBlockDims, unsigned numThreadDims)
Create a pass that converts loop nests into GPU kernels.
std::unique_ptr< Pass > createParallelLoopToGpuPass()
Creates a pass that converts scf.parallel operations into a gpu.launch operation. ...
The abstract base pass class.
Definition: Pass.h:50