Skip to content

Commit

Permalink
Be less strict with timer test
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
RossBrunton committed Jan 10, 2025
1 parent f4c384d commit 5588a3f
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 13 deletions.
1 change: 0 additions & 1 deletion test/conformance/device/device_adapter_cuda.match
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
{{OPT}}urDeviceGetGlobalTimestampTest.SuccessSynchronizedTime
urDeviceGetInfoTest.Success/UR_DEVICE_INFO_MAX_READ_WRITE_IMAGE_ARGS
1 change: 0 additions & 1 deletion test/conformance/device/device_adapter_hip.match

This file was deleted.

1 change: 0 additions & 1 deletion test/conformance/device/device_adapter_level_zero.match
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
{{OPT}}urDeviceGetGlobalTimestampTest.SuccessSynchronizedTime
{{OPT}}urDeviceGetInfoTest.Success/UR_DEVICE_INFO_GLOBAL_MEM_FREE
1 change: 0 additions & 1 deletion test/conformance/device/device_adapter_level_zero_v2.match
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
{{OPT}}urDeviceGetGlobalTimestampTest.SuccessSynchronizedTime
{{OPT}}urDeviceGetInfoTest.Success/UR_DEVICE_INFO_GLOBAL_MEM_FREE
1 change: 0 additions & 1 deletion test/conformance/device/device_adapter_native_cpu.match
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
urDeviceCreateWithNativeHandleTest.InvalidNullHandlePlatform
urDeviceCreateWithNativeHandleTest.InvalidNullPointerDevice
{{OPT}}urDeviceGetGlobalTimestampTest.SuccessSynchronizedTime
urDeviceGetInfoSingleTest.MaxWorkGroupSizeIsNonzero
{{OPT}}urDeviceSelectBinaryTest.Success
urDeviceGetInfoTest.Success/UR_DEVICE_INFO_MAX_READ_WRITE_IMAGE_ARGS
Expand Down
9 changes: 1 addition & 8 deletions test/conformance/device/urDeviceGetGlobalTimestamps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ TEST_F(urDeviceGetGlobalTimestampTest, SuccessNoTimers) {
TEST_F(urDeviceGetGlobalTimestampTest, SuccessSynchronizedTime) {
for (auto device : devices) {
// get the timer resolution of the device
size_t deviceTimerResolutionNanoSecs = 0;
ASSERT_SUCCESS(uur::GetDeviceProfilingTimerResolution(
device, deviceTimerResolutionNanoSecs));
size_t delayAmountNanoSecs =
delayTimerMultiplier * deviceTimerResolutionNanoSecs;

uint64_t deviceStartTime = 0, deviceEndTime = 0;
uint64_t hostStartTime = 0, hostEndTime = 0;
uint64_t hostOnlyStartTime = 0, hostOnlyEndTime = 0;
Expand All @@ -77,8 +71,7 @@ TEST_F(urDeviceGetGlobalTimestampTest, SuccessSynchronizedTime) {
ASSERT_GE(hostOnlyStartTime, hostStartTime);

// wait for timers to increment
std::this_thread::sleep_for(
std::chrono::nanoseconds(delayAmountNanoSecs));
std::this_thread::sleep_for(std::chrono::milliseconds(500));

ASSERT_SUCCESS(
urDeviceGetGlobalTimestamps(device, &deviceEndTime, &hostEndTime));
Expand Down

0 comments on commit 5588a3f

Please sign in to comment.