[llvm] r258639 - [CUDA] Add Target::isNVPTX().
Justin Lebar via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 23 13:12:22 PST 2016
Author: jlebar
Date: Sat Jan 23 15:12:22 2016
New Revision: 258639
URL: http://llvm.org/viewvc/llvm-project?rev=258639&view=rev
Log:
[CUDA] Add Target::isNVPTX().
Summary: Helper so we don't have to enumerate nvptx && nvptx64 everywhere.
Reviewers: echristo
Subscribers: llvm-commits, jhen, tra
Differential Revision: http://reviews.llvm.org/D16494
Modified:
llvm/trunk/include/llvm/ADT/Triple.h
Modified: llvm/trunk/include/llvm/ADT/Triple.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Triple.h?rev=258639&r1=258638&r2=258639&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/Triple.h (original)
+++ llvm/trunk/include/llvm/ADT/Triple.h Sat Jan 23 15:12:22 2016
@@ -546,6 +546,11 @@ public:
/// 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
/// @{
More information about the llvm-commits
mailing list