summaryrefslogtreecommitdiffstats
path: root/lib/Driver/ToolChains/Cuda.cpp
diff options
context:
space:
mode:
authorGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>2017-08-11 15:46:22 +0000
committerGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>2017-08-11 15:46:22 +0000
commit58f82409fac6019a867e3b1bc5f6335e29c51b94 (patch)
treebdf669f71c702e440d89df3b983334d2f3157423 /lib/Driver/ToolChains/Cuda.cpp
parent5338d61339bfe345bfdb8cf678b79e55fd8c8599 (diff)
[OpenMP] Enable previously successful offloading tests.
Create a separate test file to contain all tests for OpenMP offloading to GPUs. Make libdevice checking more robust by accounting for the case in which no libdevice is found. This changes are in connrection with diff: D29660 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310718 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChains/Cuda.cpp')
-rw-r--r--lib/Driver/ToolChains/Cuda.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Driver/ToolChains/Cuda.cpp b/lib/Driver/ToolChains/Cuda.cpp
index 00715a7a24..49a2302865 100644
--- a/lib/Driver/ToolChains/Cuda.cpp
+++ b/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;
}