MLIR 22.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
20namespace mlir {
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.
26void populateGPUToSPIRVPatterns(const SPIRVTypeConverter &typeConverter,
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
Type conversion from builtin types to SPIR-V types for shader interface.
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...
const FrozenRewritePatternSet & patterns
void populateGPUToSPIRVPatterns(const SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns)
Appends to a pattern list additional patterns for translating GPU Ops to SPIR-V ops.
void populateMMAToSPIRVCoopMatrixTypeConversion(SPIRVTypeConverter &typeConverter)
Adds MMAMatrixType conversions to SPIR-V cooperative matrix KHR type conversion to the type converter...