MLIR  20.0.0git
GPUToSPIRV.h
Go to the documentation of this file.
1 //===- GPUToSPIRV.h - GPU to SPIR-V Patterns --------------------*- 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 patterns to convert GPU dialect to SPIR-V dialect.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef MLIR_CONVERSION_GPUTOSPIRV_GPUTOSPIRV_H
14 #define MLIR_CONVERSION_GPUTOSPIRV_GPUTOSPIRV_H
15 
19 
20 namespace mlir {
21 class SPIRVTypeConverter;
22 
23 /// Appends to a pattern list additional patterns for translating GPU Ops to
24 /// SPIR-V ops. For a gpu.func to be converted, it should have a
25 /// spirv.entry_point_abi attribute.
26 void populateGPUToSPIRVPatterns(const SPIRVTypeConverter &typeConverter,
27  RewritePatternSet &patterns);
28 
29 /// Collect a set of patterns to convert WMMA ops from GPU dialect to SPIRV,
30 /// using the KHR Cooperative Matrix extension.
32  const SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns);
33 
34 /// Adds `MMAMatrixType` conversions to SPIR-V cooperative matrix KHR type
35 /// conversion to the type converter.
37  SPIRVTypeConverter &typeConverter);
38 } // namespace mlir
39 
40 #endif // MLIR_CONVERSION_GPUTOSPIRV_GPUTOSPIRV_H
Include the generated interface declarations.
void populateGpuWMMAToSPIRVCoopMatrixKHRConversionPatterns(const SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns)
Collect a set of patterns to convert WMMA ops from GPU dialect to SPIRV, using the KHR Cooperative Ma...
void populateGPUToSPIRVPatterns(const SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns)
Appends to a pattern list additional patterns for translating GPU Ops to SPIR-V ops.
Definition: GPUToSPIRV.cpp:732
void populateMMAToSPIRVCoopMatrixTypeConversion(SPIRVTypeConverter &typeConverter)
Adds MMAMatrixType conversions to SPIR-V cooperative matrix KHR type conversion to the type converter...