BOOST_CHECK_GE(max_work_item_sizes[2], size_t(1));
}
-#ifdef CL_VERSION_1_2
+#ifdef BOOST_COMPUTE_CL_VERSION_1_2
// returns true if the device supports the partitioning type
bool supports_partition_type(const boost::compute::device &device,
// ensure device is not a sub-device
BOOST_CHECK(device.is_subdevice() == false);
- // partition default device into sub-devices with two compute units each
+ // partition default device into sub-devices with one compute unit each
std::vector<boost::compute::device>
- sub_devices = device.partition_equally(2);
- BOOST_CHECK_EQUAL(sub_devices.size(), size_t(device.compute_units() / 2));
+ sub_devices = device.partition_equally(1);
+ BOOST_CHECK_EQUAL(sub_devices.size(), size_t(device.compute_units()));
// verify each of the sub-devices
for(size_t i = 0; i < sub_devices.size(); i++){
BOOST_CHECK(sub_device.is_subdevice() == true);
// check number of compute units
- BOOST_CHECK_EQUAL(sub_device.compute_units(), size_t(2));
+ BOOST_CHECK_EQUAL(sub_device.compute_units(), size_t(1));
}
}
BOOST_CHECK(sub_devices.size() > 0);
BOOST_CHECK(sub_devices[0].is_subdevice() == true);
}
-#endif // CL_VERSION_1_2
+#endif // BOOST_COMPUTE_CL_VERSION_1_2
BOOST_AUTO_TEST_CASE(nvidia_compute_capability)
{
std::cout << device.get_info<CL_DEVICE_NAME>() << std::endl;
}
+
+#ifdef BOOST_COMPUTE_CL_VERSION_2_1
+BOOST_AUTO_TEST_CASE(get_host_timer)
+{
+ boost::compute::device device = boost::compute::system::default_device();
+ BOOST_CHECK(device.get_host_timer() != 0);
+
+ #ifndef BOOST_COMPUTE_NO_HDR_CHRONO
+ typedef std::chrono::milliseconds stdms;
+ BOOST_CHECK(device.get_host_timer<stdms>().count() != 0);
+ #endif
+
+ #ifndef BOOST_COMPUTE_NO_BOOST_CHRONO
+ typedef boost::chrono::milliseconds bms;
+ BOOST_CHECK(device.get_host_timer<bms>().count() != 0);
+ #endif
+}
+
+BOOST_AUTO_TEST_CASE(get_device_and_host_timer)
+{
+ boost::compute::device device = boost::compute::system::default_device();
+ typedef std::pair<boost::compute::ulong_, boost::compute::ulong_> dah_timer;
+ dah_timer timer;
+ BOOST_CHECK_NO_THROW(timer = device.get_device_and_host_timer());
+ BOOST_CHECK(timer.first != 0);
+ BOOST_CHECK(timer.second != 0);
+
+ #ifndef BOOST_COMPUTE_NO_HDR_CHRONO
+ typedef std::chrono::milliseconds stdms;
+ BOOST_CHECK(device.get_device_and_host_timer<stdms>().first.count() != 0);
+ BOOST_CHECK(device.get_device_and_host_timer<stdms>().second.count() != 0);
+ #endif
+
+ #ifndef BOOST_COMPUTE_NO_BOOST_CHRONO
+ typedef boost::chrono::milliseconds bms;
+ BOOST_CHECK(device.get_device_and_host_timer<bms>().first.count() != 0);
+ BOOST_CHECK(device.get_device_and_host_timer<bms>().second.count() != 0);
+ #endif
+}
+
+BOOST_AUTO_TEST_CASE(get_info_opencl21_queries)
+{
+ boost::compute::device device = boost::compute::system::default_device();
+
+ BOOST_CHECK(!device.get_info<CL_DEVICE_IL_VERSION>().empty());
+ BOOST_CHECK(device.get_info<CL_DEVICE_MAX_NUM_SUB_GROUPS>() > 0);
+ BOOST_CHECK_NO_THROW(
+ device.get_info<CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS>()
+ );
+}
+#endif // BOOST_COMPUTE_CL_VERSION_2_1