[PATCH] D37914: [OpenMP] Don't throw cudalib not found error if only front-end is required.

Gheorghe-Teodor Bercea via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 15 11:43:17 PDT 2017


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;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37914.115441.patch
Type: text/x-patch
Size: 614 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170915/b5d3fbdf/attachment-0001.bin>


More information about the cfe-commits mailing list