]> granicus.if.org Git - clang/commitdiff
Reverted r248408 "[CUDA] Added CUDA installation detector class."
authorArtem Belevich <tra@google.com>
Wed, 23 Sep 2015 18:28:30 +0000 (18:28 +0000)
committerArtem Belevich <tra@google.com>
Wed, 23 Sep 2015 18:28:30 +0000 (18:28 +0000)
because included test fails on some platforms.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248413 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/Options.td
lib/Driver/ToolChains.cpp
lib/Driver/ToolChains.h
test/Driver/Inputs/CUDA/usr/local/cuda/include/.keep [deleted file]
test/Driver/Inputs/CUDA/usr/local/cuda/lib/.keep [deleted file]
test/Driver/Inputs/CUDA/usr/local/cuda/lib64/.keep [deleted file]
test/Driver/Inputs/CUDA/usr/local/cuda/nvvm/libdevice/.keep [deleted file]
test/Driver/cuda-detect.cu [deleted file]

index 018855a9745dbe85b6d8de7399a8d0b9f8788887..ebc6f3cb5ea2f2383841b9fecc77e668eef0acb0 100644 (file)
@@ -359,8 +359,6 @@ def cuda_gpu_arch_EQ : Joined<["--"], "cuda-gpu-arch=">,
   Flags<[DriverOption, HelpHidden]>, HelpText<"CUDA GPU architecture">;
 def cuda_host_only : Flag<["--"], "cuda-host-only">,
   HelpText<"Do host-side CUDA compilation only">;
-def cuda_path_EQ : Joined<["--"], "cuda-path=">, Group<i_Group>,
-  HelpText<"CUDA installation path">;
 def dA : Flag<["-"], "dA">, Group<d_Group>;
 def dD : Flag<["-"], "dD">, Group<d_Group>, Flags<[CC1Option]>,
   HelpText<"Print macro definitions in -E mode in addition to normal output">;
index 8d12f2d0fb0eea3b746b2f614b3ba47a6c01406e..b5edcf9f5ce11e2d96fb420648e55adf1f768eb4 100644 (file)
@@ -1482,48 +1482,6 @@ bool Generic_GCC::GCCInstallationDetector::getBiarchSibling(Multilib &M) const {
     BiarchTripleAliases.push_back(BiarchTriple.str());
 }
 
-// \brief -- try common CUDA installation paths looking for files we need for
-// CUDA compilation.
-
-void
-Generic_GCC::CudaInstallationDetector::init(const Driver &D,
-                                            const llvm::Triple &TargetTriple,
-                                            const llvm::opt::ArgList &Args) {
-  SmallVector<StringRef, 4> CudaPathCandidates;
-
-  if (Args.hasArg(options::OPT_cuda_path_EQ))
-    CudaPathCandidates.push_back(
-        Args.getLastArgValue(options::OPT_cuda_path_EQ));
-  else {
-    CudaPathCandidates.push_back(D.SysRoot + "/usr/local/cuda");
-    CudaPathCandidates.push_back(D.SysRoot + "/usr/local/cuda-7.0");
-  }
-
-  for (const auto CudaPath : CudaPathCandidates) {
-    if (CudaPath.empty() || !llvm::sys::fs::exists(CudaPath))
-      continue;
-
-    CudaInstallPath = CudaPath;
-    CudaIncludePath = CudaInstallPath + "/include";
-    CudaLibDevicePath = CudaInstallPath + "/nvvm/libdevice";
-    CudaLibPath =
-        CudaInstallPath + (TargetTriple.isArch64Bit() ? "/lib64" : "/lib");
-
-    if (!(llvm::sys::fs::exists(CudaIncludePath) &&
-          llvm::sys::fs::exists(CudaLibPath) &&
-          llvm::sys::fs::exists(CudaLibDevicePath)))
-      continue;
-
-    IsValid = true;
-    break;
-  }
-}
-
-void Generic_GCC::CudaInstallationDetector::print(raw_ostream &OS) const {
-  if (isValid())
-    OS << "Found CUDA installation: " << CudaInstallPath << "\n";
-}
-
 namespace {
 // Filter to remove Multilibs that don't exist as a suffix to Path
 class FilterNonExistent {
@@ -2095,7 +2053,7 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
 
 Generic_GCC::Generic_GCC(const Driver &D, const llvm::Triple &Triple,
                          const ArgList &Args)
-    : ToolChain(D, Triple, Args), GCCInstallation(), CudaInstallation() {
+    : ToolChain(D, Triple, Args), GCCInstallation() {
   getProgramPaths().push_back(getDriver().getInstalledDir());
   if (getDriver().getInstalledDir() != getDriver().Dir)
     getProgramPaths().push_back(getDriver().Dir);
@@ -2127,7 +2085,6 @@ Tool *Generic_GCC::buildLinker() const { return new tools::gcc::Linker(*this); }
 void Generic_GCC::printVerboseInfo(raw_ostream &OS) const {
   // Print the information about how we detected the GCC installation.
   GCCInstallation.print(OS);
-  CudaInstallation.print(OS);
 }
 
 bool Generic_GCC::IsUnwindTablesDefault() const {
@@ -3304,7 +3261,6 @@ static StringRef getOSLibDir(const llvm::Triple &Triple, const ArgList &Args) {
 Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
     : Generic_ELF(D, Triple, Args) {
   GCCInstallation.init(D, Triple, Args);
-  CudaInstallation.init(D, Triple, Args);
   Multilibs = GCCInstallation.getMultilibs();
   llvm::Triple::ArchType Arch = Triple.getArch();
   std::string SysRoot = computeSysRoot();
index e63f3363d175e8cc46087bad66b780b222264529..f14fc3e78e502b354a540828a86b0964a3d69256 100644 (file)
@@ -157,38 +157,6 @@ public:
 protected:
   GCCInstallationDetector GCCInstallation;
 
-  // \brief A class to find a viable CUDA installation
-
-  class CudaInstallationDetector {
-    bool IsValid;
-    std::string CudaInstallPath;
-    std::string CudaLibPath;
-    std::string CudaLibDevicePath;
-    std::string CudaIncludePath;
-
-  public:
-    CudaInstallationDetector() : IsValid(false) {}
-    void init(const Driver &D, const llvm::Triple &TargetTriple,
-              const llvm::opt::ArgList &Args);
-
-    /// \brief Check whether we detected a valid Cuda install.
-    bool isValid() const { return IsValid; }
-    /// \brief Print information about the detected CUDA installation.
-    void print(raw_ostream &OS) const;
-
-    /// \brief Get the detected Cuda installation path.
-    StringRef getInstallPath() const { return CudaInstallPath; }
-    /// \brief Get the detected Cuda Include path.
-    StringRef getIncludePath() const { return CudaIncludePath; }
-    /// \brief Get the detected Cuda library path.
-    StringRef getLibPath() const { return CudaLibPath; }
-    /// \brief Get the detected Cuda device library path.
-    StringRef getLibDevicePath() const { return CudaLibDevicePath; }
-    /// \brief Get libdevice file for given architecture
-  };
-
-  CudaInstallationDetector CudaInstallation;
-
 public:
   Generic_GCC(const Driver &D, const llvm::Triple &Triple,
               const llvm::opt::ArgList &Args);
diff --git a/test/Driver/Inputs/CUDA/usr/local/cuda/include/.keep b/test/Driver/Inputs/CUDA/usr/local/cuda/include/.keep
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Driver/Inputs/CUDA/usr/local/cuda/lib/.keep b/test/Driver/Inputs/CUDA/usr/local/cuda/lib/.keep
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Driver/Inputs/CUDA/usr/local/cuda/lib64/.keep b/test/Driver/Inputs/CUDA/usr/local/cuda/lib64/.keep
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Driver/Inputs/CUDA/usr/local/cuda/nvvm/libdevice/.keep b/test/Driver/Inputs/CUDA/usr/local/cuda/nvvm/libdevice/.keep
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/test/Driver/cuda-detect.cu b/test/Driver/cuda-detect.cu
deleted file mode 100644 (file)
index 7007698..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: %clang -v --sysroot=/tmp/no-cuda-there 2>&1 | FileCheck %s -check-prefix NOCUDA
-// RUN: %clang -v --sysroot=%S/Inputs/CUDA 2>&1 | FileCheck %s
-// RUN: %clang -v --cuda-path=%S/Inputs/CUDA/usr/local/cuda 2>&1 | FileCheck %s
-
-// CHECK: Found CUDA installation: {{.*}}/Inputs/CUDA/usr/local/cuda
-// NOCUDA-NOT: Found CUDA installation: