Skip to content

Commit

Permalink
[SYCL] Added SYCLDevice env to triple.
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Lazarev <vladimir.lazarev@intel.com>
  • Loading branch information
vladimirlaz committed Jan 22, 2019
1 parent 1e0b496 commit 79a49d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions llvm/include/llvm/ADT/Triple.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ class Triple {
Cygnus,
CoreCLR,
Simulator, // Simulator variants of other systems, e.g., Apple's iOS
SYCLDevice,
LastEnvironmentType = Simulator
};
enum ObjectFormatType {
Expand Down Expand Up @@ -480,6 +481,10 @@ class Triple {
return getEnvironment() == Triple::Simulator;
}

bool isSYCLDeviceEnvironment() const {
return getEnvironment() == Triple::SYCLDevice;
}

bool isOSNetBSD() const {
return getOS() == Triple::NetBSD;
}
Expand Down
2 changes: 2 additions & 0 deletions llvm/lib/Support/Triple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) {
case Cygnus: return "cygnus";
case CoreCLR: return "coreclr";
case Simulator: return "simulator";
case SYCLDevice: return "sycldevice";
}

llvm_unreachable("Invalid EnvironmentType!");
Expand Down Expand Up @@ -533,6 +534,7 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
.StartsWith("cygnus", Triple::Cygnus)
.StartsWith("coreclr", Triple::CoreCLR)
.StartsWith("simulator", Triple::Simulator)
.StartsWith("sycldevice", Triple::SYCLDevice)
.Default(Triple::UnknownEnvironment);
}

Expand Down

0 comments on commit 79a49d6

Please sign in to comment.