[PATCH] D74571: [OpenMP][CUDA] Add CUDA 10.2 support

Kelvin Li via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 13 11:10:41 PST 2020


kkwli0 created this revision.
kkwli0 added reviewers: jdoerfert, ABataev, JonChesterfield, tra.
Herald added a subscriber: guansong.
kkwli0 edited the summary of this revision.

This patch is to add CUDA 10.2 support.  It essentially removes the warning message regarding the CUDA 10.2 toolkit not being supported.  This warning causes libomp not being built as the LIBOMP_HAVE_VERSION_SCRIPT_FLAG test returns false.

Question to reviewers and others:
Do we also want to put this patch to 10.0.0 RC2 in order to avoid bug 44587 <https://bugs.llvm.org/show_bug.cgi?id=44587> which requires >9.0.1 to be the build compiler?


https://reviews.llvm.org/D74571

Files:
  clang/include/clang/Basic/Cuda.h
  clang/lib/Basic/Cuda.cpp
  clang/lib/Driver/ToolChains/Cuda.cpp


Index: clang/lib/Driver/ToolChains/Cuda.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Cuda.cpp
+++ clang/lib/Driver/ToolChains/Cuda.cpp
@@ -634,6 +634,7 @@
   // back-end.
   const char *PtxFeature = nullptr;
   switch(CudaInstallation.version()) {
+    case CudaVersion::CUDA_102:
     case CudaVersion::CUDA_101:
       PtxFeature = "+ptx64";
       break;
Index: clang/lib/Basic/Cuda.cpp
===================================================================
--- clang/lib/Basic/Cuda.cpp
+++ clang/lib/Basic/Cuda.cpp
@@ -28,6 +28,8 @@
     return "10.0";
   case CudaVersion::CUDA_101:
     return "10.1";
+  case CudaVersion::CUDA_102:
+    return "10.2";
   }
   llvm_unreachable("invalid enum");
 }
@@ -42,6 +44,7 @@
       .Case("9.2", CudaVersion::CUDA_92)
       .Case("10.0", CudaVersion::CUDA_100)
       .Case("10.1", CudaVersion::CUDA_101)
+      .Case("10.2", CudaVersion::CUDA_102)
       .Default(CudaVersion::UNKNOWN);
 }
 
@@ -382,6 +385,8 @@
     return CudaVersion::CUDA_100;
   case 101:
     return CudaVersion::CUDA_101;
+  case 102:
+    return CudaVersion::CUDA_102;
   default:
     return CudaVersion::UNKNOWN;
   }
Index: clang/include/clang/Basic/Cuda.h
===================================================================
--- clang/include/clang/Basic/Cuda.h
+++ clang/include/clang/Basic/Cuda.h
@@ -27,7 +27,8 @@
   CUDA_92,
   CUDA_100,
   CUDA_101,
-  LATEST = CUDA_101,
+  CUDA_102,
+  LATEST = CUDA_102,
 };
 const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74571.244473.patch
Type: text/x-patch
Size: 1573 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200213/37c1026a/attachment.bin>


More information about the cfe-commits mailing list