[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

llvm-svn: 258639
This commit is contained in:
Justin Lebar 2016-01-23 21:12:22 +00:00
parent 3a5f5798a1
commit 561d5a1758
1 changed files with 5 additions and 0 deletions

View File

@ -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
/// @{