1 //===-- OpenMPClauseOperands.h ----------------------------------*- 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 // This file declares the structures defining MLIR operands associated with each 10 // OpenMP clause, and structures grouping the appropriate operands for each 11 // construct. 12 // 13 //===----------------------------------------------------------------------===// 14 15 #ifndef MLIR_DIALECT_OPENMP_OPENMPCLAUSEOPERANDS_H_ 16 #define MLIR_DIALECT_OPENMP_OPENMPCLAUSEOPERANDS_H_ 17 18 #include "mlir/IR/BuiltinAttributes.h" 19 #include "llvm/ADT/SmallVector.h" 20 21 #include "mlir/Dialect/OpenMP/OpenMPOpsEnums.h.inc" 22 23 #define GET_ATTRDEF_CLASSES 24 #include "mlir/Dialect/OpenMP/OpenMPOpsAttributes.h.inc" 25 26 #include "mlir/Dialect/OpenMP/OpenMPClauseOps.h.inc" 27 28 namespace mlir { 29 namespace omp { 30 31 //===----------------------------------------------------------------------===// 32 // Extra clause operand structures. 33 //===----------------------------------------------------------------------===// 34 35 struct DeviceTypeClauseOps { 36 /// The default capture type. 37 DeclareTargetDeviceType deviceType = DeclareTargetDeviceType::any; 38 }; 39 40 //===----------------------------------------------------------------------===// 41 // Extra operation operand structures. 42 //===----------------------------------------------------------------------===// 43 44 /// Clauses that correspond to operations other than omp.target, but might have 45 /// to be evaluated outside of a parent target region. 46 using HostEvaluatedOperands = 47 detail::Clauses<LoopRelatedClauseOps, NumTeamsClauseOps, 48 NumThreadsClauseOps, ThreadLimitClauseOps>; 49 50 // TODO: Add `indirect` clause. 51 using DeclareTargetOperands = detail::Clauses<DeviceTypeClauseOps>; 52 53 /// omp.target_enter_data, omp.target_exit_data and omp.target_update take the 54 /// same clauses, so we give the structure to be shared by all of them a 55 /// representative name. 56 using TargetEnterExitUpdateDataOperands = TargetEnterDataOperands; 57 58 } // namespace omp 59 } // namespace mlir 60 61 #endif // MLIR_DIALECT_OPENMP_OPENMPCLAUSEOPERANDS_H_ 62