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:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user