]> granicus.if.org Git - clang/commitdiff
[CUDA] Allow sm_50,52,53 GPUs
authorArtem Belevich <tra@google.com>
Thu, 19 May 2016 17:47:47 +0000 (17:47 +0000)
committerArtem Belevich <tra@google.com>
Thu, 19 May 2016 17:47:47 +0000 (17:47 +0000)
LLVM accepts them since r233575.

Differential Revision: http://reviews.llvm.org/D20405

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

lib/Basic/Targets.cpp
lib/Driver/ToolChains.cpp
test/CodeGen/nvptx-cpus.c

index b63eac907ebd643d5721971703257386b20a2a99..c205356d414549e8518c9b1c56602c0bf4b1d937 100644 (file)
@@ -1689,6 +1689,9 @@ class NVPTXTargetInfo : public TargetInfo {
     GK_SM30,
     GK_SM35,
     GK_SM37,
+    GK_SM50,
+    GK_SM52,
+    GK_SM53,
   } GPU;
 
 public:
@@ -1787,6 +1790,15 @@ public:
       case GK_SM37:
         CUDAArchCode = "370";
         break;
+      case GK_SM50:
+        CUDAArchCode = "500";
+        break;
+      case GK_SM52:
+        CUDAArchCode = "520";
+        break;
+      case GK_SM53:
+        CUDAArchCode = "530";
+        break;
       default:
         llvm_unreachable("Unhandled target CPU");
       }
@@ -1836,6 +1848,9 @@ public:
               .Case("sm_30", GK_SM30)
               .Case("sm_35", GK_SM35)
               .Case("sm_37", GK_SM37)
+              .Case("sm_50", GK_SM50)
+              .Case("sm_52", GK_SM52)
+              .Case("sm_53", GK_SM53)
               .Default(GK_NONE);
 
     return GPU != GK_NONE;
index a46cb08003cc94897308faffde67de5b0f794fb7..556d24084445212eecd754ca6af5b5476f76ca70 100644 (file)
@@ -1750,6 +1750,10 @@ void Generic_GCC::CudaInstallationDetector::init(
       } else if (GpuArch == "compute_35") {
         CudaLibDeviceMap["sm_35"] = FilePath;
         CudaLibDeviceMap["sm_37"] = FilePath;
+      } else if (GpuArch == "compute_50") {
+        CudaLibDeviceMap["sm_50"] = FilePath;
+        CudaLibDeviceMap["sm_52"] = FilePath;
+        CudaLibDeviceMap["sm_53"] = FilePath;
       }
     }
 
index 015f52946ef7333bfc64d70d9f6da57c25c81eca..76c55c0edf63c7eb17c35b663bd577be8710eeaa 100644 (file)
@@ -3,6 +3,9 @@
 // RUN: %clang_cc1 -triple nvptx-unknown-unknown -target-cpu sm_30 -O3 -S -o %t %s -emit-llvm
 // RUN: %clang_cc1 -triple nvptx-unknown-unknown -target-cpu sm_35 -O3 -S -o %t %s -emit-llvm
 // RUN: %clang_cc1 -triple nvptx-unknown-unknown -target-cpu sm_37 -O3 -S -o %t %s -emit-llvm
+// RUN: %clang_cc1 -triple nvptx-unknown-unknown -target-cpu sm_50 -O3 -S -o %t %s -emit-llvm
+// RUN: %clang_cc1 -triple nvptx-unknown-unknown -target-cpu sm_52 -O3 -S -o %t %s -emit-llvm
+// RUN: %clang_cc1 -triple nvptx-unknown-unknown -target-cpu sm_53 -O3 -S -o %t %s -emit-llvm
 
 // Make sure clang accepts all supported architectures.