gtbercea created this revision.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D37914

Files:
  lib/Driver/ToolChains/Cuda.cpp


Index: lib/Driver/ToolChains/Cuda.cpp
===================================================================
--- lib/Driver/ToolChains/Cuda.cpp
+++ lib/Driver/ToolChains/Cuda.cpp
@@ -502,6 +502,12 @@
   std::string LibDeviceFile = CudaInstallation.getLibDeviceFile(GpuArch);
 
   if (LibDeviceFile.empty()) {
+    if ((DeviceOffloadingKind == Action::OFK_OpenMP &&
+         DriverArgs.hasArg(options::OPT_S)) ||
+        (DeviceOffloadingKind == Action::OFK_OpenMP &&
+         DriverArgs.hasArg(options::OPT_c)))
+      return;
+
     getDriver().Diag(diag::err_drv_no_cuda_libdevice) << GpuArch;
     return;
   }


Index: lib/Driver/ToolChains/Cuda.cpp
===================================================================
--- lib/Driver/ToolChains/Cuda.cpp
+++ lib/Driver/ToolChains/Cuda.cpp
@@ -502,6 +502,12 @@
   std::string LibDeviceFile = CudaInstallation.getLibDeviceFile(GpuArch);
 
   if (LibDeviceFile.empty()) {
+    if ((DeviceOffloadingKind == Action::OFK_OpenMP &&
+         DriverArgs.hasArg(options::OPT_S)) ||
+        (DeviceOffloadingKind == Action::OFK_OpenMP &&
+         DriverArgs.hasArg(options::OPT_c)))
+      return;
+
     getDriver().Diag(diag::err_drv_no_cuda_libdevice) << GpuArch;
     return;
   }
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to