[PATCH] D79449: [CUDA] Make NVVM builtins available with CUDA-11 & PTX6.5

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 5 15:08:49 PDT 2020


tra updated this revision to Diff 262236.
tra added a comment.

Test that the builtins work all the way to sm_80/ptx65


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79449

Files:
  clang/include/clang/Basic/BuiltinsNVPTX.def
  clang/test/CodeGen/builtins-nvptx-ptx60.cu


Index: clang/test/CodeGen/builtins-nvptx-ptx60.cu
===================================================================
--- clang/test/CodeGen/builtins-nvptx-ptx60.cu
+++ clang/test/CodeGen/builtins-nvptx-ptx60.cu
@@ -2,6 +2,10 @@
 // RUN:            -fcuda-is-device -target-feature +ptx60 \
 // RUN:            -S -emit-llvm -o - -x cuda %s \
 // RUN:   | FileCheck -check-prefix=CHECK %s
+// RUN: %clang_cc1 -triple nvptx64-unknown-unknown -target-cpu sm_80 \
+// RUN:            -fcuda-is-device -target-feature +ptx65 \
+// RUN:            -S -emit-llvm -o - -x cuda %s \
+// RUN:   | FileCheck -check-prefix=CHECK %s
 // RUN: %clang_cc1 -triple nvptx-unknown-unknown -target-cpu sm_60 \
 // RUN:   -fcuda-is-device -S -o /dev/null -x cuda -verify %s
 
Index: clang/include/clang/Basic/BuiltinsNVPTX.def
===================================================================
--- clang/include/clang/Basic/BuiltinsNVPTX.def
+++ clang/include/clang/Basic/BuiltinsNVPTX.def
@@ -31,7 +31,9 @@
 #pragma push_macro("PTX61")
 #pragma push_macro("PTX63")
 #pragma push_macro("PTX64")
-#define PTX64 "ptx64"
+#pragma push_macro("PTX65")
+#define PTX65 "ptx65"
+#define PTX64 "ptx64|" PTX65
 #define PTX63 "ptx63|" PTX64
 #define PTX61 "ptx61|" PTX63
 #define PTX60 "ptx60|" PTX61
@@ -725,3 +727,4 @@
 #pragma pop_macro("PTX61")
 #pragma pop_macro("PTX63")
 #pragma pop_macro("PTX64")
+#pragma pop_macro("PTX65")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79449.262236.patch
Type: text/x-patch
Size: 1403 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200505/c4f33033/attachment.bin>


More information about the cfe-commits mailing list