aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--flang/lib/Frontend/CompilerInvocation.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index 652b3d8..229695b 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -1139,22 +1139,16 @@ static bool parseOpenMPArgs(CompilerInvocation &res, llvm::opt::ArgList &args,
if (args.hasArg(clang::driver::options::OPT_no_offloadlib))
res.getLangOpts().NoGPULib = 1;
}
-
- switch (llvm::Triple(res.getTargetOpts().triple).getArch()) {
- case llvm::Triple::nvptx:
- case llvm::Triple::nvptx64:
- case llvm::Triple::amdgcn:
+ if (llvm::Triple(res.getTargetOpts().triple).isGPU()) {
if (!res.getLangOpts().OpenMPIsTargetDevice) {
const unsigned diagID = diags.getCustomDiagID(
clang::DiagnosticsEngine::Error,
- "OpenMP AMDGPU/NVPTX is only prepared to deal with device code.");
+ "OpenMP GPU is only prepared to deal with device code.");
diags.Report(diagID);
}
res.getLangOpts().OpenMPIsGPU = 1;
- break;
- default:
+ } else {
res.getLangOpts().OpenMPIsGPU = 0;
- break;
}
// Get the OpenMP target triples if any.
@@ -1176,10 +1170,8 @@ static bool parseOpenMPArgs(CompilerInvocation &res, llvm::opt::ArgList &args,
if (tt.getArch() == llvm::Triple::UnknownArch ||
!(tt.getArch() == llvm::Triple::aarch64 || tt.isPPC() ||
tt.getArch() == llvm::Triple::systemz ||
- tt.getArch() == llvm::Triple::nvptx ||
- tt.getArch() == llvm::Triple::nvptx64 || tt.isAMDGCN() ||
tt.getArch() == llvm::Triple::x86 ||
- tt.getArch() == llvm::Triple::x86_64))
+ tt.getArch() == llvm::Triple::x86_64 || tt.isGPU()))
diags.Report(clang::diag::err_drv_invalid_omp_target)
<< arg->getValue(i);
else if (getArchPtrSize(t) != getArchPtrSize(tt))