MLIR  19.0.0git
GPUToSPIRVPass.h
Go to the documentation of this file.
1 //===- GPUToSPIRVPass.h - GPU to SPIR-V Passes ------------------*- 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 // Provides passes to convert GPU dialect to SPIR-V dialect.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef MLIR_CONVERSION_GPUTOSPIRV_GPUTOSPIRVPASS_H
14 #define MLIR_CONVERSION_GPUTOSPIRV_GPUTOSPIRVPASS_H
15 
16 #include <memory>
17 
18 namespace mlir {
19 
20 class ModuleOp;
21 template <typename T>
22 class OperationPass;
23 
24 #define GEN_PASS_DECL_CONVERTGPUTOSPIRV
25 #include "mlir/Conversion/Passes.h.inc"
26 
27 /// Creates a pass to convert GPU kernel ops to corresponding SPIR-V ops. For a
28 /// gpu.func to be converted, it should have a spirv.entry_point_abi attribute.
29 /// If `mapMemorySpace` is true, performs MemRef memory space to SPIR-V mapping
30 /// according to default Vulkan rules first.
31 std::unique_ptr<OperationPass<ModuleOp>>
32 createConvertGPUToSPIRVPass(bool mapMemorySpace = true);
33 
34 } // namespace mlir
35 #endif // MLIR_CONVERSION_GPUTOSPIRV_GPUTOSPIRVPASS_H
Include the generated interface declarations.
std::unique_ptr< OperationPass< ModuleOp > > createConvertGPUToSPIRVPass(bool mapMemorySpace=true)
Creates a pass to convert GPU kernel ops to corresponding SPIR-V ops.