aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver/ToolChains/Cuda.h
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Driver/ToolChains/Cuda.h')
-rw-r--r--clang/lib/Driver/ToolChains/Cuda.h56
1 files changed, 1 insertions, 55 deletions
diff --git a/clang/lib/Driver/ToolChains/Cuda.h b/clang/lib/Driver/ToolChains/Cuda.h
index 259eda6..8aeba53 100644
--- a/clang/lib/Driver/ToolChains/Cuda.h
+++ b/clang/lib/Driver/ToolChains/Cuda.h
@@ -11,6 +11,7 @@
#include "clang/Basic/Cuda.h"
#include "clang/Driver/Action.h"
+#include "clang/Driver/CudaInstallationDetector.h"
#include "clang/Driver/Multilib.h"
#include "clang/Driver/Tool.h"
#include "clang/Driver/ToolChain.h"
@@ -22,61 +23,6 @@
namespace clang {
namespace driver {
-
-/// A class to find a viable CUDA installation
-class CudaInstallationDetector {
-private:
- const Driver &D;
- bool IsValid = false;
- CudaVersion Version = CudaVersion::UNKNOWN;
- std::string InstallPath;
- std::string BinPath;
- std::string LibDevicePath;
- std::string IncludePath;
- llvm::StringMap<std::string> LibDeviceMap;
-
- // CUDA architectures for which we have raised an error in
- // CheckCudaVersionSupportsArch.
- mutable std::bitset<(int)OffloadArch::LAST> ArchsWithBadVersion;
-
-public:
- CudaInstallationDetector(const Driver &D, const llvm::Triple &HostTriple,
- const llvm::opt::ArgList &Args);
-
- void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs,
- llvm::opt::ArgStringList &CC1Args) const;
-
- /// Emit an error if Version does not support the given Arch.
- ///
- /// If either Version or Arch is unknown, does not emit an error. Emits at
- /// most one error per Arch.
- void CheckCudaVersionSupportsArch(OffloadArch Arch) const;
-
- /// Check whether we detected a valid Cuda install.
- bool isValid() const { return IsValid; }
- /// Print information about the detected CUDA installation.
- void print(raw_ostream &OS) const;
-
- /// Get the detected Cuda install's version.
- CudaVersion version() const {
- return Version == CudaVersion::NEW ? CudaVersion::PARTIALLY_SUPPORTED
- : Version;
- }
- /// Get the detected Cuda installation path.
- StringRef getInstallPath() const { return InstallPath; }
- /// Get the detected path to Cuda's bin directory.
- StringRef getBinPath() const { return BinPath; }
- /// Get the detected Cuda Include path.
- StringRef getIncludePath() const { return IncludePath; }
- /// Get the detected Cuda device library path.
- StringRef getLibDevicePath() const { return LibDevicePath; }
- /// Get libdevice file for given architecture
- std::string getLibDeviceFile(StringRef Gpu) const {
- return LibDeviceMap.lookup(Gpu);
- }
- void WarnIfUnsupportedVersion() const;
-};
-
namespace tools {
namespace NVPTX {