[PATCH] D24735: Triple: Add opencl environment type
Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 22 17:51:45 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL282218: Triple: Add opencl environment type (authored by tstellar).
Changed prior to commit:
https://reviews.llvm.org/D24735?vs=71846&id=72230#toc
Repository:
rL LLVM
https://reviews.llvm.org/D24735
Files:
llvm/trunk/include/llvm/ADT/Triple.h
llvm/trunk/lib/Support/Triple.cpp
llvm/trunk/unittests/ADT/TripleTest.cpp
Index: llvm/trunk/include/llvm/ADT/Triple.h
===================================================================
--- llvm/trunk/include/llvm/ADT/Triple.h
+++ llvm/trunk/include/llvm/ADT/Triple.h
@@ -191,7 +191,8 @@
Cygnus,
AMDOpenCL,
CoreCLR,
- LastEnvironmentType = CoreCLR
+ OpenCL,
+ LastEnvironmentType = OpenCL
};
enum ObjectFormatType {
UnknownObjectFormat,
Index: llvm/trunk/lib/Support/Triple.cpp
===================================================================
--- llvm/trunk/lib/Support/Triple.cpp
+++ llvm/trunk/lib/Support/Triple.cpp
@@ -217,6 +217,7 @@
case Cygnus: return "cygnus";
case AMDOpenCL: return "amdopencl";
case CoreCLR: return "coreclr";
+ case OpenCL: return "opencl";
}
llvm_unreachable("Invalid EnvironmentType!");
@@ -484,6 +485,7 @@
.StartsWith("cygnus", Triple::Cygnus)
.StartsWith("amdopencl", Triple::AMDOpenCL)
.StartsWith("coreclr", Triple::CoreCLR)
+ .StartsWith("opencl", Triple::OpenCL)
.Default(Triple::UnknownEnvironment);
}
Index: llvm/trunk/unittests/ADT/TripleTest.cpp
===================================================================
--- llvm/trunk/unittests/ADT/TripleTest.cpp
+++ llvm/trunk/unittests/ADT/TripleTest.cpp
@@ -248,6 +248,12 @@
EXPECT_EQ(Triple::AMDHSA, T.getOS());
EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
+ T = Triple("amdgcn-amd-amdhsa-opencl");
+ EXPECT_EQ(Triple::amdgcn, T.getArch());
+ EXPECT_EQ(Triple::AMD, T.getVendor());
+ EXPECT_EQ(Triple::AMDHSA, T.getOS());
+ EXPECT_EQ(Triple::OpenCL, T.getEnvironment());
+
T = Triple("huh");
EXPECT_EQ(Triple::UnknownArch, T.getArch());
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24735.72230.patch
Type: text/x-patch
Size: 1670 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160923/053b1874/attachment.bin>
More information about the llvm-commits
mailing list