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, 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);