forked from OSchip/llvm-project
[SE] Add getName method to Device class
Reviewers: jhen Subscribers: parallel_libs-commits Differential Revision: https://reviews.llvm.org/D24240 llvm-svn: 280872
This commit is contained in:
parent
eade17271a
commit
fe51c2f7b4
|
@ -30,6 +30,9 @@ public:
|
|||
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,
|
||||
|
|
|
@ -74,6 +74,10 @@ public:
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue