summaryrefslogtreecommitdiffstats
path: root/lib/Driver/ToolChains/Cuda.h
diff options
context:
space:
mode:
authorGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>2017-08-10 05:01:42 +0000
committerGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>2017-08-10 05:01:42 +0000
commit3685dbaf4a6514f55565fd952312d143945a6d49 (patch)
tree5f3eb9d318615b6995f1df1c1e2c7f16d2a021a9 /lib/Driver/ToolChains/Cuda.h
parent442874b97b7d00e027d2e95398e6b04a220c8d66 (diff)
[OpenMP] Provide a default GPU arch that is supported by
the underlying hardware. This fixes a bug triggered by diff: D29660 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310549 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChains/Cuda.h')
-rw-r--r--lib/Driver/ToolChains/Cuda.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Driver/ToolChains/Cuda.h b/lib/Driver/ToolChains/Cuda.h
index 1e30aa7270..9b3d6d70cd 100644
--- a/lib/Driver/ToolChains/Cuda.h
+++ b/lib/Driver/ToolChains/Cuda.h
@@ -76,6 +76,17 @@ public:
std::string getLibDeviceFile(StringRef Gpu) const {
return LibDeviceMap.lookup(Gpu);
}
+ /// \brief Get lowest available compute capability
+ /// for which a libdevice library exists.
+ std::string getLowestExistingArch() const {
+ std::string LibDeviceFile;
+ for (auto key : LibDeviceMap.keys()) {
+ LibDeviceFile = LibDeviceMap.lookup(key);
+ if (!LibDeviceFile.empty())
+ return key;
+ }
+ llvm_unreachable("no libdevice exists.");
+ }
};
namespace tools {