mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Revert "Calculate CS timestamp based on OA timestamp and frequencies ratio"
This reverts commit 03c528382f.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b2c80be6f9
commit
5e36b1fcbf
@@ -9,8 +9,6 @@
|
||||
#include "shared/source/os_interface/windows/wddm/wddm.h"
|
||||
#include "shared/test/common/fixtures/device_fixture.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
#include "shared/test/common/mocks/mock_ostime_win.h"
|
||||
#include "shared/test/common/mocks/mock_wddm.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
@@ -57,45 +55,3 @@ TEST_F(DeviceTest, GivenDeviceWhenGetAdapterMaskThenMaskIsSet) {
|
||||
|
||||
EXPECT_EQ(nodeMask, 1u);
|
||||
}
|
||||
|
||||
typedef ::testing::Test MockOSTimeWinTest;
|
||||
|
||||
TEST_F(MockOSTimeWinTest, whenCreatingTimerThenResolutionIsSetCorrectly) {
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
RootDeviceEnvironment rootDeviceEnvironment(executionEnvironment);
|
||||
auto wddmMock = new WddmMock(rootDeviceEnvironment);
|
||||
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
||||
|
||||
wddmMock->init();
|
||||
|
||||
wddmMock->timestampFrequency = 1000;
|
||||
|
||||
std::unique_ptr<MockOSTimeWin> timeWin(new MockOSTimeWin(wddmMock));
|
||||
|
||||
double res = 0.0;
|
||||
res = timeWin->getDynamicDeviceTimerResolution(device->getHardwareInfo());
|
||||
EXPECT_EQ(res, 1e+06);
|
||||
}
|
||||
|
||||
TEST_F(MockOSTimeWinTest, whenConvertingTimestampsToCsDomainThenTimestampDataAreSetCorrectly) {
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
RootDeviceEnvironment rootDeviceEnvironment(executionEnvironment);
|
||||
auto wddmMock = new WddmMock(rootDeviceEnvironment);
|
||||
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
||||
wddmMock->init();
|
||||
std::unique_ptr<MockOSTimeWin> timeWin(new MockOSTimeWin(wddmMock));
|
||||
uint64_t timestampData = 0x1234;
|
||||
uint64_t freqOA = 1;
|
||||
uint64_t freqCS = 0;
|
||||
auto expectedGpuTicksWhenEqualOne = timestampData;
|
||||
timeWin->convertTimestampsFromOaToCsDomain(timestampData, freqOA, freqCS);
|
||||
EXPECT_EQ(expectedGpuTicksWhenEqualOne, timestampData);
|
||||
freqCS = 1;
|
||||
timeWin->convertTimestampsFromOaToCsDomain(timestampData, freqOA, freqCS);
|
||||
EXPECT_EQ(expectedGpuTicksWhenEqualOne, timestampData);
|
||||
freqOA = 2;
|
||||
uint64_t ratio = freqOA / freqCS;
|
||||
auto expectedGpuTicksWhenRatioBiggerThanOne = timestampData / ratio;
|
||||
timeWin->convertTimestampsFromOaToCsDomain(timestampData, freqOA, freqCS);
|
||||
EXPECT_EQ(expectedGpuTicksWhenRatioBiggerThanOne, timestampData);
|
||||
}
|
||||
Reference in New Issue
Block a user