2
0
mirror of https://github.com/boostorg/compute.git synced 2026-02-19 02:12:19 +00:00

Add device::platform() method

This commit is contained in:
Kyle Lutz
2014-12-13 11:25:11 -08:00
parent a29f453687
commit 2bab2c5ee7
8 changed files with 26 additions and 20 deletions

View File

@@ -22,11 +22,7 @@
// returns true if the device is a POCL device
inline bool is_pocl_device(const boost::compute::device &device)
{
boost::compute::platform platform(
device.get_info<cl_platform_id>(CL_DEVICE_PLATFORM)
);
return platform.name() == "Portable Computing Language";
return device.platform().name() == "Portable Computing Language";
}
// AMD platforms have a bug when using struct assignment. this affects

View File

@@ -35,6 +35,12 @@ boost::compute::device gpu = boost::compute::system::default_device();
BOOST_CHECK(gpu.id());
}
BOOST_AUTO_TEST_CASE(device_platform)
{
boost::compute::platform p = boost::compute::system::platforms().at(0);
BOOST_CHECK(p == p.devices().at(0).platform());
}
BOOST_AUTO_TEST_CASE(get_device_name)
{
boost::compute::device gpu = boost::compute::system::default_device();