summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains/Cuda.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Driver/ToolChains/Cuda.cpp')
-rw-r--r--clang/lib/Driver/ToolChains/Cuda.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains/Cuda.cpp b/clang/lib/Driver/ToolChains/Cuda.cpp
index 00715a7a244..49a23028659 100644
--- a/clang/lib/Driver/ToolChains/Cuda.cpp
+++ b/clang/lib/Driver/ToolChains/Cuda.cpp
@@ -153,6 +153,19 @@ CudaInstallationDetector::CudaInstallationDetector(
}
}
+ // This code prevents IsValid from being set when
+ // no libdevice has been found.
+ bool allEmpty = true;
+ std::string LibDeviceFile;
+ for (auto key : LibDeviceMap.keys()) {
+ LibDeviceFile = LibDeviceMap.lookup(key);
+ if (!LibDeviceFile.empty())
+ allEmpty = false;
+ }
+
+ if (allEmpty)
+ continue;
+
IsValid = true;
break;
}
OpenPOWER on IntegriCloud