summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains/Cuda.cpp
diff options
context:
space:
mode:
authorGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>2017-09-26 15:36:20 +0000
committerGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>2017-09-26 15:36:20 +0000
commit5a3608ccfaa95dab801df9e651967168d8555719 (patch)
tree70bea5819f1f4a56f1c1e32dd7a24c50b433b605 /clang/lib/Driver/ToolChains/Cuda.cpp
parent9801d7fd9ff3dcecddbfc68b17951a4286b08703 (diff)
downloadbcm5719-llvm-5a3608ccfaa95dab801df9e651967168d8555719.tar.gz
bcm5719-llvm-5a3608ccfaa95dab801df9e651967168d8555719.zip
[OpenMP] Don't throw cudalib not found error if only front-end is required.
Summary: If we only use the compiler front-end, do not throw an error about the cuda device library not being found. This allows the front-end to be run on systems where no Cuda installation is found. Reviewers: Hahnfeld, ABataev, carlo.bertolli, caomhin, tra Reviewed By: tra Subscribers: hfinkel, tra, cfe-commits Differential Revision: https://reviews.llvm.org/D37914 llvm-svn: 314217
Diffstat (limited to 'clang/lib/Driver/ToolChains/Cuda.cpp')
-rw-r--r--clang/lib/Driver/ToolChains/Cuda.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains/Cuda.cpp b/clang/lib/Driver/ToolChains/Cuda.cpp
index 6378735a876..349f9e4f51a 100644
--- a/clang/lib/Driver/ToolChains/Cuda.cpp
+++ b/clang/lib/Driver/ToolChains/Cuda.cpp
@@ -500,6 +500,10 @@ void CudaToolChain::addClangTargetOptions(
std::string LibDeviceFile = CudaInstallation.getLibDeviceFile(GpuArch);
if (LibDeviceFile.empty()) {
+ if (DeviceOffloadingKind == Action::OFK_OpenMP &&
+ DriverArgs.hasArg(options::OPT_S))
+ return;
+
getDriver().Diag(diag::err_drv_no_cuda_libdevice) << GpuArch;
return;
}
OpenPOWER on IntegriCloud