Index: include/llvm/ADT/Triple.h =================================================================== --- include/llvm/ADT/Triple.h +++ include/llvm/ADT/Triple.h @@ -604,6 +604,12 @@ return getArch() == Triple::nvptx || getArch() == Triple::nvptx64; } + /// Tests whether the target is a GPU + bool isGPU() const { + return getArch() == Triple::nvptx || getArch() == Triple::nvptx64 || + getArch() == Triple::amdgcn; + } + /// Tests wether the target supports comdat bool supportsCOMDAT() const { return !isOSBinFormatMachO(); }