Skip to content

Commit 5856126

Browse files
committed
Be less strict with timer test
The `SuccessSynchronizedTime` previously sampled for several hundred nanoseconds in order to detect clock drift. This is too strict, and so it has been increased to 500ms.
1 parent f4c384d commit 5856126

6 files changed

+1
-14
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
{{OPT}}urDeviceGetGlobalTimestampTest.SuccessSynchronizedTime
21
urDeviceGetInfoTest.Success/UR_DEVICE_INFO_MAX_READ_WRITE_IMAGE_ARGS

test/conformance/device/device_adapter_hip.match

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
{{OPT}}urDeviceGetGlobalTimestampTest.SuccessSynchronizedTime
21
{{OPT}}urDeviceGetInfoTest.Success/UR_DEVICE_INFO_GLOBAL_MEM_FREE
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
{{OPT}}urDeviceGetGlobalTimestampTest.SuccessSynchronizedTime
21
{{OPT}}urDeviceGetInfoTest.Success/UR_DEVICE_INFO_GLOBAL_MEM_FREE

test/conformance/device/device_adapter_native_cpu.match

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
urDeviceCreateWithNativeHandleTest.InvalidNullHandlePlatform
22
urDeviceCreateWithNativeHandleTest.InvalidNullPointerDevice
3-
{{OPT}}urDeviceGetGlobalTimestampTest.SuccessSynchronizedTime
43
urDeviceGetInfoSingleTest.MaxWorkGroupSizeIsNonzero
54
{{OPT}}urDeviceSelectBinaryTest.Success
65
urDeviceGetInfoTest.Success/UR_DEVICE_INFO_MAX_READ_WRITE_IMAGE_ARGS

test/conformance/device/urDeviceGetGlobalTimestamps.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
// - Currently we are saying the error between host/device
1414
// - timers is 0.5%
1515
constexpr double allowedTimerError = 0.005;
16-
constexpr size_t delayTimerMultiplier = 100;
1716

1817
/// @brief Return the absolute difference between two numeric values.
1918
/// @tparam T An numeric type.
@@ -57,12 +56,6 @@ TEST_F(urDeviceGetGlobalTimestampTest, SuccessNoTimers) {
5756
TEST_F(urDeviceGetGlobalTimestampTest, SuccessSynchronizedTime) {
5857
for (auto device : devices) {
5958
// get the timer resolution of the device
60-
size_t deviceTimerResolutionNanoSecs = 0;
61-
ASSERT_SUCCESS(uur::GetDeviceProfilingTimerResolution(
62-
device, deviceTimerResolutionNanoSecs));
63-
size_t delayAmountNanoSecs =
64-
delayTimerMultiplier * deviceTimerResolutionNanoSecs;
65-
6659
uint64_t deviceStartTime = 0, deviceEndTime = 0;
6760
uint64_t hostStartTime = 0, hostEndTime = 0;
6861
uint64_t hostOnlyStartTime = 0, hostOnlyEndTime = 0;
@@ -77,8 +70,7 @@ TEST_F(urDeviceGetGlobalTimestampTest, SuccessSynchronizedTime) {
7770
ASSERT_GE(hostOnlyStartTime, hostStartTime);
7871

7972
// wait for timers to increment
80-
std::this_thread::sleep_for(
81-
std::chrono::nanoseconds(delayAmountNanoSecs));
73+
std::this_thread::sleep_for(std::chrono::milliseconds(16));
8274

8375
ASSERT_SUCCESS(
8476
urDeviceGetGlobalTimestamps(device, &deviceEndTime, &hostEndTime));

0 commit comments

Comments
 (0)