[Parallel_libs-commits] [PATCH] D24240: [SE] Add getName method to Device class
Jason Henline via Parallel_libs-commits
parallel_libs-commits at lists.llvm.org
Wed Sep 7 15:34:49 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL280872: [SE] Add getName method to Device class (authored by jhen).
Changed prior to commit:
https://reviews.llvm.org/D24240?vs=70343&id=70610#toc
Repository:
rL LLVM
https://reviews.llvm.org/D24240
Files:
parallel-libs/trunk/streamexecutor/include/streamexecutor/Device.h
parallel-libs/trunk/streamexecutor/lib/unittests/DeviceTest.cpp
Index: parallel-libs/trunk/streamexecutor/lib/unittests/DeviceTest.cpp
===================================================================
--- parallel-libs/trunk/streamexecutor/lib/unittests/DeviceTest.cpp
+++ parallel-libs/trunk/streamexecutor/lib/unittests/DeviceTest.cpp
@@ -74,6 +74,10 @@
using llvm::ArrayRef;
using llvm::MutableArrayRef;
+TEST_F(DeviceTest, GetName) {
+ EXPECT_EQ(Device.getName(), "SimpleHostPlatformDevice");
+}
+
TEST_F(DeviceTest, AllocateAndFreeDeviceMemory) {
se::Expected<se::GlobalDeviceMemory<int>> MaybeMemory =
Device.allocateDeviceMemory<int>(10);
Index: parallel-libs/trunk/streamexecutor/include/streamexecutor/Device.h
===================================================================
--- parallel-libs/trunk/streamexecutor/include/streamexecutor/Device.h
+++ parallel-libs/trunk/streamexecutor/include/streamexecutor/Device.h
@@ -30,6 +30,9 @@
explicit Device(PlatformDevice *PDevice);
virtual ~Device();
+ /// Gets the name of this device.
+ std::string getName() const { return PDevice->getName(); }
+
/// Creates a kernel object for this device.
template <typename KernelT>
Expected<typename std::enable_if<std::is_base_of<KernelBase, KernelT>::value,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24240.70610.patch
Type: text/x-patch
Size: 1232 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/parallel_libs-commits/attachments/20160907/7249aa16/attachment.bin>
More information about the Parallel_libs-commits
mailing list