[Parallel_libs-commits] [PATCH] D24240: [SE] Add getName method to Device class

James Price via Parallel_libs-commits parallel_libs-commits at lists.llvm.org
Mon Sep 5 11:05:48 PDT 2016


jprice created this revision.
jprice added a reviewer: jhen.
jprice added a subscriber: parallel_libs-commits.

https://reviews.llvm.org/D24240

Files:
  streamexecutor/include/streamexecutor/Device.h
  streamexecutor/lib/unittests/DeviceTest.cpp

Index: streamexecutor/lib/unittests/DeviceTest.cpp
===================================================================
--- streamexecutor/lib/unittests/DeviceTest.cpp
+++ 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: streamexecutor/include/streamexecutor/Device.h
===================================================================
--- streamexecutor/include/streamexecutor/Device.h
+++ 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.70343.patch
Type: text/x-patch
Size: 1112 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/parallel_libs-commits/attachments/20160905/a8f06da7/attachment.bin>


More information about the Parallel_libs-commits mailing list