FLANG
OpenMP-features.h
1//===-- include/flang/Support/OpenMP-features.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#ifndef FORTRAN_SUPPORT_OPENMP_FEATURES_H_
10#define FORTRAN_SUPPORT_OPENMP_FEATURES_H_
11
12namespace Fortran::common {
13
15template <typename FortranPredefinitions>
16void setOpenMPMacro(int version, FortranPredefinitions &predefinitions) {
17 switch (version) {
18 case 31:
19 default:
20 predefinitions.emplace_back("_OPENMP", "201107");
21 break;
22 case 40:
23 predefinitions.emplace_back("_OPENMP", "201307");
24 break;
25 case 45:
26 predefinitions.emplace_back("_OPENMP", "201511");
27 break;
28 case 50:
29 predefinitions.emplace_back("_OPENMP", "201811");
30 break;
31 case 51:
32 predefinitions.emplace_back("_OPENMP", "202011");
33 break;
34 case 52:
35 predefinitions.emplace_back("_OPENMP", "202111");
36 break;
37 case 60:
38 predefinitions.emplace_back("_OPENMP", "202411");
39 break;
40 }
41}
42} // namespace Fortran::common
43#endif // FORTRAN_SUPPORT_OPENMP_FEATURES_H_
Definition bit-population-count.h:20
void setOpenMPMacro(int version, FortranPredefinitions &predefinitions)
Set _OPENMP macro according to given version number.
Definition OpenMP-features.h:16