Skip to content

Be less strict with timer test #2547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions test/conformance/device/urDeviceGetGlobalTimestamps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// - Currently we are saying the error between host/device
// - timers is 0.5%
constexpr double allowedTimerError = 0.005;
constexpr size_t delayTimerMultiplier = 100;

/// @brief Return the absolute difference between two numeric values.
/// @tparam T An numeric type.
Expand Down Expand Up @@ -56,17 +55,8 @@ TEST_P(urDeviceGetGlobalTimestampTest, SuccessNoTimers) {
}

TEST_P(urDeviceGetGlobalTimestampTest, SuccessSynchronizedTime) {
UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}, uur::LevelZero{},
uur::LevelZeroV2{}, uur::NativeCPU{},
uur::OpenCL{"Intel(R) FPGA"},
uur::OpenCL{"Intel(R) UHD Graphics 770"});

// get the timer resolution of the device
size_t deviceTimerResolutionNanoSecs = 0;
ASSERT_SUCCESS(uur::GetDeviceProfilingTimerResolution(
device, deviceTimerResolutionNanoSecs));
size_t delayAmountNanoSecs =
delayTimerMultiplier * deviceTimerResolutionNanoSecs;
// Returns `UR_RESULT_ERROR_INVALID_OPERATION`
UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"});

uint64_t deviceStartTime = 0, deviceEndTime = 0;
uint64_t hostStartTime = 0, hostEndTime = 0;
Expand All @@ -82,7 +72,7 @@ TEST_P(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(16));

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