• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- OpenACC.h - MLIR OpenACC Dialect -------------------------*- C++ -*-===//
2 //
3 // Part of the MLIR 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 // This file declares the OpenACC dialect in MLIR.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef MLIR_DIALECT_OPENACC_OPENACC_H_
14 #define MLIR_DIALECT_OPENACC_OPENACC_H_
15 
16 #include "mlir/IR/Dialect.h"
17 #include "mlir/IR/OpDefinition.h"
18 
19 #include "mlir/Dialect/OpenACC/OpenACCOpsDialect.h.inc"
20 #include "mlir/Dialect/OpenACC/OpenACCOpsEnums.h.inc"
21 
22 #define GET_OP_CLASSES
23 #include "mlir/Dialect/OpenACC/OpenACCOps.h.inc"
24 
25 namespace mlir {
26 namespace acc {
27 
28 /// Enumeration used to encode the execution mapping on a loop construct.
29 /// They refer directly to the OpenACC 3.1 standard:
30 /// 2.9.2. gang
31 /// 2.9.3. worker
32 /// 2.9.4. vector
33 ///
34 /// Value can be combined bitwise to reflect the mapping applied to the
35 /// construct. e.g. `acc.loop gang vector`, the `gang` and `vector` could be
36 /// combined and the final mapping value would be 5 (4 | 1).
37 enum OpenACCExecMapping { NONE = 0, VECTOR = 1, WORKER = 2, GANG = 4 };
38 
39 } // end namespace acc
40 } // end namespace mlir
41 
42 #endif // MLIR_DIALECT_OPENACC_OPENACC_H_
43