• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- ConvertGPUToSPIRV.h - GPU Ops to SPIR-V dialect 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 for lowering GPU Ops to SPIR-V dialect.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef MLIR_CONVERSION_GPUTOSPIRV_CONVERTGPUTOSPIRV_H
14 #define MLIR_CONVERSION_GPUTOSPIRV_CONVERTGPUTOSPIRV_H
15 
16 #include "mlir/Transforms/DialectConversion.h"
17 
18 namespace mlir {
19 class SPIRVTypeConverter;
20 
21 /// Appends to a pattern list additional patterns for translating GPU Ops to
22 /// SPIR-V ops. For a gpu.func to be converted, it should have a
23 /// spv.entry_point_abi attribute.
24 void populateGPUToSPIRVPatterns(MLIRContext *context,
25                                 SPIRVTypeConverter &typeConverter,
26                                 OwningRewritePatternList &patterns);
27 } // namespace mlir
28 
29 #endif // MLIR_CONVERSION_GPUTOSPIRV_CONVERTGPUTOSPIRV_H
30