[PATCH 2/5] Triple: Add AMDHSA operating system type

Tom Stellard thomas.stellard at amd.com
Thu Nov 6 13:16:15 PST 2014


This operating system type represents the AMD HSA runtime,
and will be required by the R600 backend in order to generate
correct code for this runtime.
---
 include/llvm/ADT/Triple.h | 3 ++-
 lib/Support/Triple.cpp    | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/llvm/ADT/Triple.h b/include/llvm/ADT/Triple.h
index c1b7882..b46bce8 100644
--- a/include/llvm/ADT/Triple.h
+++ b/include/llvm/ADT/Triple.h
@@ -138,7 +138,8 @@ public:
     Bitrig,
     AIX,
     CUDA,       // NVIDIA CUDA
-    NVCL        // NVIDIA OpenCL
+    NVCL,       // NVIDIA OpenCL
+    AMDHSA      // AMD HSA Runtime
   };
   enum EnvironmentType {
     UnknownEnvironment,
diff --git a/lib/Support/Triple.cpp b/lib/Support/Triple.cpp
index c9fc785..dbcebe8 100644
--- a/lib/Support/Triple.cpp
+++ b/lib/Support/Triple.cpp
@@ -157,6 +157,7 @@ const char *Triple::getOSTypeName(OSType Kind) {
   case AIX: return "aix";
   case CUDA: return "cuda";
   case NVCL: return "nvcl";
+  case AMDHSA: return "amdhsa";
   }
 
   llvm_unreachable("Invalid OSType");
@@ -311,6 +312,7 @@ static Triple::OSType parseOS(StringRef OSName) {
     .StartsWith("aix", Triple::AIX)
     .StartsWith("cuda", Triple::CUDA)
     .StartsWith("nvcl", Triple::NVCL)
+    .StartsWith("amdhsa", Triple::AMDHSA)
     .Default(Triple::UnknownOS);
 }
 
-- 
1.8.5.5




More information about the llvm-commits mailing list