Triple: Add AMDHSA operating system type
authorTom Stellard <thomas.stellard@amd.com>
Tue, 2 Dec 2014 16:45:47 +0000 (16:45 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Tue, 2 Dec 2014 16:45:47 +0000 (16:45 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223124 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/Triple.h
lib/Support/Triple.cpp

index 107ba7364df383d3c45a51ffdb764691bba6531b..0932040ede7ae8f033f861297db5015938cbcc18 100644 (file)
@@ -138,7 +138,8 @@ public:
     Bitrig,
     AIX,
     CUDA,       // NVIDIA CUDA
-    NVCL        // NVIDIA OpenCL
+    NVCL,       // NVIDIA OpenCL
+    AMDHSA      // AMD HSA Runtime
   };
   enum EnvironmentType {
     UnknownEnvironment,
index 4a4773e2f7e7e6866da576e122e0049e3ae04037..64cd6e73e9e4ec520b8e3e4071ac66e19e5c53f7 100644 (file)
@@ -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");
@@ -345,6 +346,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);
 }