[Openmp-commits] [PATCH] D97012: [OpenMP] Fix nvptx CUDA_VERSION conversion

Joel E. Denny via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Feb 19 08:17:44 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGef8b3b5ffd56: [OpenMP] Fix nvptx CUDA_VERSION conversion (authored by jdenny).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97012/new/

https://reviews.llvm.org/D97012

Files:
  openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt


Index: openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
===================================================================
--- openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
+++ openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
@@ -172,7 +172,15 @@
     list(GET ptx_feature_list ${itr} ptx_num)
     set(cuda_flags ${sm_flags})
     list(APPEND cuda_flags -Xclang -target-feature -Xclang +ptx${ptx_num})
-    list(APPEND cuda_flags "-DCUDA_VERSION=${cuda_version}00")
+    if("${cuda_version}" MATCHES "^([0-9]+)([0-9])$")
+      set(cuda_version_major ${CMAKE_MATCH_1})
+      set(cuda_version_minor ${CMAKE_MATCH_2})
+    else()
+      libomptarget_error_say(
+        "Unrecognized CUDA version format: ${cuda_version}")
+    endif()
+    list(APPEND cuda_flags
+      "-DCUDA_VERSION=${cuda_version_major}0${cuda_version_minor}0")
 
     set(bc_files "")
     foreach(src ${cuda_src_files})


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97012.324989.patch
Type: text/x-patch
Size: 907 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210219/1830abdb/attachment.bin>


More information about the Openmp-commits mailing list