diff options
author | Andrew Gozillon <Andrew.Gozillon@amd.com> | 2023-03-07 12:39:16 -0600 |
---|---|---|
committer | Andrew Gozillon <Andrew.Gozillon@amd.com> | 2023-03-07 12:57:58 -0600 |
commit | e002a38b20e3ac40aecbbfa0774f8ba7b9690b0c (patch) | |
tree | 466d7e4b31b9028710ef011b85a09a55557b61f7 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 284fcbb95a899228b99728e9d8960fc7a6c5c6ac (diff) | |
download | llvm-e002a38b20e3ac40aecbbfa0774f8ba7b9690b0c.zip llvm-e002a38b20e3ac40aecbbfa0774f8ba7b9690b0c.tar.gz llvm-e002a38b20e3ac40aecbbfa0774f8ba7b9690b0c.tar.bz2 |
[Flang][OpenMP][MLIR][Driver][bbc] Add -fopenmp-is-device flag to Flang -fc1 & the bbc tool, and omp.is_device attribute
Adds the -fopenmp-is-device flag to bbc and Flang's -fc1 (but not flang-new) and in addition adds an omp.is_device attribute onto the module when fopenmp is passed, this is a boolean attribute that is set to false or true dependent on if fopenmp-is-device is specified alongside the fopenmp flag on the commandline when invoking flang or bbc.
Reviewers:
awarzynski
kiranchandramohan
Differential Revision: https://reviews.llvm.org/D144864
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | flang/lib/Frontend/CompilerInvocation.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index 4fb1eb8..d043444 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -670,6 +670,10 @@ static bool parseDialectArgs(CompilerInvocation &res, llvm::opt::ArgList &args, if (args.hasArg(clang::driver::options::OPT_fopenmp)) { res.getFrontendOpts().features.Enable( Fortran::common::LanguageFeature::OpenMP); + + if (args.hasArg(clang::driver::options::OPT_fopenmp_is_device)) { + res.getLangOpts().OpenMPIsDevice = 1; + } } // -pedantic |