summaryrefslogtreecommitdiffstats
path: root/clang/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
commit9c52574886001d7216ec09bf7363bd62f4706a29 (patch)
treee2839bd9f4e3b0eea5283d52ba5e9352d45859d7 /clang/lib/Driver/ToolChains/Cuda.cpp
parent169dae70a680cdfa1779148eb9cb643bb76c8b0e (diff)
downloadbcm5719-llvm-9c52574886001d7216ec09bf7363bd62f4706a29.tar.gz
bcm5719-llvm-9c52574886001d7216ec09bf7363bd62f4706a29.zip
[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 llvm-svn: 310718
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