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 Expected::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> MaybeMemory = Device.allocateDeviceMemory(10);