Skip to content

Commit 79a49d6

Browse files
committed
[SYCL] Added SYCLDevice env to triple.
Signed-off-by: Vladimir Lazarev <[email protected]>
1 parent 1e0b496 commit 79a49d6

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

llvm/include/llvm/ADT/Triple.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ class Triple {
211211
Cygnus,
212212
CoreCLR,
213213
Simulator, // Simulator variants of other systems, e.g., Apple's iOS
214+
SYCLDevice,
214215
LastEnvironmentType = Simulator
215216
};
216217
enum ObjectFormatType {
@@ -480,6 +481,10 @@ class Triple {
480481
return getEnvironment() == Triple::Simulator;
481482
}
482483

484+
bool isSYCLDeviceEnvironment() const {
485+
return getEnvironment() == Triple::SYCLDevice;
486+
}
487+
483488
bool isOSNetBSD() const {
484489
return getOS() == Triple::NetBSD;
485490
}

llvm/lib/Support/Triple.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) {
237237
case Cygnus: return "cygnus";
238238
case CoreCLR: return "coreclr";
239239
case Simulator: return "simulator";
240+
case SYCLDevice: return "sycldevice";
240241
}
241242

242243
llvm_unreachable("Invalid EnvironmentType!");
@@ -533,6 +534,7 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
533534
.StartsWith("cygnus", Triple::Cygnus)
534535
.StartsWith("coreclr", Triple::CoreCLR)
535536
.StartsWith("simulator", Triple::Simulator)
537+
.StartsWith("sycldevice", Triple::SYCLDevice)
536538
.Default(Triple::UnknownEnvironment);
537539
}
538540

0 commit comments

Comments
 (0)