[PATCH] D16494: [CUDA] Add Target::isNVPTX().

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 22 17:05:15 PST 2016


jlebar created this revision.
jlebar added a reviewer: tra.
jlebar added subscribers: echristo, jhen, llvm-commits.

Helper so we don't have to enumerate nvptx && nvptx64 everywhere.

http://reviews.llvm.org/D16494

Files:
  include/llvm/ADT/Triple.h

Index: include/llvm/ADT/Triple.h
===================================================================
--- include/llvm/ADT/Triple.h
+++ include/llvm/ADT/Triple.h
@@ -546,6 +546,11 @@
   /// Tests whether the target is Android
   bool isAndroid() const { return getEnvironment() == Triple::Android; }
 
+  /// Tests whether the target is NVPTX (32- or 64-bit).
+  bool isNVPTX() const {
+    return getArch() == Triple::nvptx || getArch() == Triple::nvptx64;
+  }
+
   /// @}
   /// @name Mutators
   /// @{


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16494.45772.patch
Type: text/x-patch
Size: 506 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160123/0740da2a/attachment.bin>


More information about the llvm-commits mailing list