mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 06:24:51 +08:00
fix: remove defaultProfilingTimerResolution from RuntimeCapabilityTable
Related-To: NEO-12275 Signed-off-by: Marcel Skierkowski <marcel.skierkowski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
f8f1557ec7
commit
49d999abe6
@@ -214,11 +214,11 @@ class FalseGpuCpuDeviceTime : public NEO::DeviceTime {
|
||||
bool getGpuCpuTimeImpl(TimeStampData *pGpuCpuTime, OSTime *osTime) override {
|
||||
return false;
|
||||
}
|
||||
double getDynamicDeviceTimerResolution(HardwareInfo const &hwInfo) const override {
|
||||
return NEO::OSTime::getDeviceTimerResolution(hwInfo);
|
||||
double getDynamicDeviceTimerResolution() const override {
|
||||
return NEO::OSTime::getDeviceTimerResolution();
|
||||
}
|
||||
uint64_t getDynamicDeviceTimerClock(HardwareInfo const &hwInfo) const override {
|
||||
return static_cast<uint64_t>(1000000000.0 / OSTime::getDeviceTimerResolution(hwInfo));
|
||||
uint64_t getDynamicDeviceTimerClock() const override {
|
||||
return static_cast<uint64_t>(1000000000.0 / OSTime::getDeviceTimerResolution());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1812,11 +1812,11 @@ class FalseCpuDeviceTime : public NEO::DeviceTime {
|
||||
pGpuCpuTime->gpuTimeStamp = mockGpuTimeInNs;
|
||||
return true;
|
||||
}
|
||||
double getDynamicDeviceTimerResolution(HardwareInfo const &hwInfo) const override {
|
||||
return NEO::OSTime::getDeviceTimerResolution(hwInfo);
|
||||
double getDynamicDeviceTimerResolution() const override {
|
||||
return NEO::OSTime::getDeviceTimerResolution();
|
||||
}
|
||||
uint64_t getDynamicDeviceTimerClock(HardwareInfo const &hwInfo) const override {
|
||||
return static_cast<uint64_t>(1000000000.0 / OSTime::getDeviceTimerResolution(hwInfo));
|
||||
uint64_t getDynamicDeviceTimerClock() const override {
|
||||
return static_cast<uint64_t>(1000000000.0 / OSTime::getDeviceTimerResolution());
|
||||
}
|
||||
uint64_t mockCpuTimeInNs = 0u;
|
||||
uint64_t mockGpuTimeInNs = 100u;
|
||||
|
||||
@@ -74,7 +74,7 @@ ze_result_t SysmanDeviceImp::init() {
|
||||
|
||||
double SysmanDeviceImp::getTimerResolution() {
|
||||
getRootDeviceEnvironmentRef().initOsTime();
|
||||
return getRootDeviceEnvironment().osTime.get()->getDynamicDeviceTimerResolution(getHardwareInfo());
|
||||
return getRootDeviceEnvironment().osTime.get()->getDynamicDeviceTimerResolution();
|
||||
}
|
||||
|
||||
ze_result_t SysmanDeviceImp::deviceGetProperties(zes_device_properties_t *pProperties) {
|
||||
|
||||
@@ -75,9 +75,8 @@ class SysmanGlobalOperationsFixture : public SysmanDeviceFixture {
|
||||
void SetUp() override {
|
||||
SysmanDeviceFixture::SetUp();
|
||||
|
||||
auto &hwInfo = pLinuxSysmanImp->getParentSysmanDeviceImp()->getHardwareInfo();
|
||||
pLinuxSysmanImp->getParentSysmanDeviceImp()->getRootDeviceEnvironmentRef().osTime = MockOSTime::create();
|
||||
pLinuxSysmanImp->getParentSysmanDeviceImp()->getRootDeviceEnvironmentRef().osTime->setDeviceTimerResolution(hwInfo);
|
||||
pLinuxSysmanImp->getParentSysmanDeviceImp()->getRootDeviceEnvironmentRef().osTime->setDeviceTimerResolution();
|
||||
|
||||
pEngineHandleContextOld = pSysmanDeviceImp->pEngineHandleContext;
|
||||
pDiagnosticsHandleContextOld = pSysmanDeviceImp->pDiagnosticsHandleContext;
|
||||
@@ -1244,8 +1243,7 @@ TEST_F(SysmanGlobalOperationsFixture, WhenGettingDevicePropertiesThenSubslicesPe
|
||||
|
||||
TEST_F(SysmanGlobalOperationsFixture, GivenValidDeviceHandleWhenCallingGetPropertiesThenCorrectTimerResolutionInCorePropertiesAreReturned) {
|
||||
pLinuxSysmanImp->getParentSysmanDeviceImp()->getRootDeviceEnvironmentRef().osTime.reset(new NEO::MockOSTimeWithConstTimestamp());
|
||||
auto pHwInfo = pLinuxSysmanImp->getSysmanDeviceImp()->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
double mockedTimerResolution = pLinuxSysmanImp->getParentSysmanDeviceImp()->getRootDeviceEnvironment().osTime->getDynamicDeviceTimerResolution(*pHwInfo);
|
||||
double mockedTimerResolution = pLinuxSysmanImp->getParentSysmanDeviceImp()->getRootDeviceEnvironment().osTime->getDynamicDeviceTimerResolution();
|
||||
zes_device_properties_t properties = {};
|
||||
ze_result_t result = zesDeviceGetProperties(pSysmanDevice->toHandle(), &properties);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
@@ -1339,9 +1337,8 @@ class SysmanDevicePropertiesExtensionTestMultiDevice : public SysmanMultiDeviceF
|
||||
void SetUp() override {
|
||||
SysmanMultiDeviceFixture::SetUp();
|
||||
for (auto i = 0u; i < execEnv->rootDeviceEnvironments.size(); i++) {
|
||||
auto &hwInfo = *execEnv->rootDeviceEnvironments[i]->getMutableHardwareInfo();
|
||||
execEnv->rootDeviceEnvironments[i]->osTime = MockOSTime::create();
|
||||
execEnv->rootDeviceEnvironments[i]->osTime->setDeviceTimerResolution(hwInfo);
|
||||
execEnv->rootDeviceEnvironments[i]->osTime->setDeviceTimerResolution();
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1460,9 +1457,8 @@ class SysmanDeviceGetByUuidExperimentalTestMultiDevice : public SysmanMultiDevic
|
||||
void SetUp() override {
|
||||
SysmanMultiDeviceFixture::SetUp();
|
||||
for (auto i = 0u; i < execEnv->rootDeviceEnvironments.size(); i++) {
|
||||
auto &hwInfo = *execEnv->rootDeviceEnvironments[i]->getMutableHardwareInfo();
|
||||
execEnv->rootDeviceEnvironments[i]->osTime = MockOSTime::create();
|
||||
execEnv->rootDeviceEnvironments[i]->osTime->setDeviceTimerResolution(hwInfo);
|
||||
execEnv->rootDeviceEnvironments[i]->osTime->setDeviceTimerResolution();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -26,9 +26,8 @@ class SysmanGlobalOperationsFixtureXe : public SysmanDeviceFixture {
|
||||
|
||||
void SetUp() override {
|
||||
SysmanDeviceFixture::SetUp();
|
||||
auto &hwInfo = pLinuxSysmanImp->getParentSysmanDeviceImp()->getHardwareInfo();
|
||||
pLinuxSysmanImp->getParentSysmanDeviceImp()->getRootDeviceEnvironmentRef().osTime = MockOSTime::create();
|
||||
pLinuxSysmanImp->getParentSysmanDeviceImp()->getRootDeviceEnvironmentRef().osTime->setDeviceTimerResolution(hwInfo);
|
||||
pLinuxSysmanImp->getParentSysmanDeviceImp()->getRootDeviceEnvironmentRef().osTime->setDeviceTimerResolution();
|
||||
|
||||
pSysmanKmdInterface = new MockSysmanKmdInterfaceXe(pLinuxSysmanImp->getSysmanProductHelper());
|
||||
pSysfsAccess = new MockGlobalOperationsSysfsAccess();
|
||||
|
||||
@@ -29,9 +29,8 @@ class SysmanGlobalOperationsFixture : public SysmanDeviceFixture {
|
||||
|
||||
void SetUp() override {
|
||||
SysmanDeviceFixture::SetUp();
|
||||
auto &hwInfo = pWddmSysmanImp->getSysmanDeviceImp()->getHardwareInfo();
|
||||
pWddmSysmanImp->getSysmanDeviceImp()->getRootDeviceEnvironmentRef().osTime = MockOSTime::create();
|
||||
pWddmSysmanImp->getSysmanDeviceImp()->getRootDeviceEnvironmentRef().osTime->setDeviceTimerResolution(hwInfo);
|
||||
pWddmSysmanImp->getSysmanDeviceImp()->getRootDeviceEnvironmentRef().osTime->setDeviceTimerResolution();
|
||||
}
|
||||
|
||||
void init(bool allowSetCalls) {
|
||||
@@ -156,8 +155,7 @@ TEST_F(SysmanGlobalOperationsFixture, GivenValidDeviceHandleWhenCallingGetProper
|
||||
TEST_F(SysmanGlobalOperationsFixture, GivenValidDeviceHandleWhenCallingGetPropertiesThenCorrectTimerResolutionInCorePropertiesAreReturned) {
|
||||
init(true);
|
||||
pWddmSysmanImp->getSysmanDeviceImp()->getRootDeviceEnvironmentRef().osTime.reset(new NEO::MockOSTimeWithConstTimestamp());
|
||||
auto pHwInfo = pWddmSysmanImp->getSysmanDeviceImp()->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
double mockedTimerResolution = pWddmSysmanImp->getSysmanDeviceImp()->getRootDeviceEnvironment().osTime->getDynamicDeviceTimerResolution(*pHwInfo);
|
||||
double mockedTimerResolution = pWddmSysmanImp->getSysmanDeviceImp()->getRootDeviceEnvironment().osTime->getDynamicDeviceTimerResolution();
|
||||
|
||||
zes_device_properties_t properties = {};
|
||||
ze_result_t result = zesDeviceGetProperties(pSysmanDevice->toHandle(), &properties);
|
||||
@@ -216,9 +214,8 @@ class SysmanGlobalOperationsUuidFixture : public SysmanDeviceFixture {
|
||||
L0::Sysman::SysmanDeviceImp *device = nullptr;
|
||||
void SetUp() override {
|
||||
SysmanDeviceFixture::SetUp();
|
||||
auto &hwInfo = pWddmSysmanImp->getSysmanDeviceImp()->getHardwareInfo();
|
||||
pWddmSysmanImp->getSysmanDeviceImp()->getRootDeviceEnvironmentRef().osTime = MockOSTime::create();
|
||||
pWddmSysmanImp->getSysmanDeviceImp()->getRootDeviceEnvironmentRef().osTime->setDeviceTimerResolution(hwInfo);
|
||||
pWddmSysmanImp->getSysmanDeviceImp()->getRootDeviceEnvironmentRef().osTime->setDeviceTimerResolution();
|
||||
pGlobalOperationsImp = static_cast<L0::Sysman::GlobalOperationsImp *>(pSysmanDeviceImp->pGlobalOperations);
|
||||
device = pSysmanDeviceImp;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ TEST(MockOSTime, WhenSleepingThenDeviceAndHostTimerAreIncreased) {
|
||||
|
||||
auto mDev = MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr);
|
||||
auto osTime = new MockOSTime();
|
||||
osTime->setDeviceTimerResolution(mDev->getHardwareInfo());
|
||||
osTime->setDeviceTimerResolution();
|
||||
mDev->setOSTime(osTime);
|
||||
|
||||
mDev->getDeviceAndHostTimer(
|
||||
@@ -166,12 +166,12 @@ class FailingMockDeviceTime : public DeviceTime {
|
||||
return false;
|
||||
}
|
||||
|
||||
double getDynamicDeviceTimerResolution(HardwareInfo const &hwInfo) const override {
|
||||
double getDynamicDeviceTimerResolution() const override {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
uint64_t getDynamicDeviceTimerClock(HardwareInfo const &hwInfo) const override {
|
||||
return static_cast<uint64_t>(1000000000.0 / OSTime::getDeviceTimerResolution(hwInfo));
|
||||
uint64_t getDynamicDeviceTimerClock() const override {
|
||||
return static_cast<uint64_t>(1000000000.0 / OSTime::getDeviceTimerResolution());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2023 Intel Corporation
|
||||
* Copyright (C) 2019-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -85,11 +85,11 @@ struct MockTagNode : public TagNode<TagType> {
|
||||
};
|
||||
|
||||
class MyDeviceTime : public DeviceTime {
|
||||
double getDynamicDeviceTimerResolution(HardwareInfo const &hwInfo) const override {
|
||||
double getDynamicDeviceTimerResolution() const override {
|
||||
EXPECT_FALSE(true);
|
||||
return 1.0;
|
||||
}
|
||||
uint64_t getDynamicDeviceTimerClock(HardwareInfo const &hwInfo) const override {
|
||||
uint64_t getDynamicDeviceTimerClock() const override {
|
||||
EXPECT_FALSE(true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -73,11 +73,11 @@ struct MockTagNode : public TagNode<TagType> {
|
||||
};
|
||||
|
||||
class MyOSDeviceTime : public DeviceTime {
|
||||
double getDynamicDeviceTimerResolution(HardwareInfo const &hwInfo) const override {
|
||||
double getDynamicDeviceTimerResolution() const override {
|
||||
EXPECT_FALSE(true);
|
||||
return 1.0;
|
||||
}
|
||||
uint64_t getDynamicDeviceTimerClock(HardwareInfo const &hwInfo) const override {
|
||||
uint64_t getDynamicDeviceTimerClock() const override {
|
||||
EXPECT_FALSE(true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "shared/source/compiler_interface/igc_platform_helper.h"
|
||||
#include "shared/source/compiler_interface/os_compiler_cache_helper.h"
|
||||
#include "shared/source/helpers/compiler_product_helper.h"
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/helpers/debug_helpers.h"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
#include "shared/source/helpers/string.h"
|
||||
@@ -92,7 +93,7 @@ int OclocIgcFacade::initialize(const HardwareInfo &hwInfo) {
|
||||
return OCLOC_OUT_OF_HOST_MEMORY;
|
||||
}
|
||||
|
||||
igcDeviceCtx->SetProfilingTimerResolution(static_cast<float>(hwInfo.capabilityTable.defaultProfilingTimerResolution));
|
||||
igcDeviceCtx->SetProfilingTimerResolution(static_cast<float>(CommonConstants::defaultProfilingTimerResolution));
|
||||
|
||||
const auto igcPlatform = getIgcPlatformHandle();
|
||||
const auto igcGtSystemInfo = getGTSystemInfoHandle();
|
||||
|
||||
@@ -618,11 +618,11 @@ const DeviceInfo &Device::getDeviceInfo() const {
|
||||
}
|
||||
|
||||
double Device::getProfilingTimerResolution() {
|
||||
return getOSTime()->getDynamicDeviceTimerResolution(getHardwareInfo());
|
||||
return getOSTime()->getDynamicDeviceTimerResolution();
|
||||
}
|
||||
|
||||
uint64_t Device::getProfilingTimerClock() {
|
||||
return getOSTime()->getDynamicDeviceTimerClock(getHardwareInfo());
|
||||
return getOSTime()->getDynamicDeviceTimerClock();
|
||||
}
|
||||
|
||||
bool Device::isBcsSplitSupported() {
|
||||
@@ -707,7 +707,7 @@ bool Device::getDeviceAndHostTimer(uint64_t *deviceTimestamp, uint64_t *hostTime
|
||||
if (retVal) {
|
||||
*hostTimestamp = timeStamp.cpuTimeinNS;
|
||||
if (debugManager.flags.EnableDeviceBasedTimestamps.get()) {
|
||||
auto resolution = getOSTime()->getDynamicDeviceTimerResolution(getHardwareInfo());
|
||||
auto resolution = getOSTime()->getDynamicDeviceTimerResolution();
|
||||
*deviceTimestamp = getGfxCoreHelper().getGpuTimeStampInNS(timeStamp.gpuTimeStamp, resolution);
|
||||
} else
|
||||
*deviceTimestamp = *hostTimestamp;
|
||||
|
||||
@@ -127,7 +127,7 @@ void RootDeviceEnvironment::initGmm() {
|
||||
void RootDeviceEnvironment::initOsTime() {
|
||||
if (!osTime) {
|
||||
osTime = OSTime::create(osInterface.get());
|
||||
osTime->setDeviceTimerResolution(*hwInfo);
|
||||
osTime->setDeviceTimerResolution();
|
||||
osTime->setDeviceTimestampWidth(gfxCoreHelper->getDeviceTimestampWidth());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ const RuntimeCapabilityTable ADLN::capabilityTable{
|
||||
{0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties
|
||||
MemoryConstants::max64BitAppAddress, // gpuAddressSpace
|
||||
0, // sharedSystemMemCapabilities
|
||||
83.333, // defaultProfilingTimerResolution
|
||||
MemoryConstants::pageSize, // requiredPreemptionSurfaceSize
|
||||
"", // deviceName
|
||||
nullptr, // preferredPlatformName
|
||||
|
||||
@@ -37,7 +37,6 @@ const RuntimeCapabilityTable ADLP::capabilityTable{
|
||||
{0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties
|
||||
MemoryConstants::max64BitAppAddress, // gpuAddressSpace
|
||||
0, // sharedSystemMemCapabilities
|
||||
83.333, // defaultProfilingTimerResolution
|
||||
MemoryConstants::pageSize, // requiredPreemptionSurfaceSize
|
||||
"", // deviceName
|
||||
nullptr, // preferredPlatformName
|
||||
|
||||
@@ -37,7 +37,6 @@ const RuntimeCapabilityTable ADLS::capabilityTable{
|
||||
{0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties
|
||||
MemoryConstants::max64BitAppAddress, // gpuAddressSpace
|
||||
0, // sharedSystemMemCapabilities
|
||||
83.333, // defaultProfilingTimerResolution
|
||||
MemoryConstants::pageSize, // requiredPreemptionSurfaceSize
|
||||
"", // deviceName
|
||||
nullptr, // preferredPlatformName
|
||||
|
||||
@@ -37,7 +37,6 @@ const RuntimeCapabilityTable DG1::capabilityTable{
|
||||
{0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties
|
||||
MemoryConstants::max64BitAppAddress, // gpuAddressSpace
|
||||
0, // sharedSystemMemCapabilities
|
||||
83.333, // defaultProfilingTimerResolution
|
||||
MemoryConstants::pageSize, // requiredPreemptionSurfaceSize
|
||||
"", // deviceName
|
||||
nullptr, // preferredPlatformName
|
||||
|
||||
@@ -37,7 +37,6 @@ const RuntimeCapabilityTable RKL::capabilityTable{
|
||||
{0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties
|
||||
MemoryConstants::max48BitAddress, // gpuAddressSpace
|
||||
0, // sharedSystemMemCapabilities
|
||||
83.333, // defaultProfilingTimerResolution
|
||||
MemoryConstants::pageSize, // requiredPreemptionSurfaceSize
|
||||
"", // deviceName
|
||||
nullptr, // preferredPlatformName
|
||||
|
||||
@@ -37,7 +37,6 @@ const RuntimeCapabilityTable TGLLP::capabilityTable{
|
||||
{0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties
|
||||
MemoryConstants::max64BitAppAddress, // gpuAddressSpace
|
||||
0, // sharedSystemMemCapabilities
|
||||
83.333, // defaultProfilingTimerResolution
|
||||
MemoryConstants::pageSize, // requiredPreemptionSurfaceSize
|
||||
"", // deviceName
|
||||
nullptr, // preferredPlatformName
|
||||
|
||||
@@ -93,4 +93,5 @@ inline constexpr uint32_t maximalSizeOfAtomicType = 8;
|
||||
inline constexpr uint32_t engineGroupCount = static_cast<uint32_t>(NEO::EngineGroupType::maxEngineGroups);
|
||||
inline constexpr uint32_t maxWorkgroupSize = 1024u;
|
||||
inline constexpr uint32_t minimalSyncBufferSize = 12;
|
||||
inline constexpr double defaultProfilingTimerResolution = 83.333;
|
||||
} // namespace CommonConstants
|
||||
|
||||
@@ -24,7 +24,6 @@ struct RuntimeCapabilityTable {
|
||||
KmdNotifyProperties kmdNotifyProperties;
|
||||
uint64_t gpuAddressSpace;
|
||||
uint64_t sharedSystemMemCapabilities;
|
||||
double defaultProfilingTimerResolution;
|
||||
size_t requiredPreemptionSurfaceSize;
|
||||
const char *deviceName;
|
||||
const char *preferredPlatformName;
|
||||
@@ -94,7 +93,6 @@ inline bool operator==(const RuntimeCapabilityTable &lhs, const RuntimeCapabilit
|
||||
result &= (lhs.kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits == rhs.kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits);
|
||||
result &= (lhs.gpuAddressSpace == rhs.gpuAddressSpace);
|
||||
result &= (lhs.sharedSystemMemCapabilities == rhs.sharedSystemMemCapabilities);
|
||||
result &= (lhs.defaultProfilingTimerResolution == rhs.defaultProfilingTimerResolution);
|
||||
result &= (lhs.requiredPreemptionSurfaceSize == rhs.requiredPreemptionSurfaceSize);
|
||||
result &= (lhs.defaultPreemptionMode == rhs.defaultPreemptionMode);
|
||||
result &= (lhs.defaultEngineType == rhs.defaultEngineType);
|
||||
|
||||
@@ -26,7 +26,7 @@ bool DeviceTimeDrm::getGpuCpuTimeImpl(TimeStampData *pGpuCpuTime, OSTime *osTime
|
||||
return pDrm->getIoctlHelper()->setGpuCpuTimes(pGpuCpuTime, osTime);
|
||||
}
|
||||
|
||||
double DeviceTimeDrm::getDynamicDeviceTimerResolution(HardwareInfo const &hwInfo) const {
|
||||
double DeviceTimeDrm::getDynamicDeviceTimerResolution() const {
|
||||
if (pDrm) {
|
||||
int frequency = 0;
|
||||
|
||||
@@ -35,10 +35,10 @@ double DeviceTimeDrm::getDynamicDeviceTimerResolution(HardwareInfo const &hwInfo
|
||||
return nanosecondsPerSecond / frequency;
|
||||
}
|
||||
}
|
||||
return OSTime::getDeviceTimerResolution(hwInfo);
|
||||
return OSTime::getDeviceTimerResolution();
|
||||
}
|
||||
|
||||
uint64_t DeviceTimeDrm::getDynamicDeviceTimerClock(HardwareInfo const &hwInfo) const {
|
||||
uint64_t DeviceTimeDrm::getDynamicDeviceTimerClock() const {
|
||||
|
||||
if (pDrm) {
|
||||
int frequency = 0;
|
||||
@@ -48,7 +48,7 @@ uint64_t DeviceTimeDrm::getDynamicDeviceTimerClock(HardwareInfo const &hwInfo) c
|
||||
return static_cast<uint64_t>(frequency);
|
||||
}
|
||||
}
|
||||
return static_cast<uint64_t>(nanosecondsPerSecond / OSTime::getDeviceTimerResolution(hwInfo));
|
||||
return static_cast<uint64_t>(nanosecondsPerSecond / OSTime::getDeviceTimerResolution());
|
||||
}
|
||||
|
||||
bool DeviceTimeDrm::isTimestampsRefreshEnabled() const {
|
||||
|
||||
@@ -15,8 +15,8 @@ class DeviceTimeDrm : public DeviceTime {
|
||||
public:
|
||||
DeviceTimeDrm(OSInterface &osInterface);
|
||||
bool getGpuCpuTimeImpl(TimeStampData *pGpuCpuTime, OSTime *osTime) override;
|
||||
double getDynamicDeviceTimerResolution(HardwareInfo const &hwInfo) const override;
|
||||
uint64_t getDynamicDeviceTimerClock(HardwareInfo const &hwInfo) const override;
|
||||
double getDynamicDeviceTimerResolution() const override;
|
||||
uint64_t getDynamicDeviceTimerClock() const override;
|
||||
bool isTimestampsRefreshEnabled() const override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "shared/source/os_interface/os_time.h"
|
||||
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/helpers/debug_helpers.h"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
|
||||
@@ -15,8 +16,8 @@
|
||||
|
||||
namespace NEO {
|
||||
|
||||
double OSTime::getDeviceTimerResolution(HardwareInfo const &hwInfo) {
|
||||
return hwInfo.capabilityTable.defaultProfilingTimerResolution;
|
||||
double OSTime::getDeviceTimerResolution() {
|
||||
return CommonConstants::defaultProfilingTimerResolution;
|
||||
};
|
||||
|
||||
bool DeviceTime::getGpuCpuTimeImpl(TimeStampData *pGpuCpuTime, OSTime *osTime) {
|
||||
@@ -25,16 +26,16 @@ bool DeviceTime::getGpuCpuTimeImpl(TimeStampData *pGpuCpuTime, OSTime *osTime) {
|
||||
|
||||
return true;
|
||||
}
|
||||
double DeviceTime::getDynamicDeviceTimerResolution(HardwareInfo const &hwInfo) const {
|
||||
return OSTime::getDeviceTimerResolution(hwInfo);
|
||||
double DeviceTime::getDynamicDeviceTimerResolution() const {
|
||||
return OSTime::getDeviceTimerResolution();
|
||||
}
|
||||
|
||||
uint64_t DeviceTime::getDynamicDeviceTimerClock(HardwareInfo const &hwInfo) const {
|
||||
return static_cast<uint64_t>(1000000000.0 / OSTime::getDeviceTimerResolution(hwInfo));
|
||||
uint64_t DeviceTime::getDynamicDeviceTimerClock() const {
|
||||
return static_cast<uint64_t>(1000000000.0 / OSTime::getDeviceTimerResolution());
|
||||
}
|
||||
|
||||
void DeviceTime::setDeviceTimerResolution(HardwareInfo const &hwInfo) {
|
||||
deviceTimerResolution = getDynamicDeviceTimerResolution(hwInfo);
|
||||
void DeviceTime::setDeviceTimerResolution() {
|
||||
deviceTimerResolution = getDynamicDeviceTimerResolution();
|
||||
if (debugManager.flags.OverrideProfilingTimerResolution.get() != -1) {
|
||||
deviceTimerResolution = static_cast<double>(debugManager.flags.OverrideProfilingTimerResolution.get());
|
||||
}
|
||||
|
||||
@@ -28,11 +28,11 @@ class DeviceTime {
|
||||
virtual ~DeviceTime() = default;
|
||||
bool getGpuCpuTime(TimeStampData *pGpuCpuTime, OSTime *osTime, bool forceKmdCall);
|
||||
virtual bool getGpuCpuTimeImpl(TimeStampData *pGpuCpuTime, OSTime *osTime);
|
||||
virtual double getDynamicDeviceTimerResolution(HardwareInfo const &hwInfo) const;
|
||||
virtual uint64_t getDynamicDeviceTimerClock(HardwareInfo const &hwInfo) const;
|
||||
virtual double getDynamicDeviceTimerResolution() const;
|
||||
virtual uint64_t getDynamicDeviceTimerClock() const;
|
||||
virtual bool isTimestampsRefreshEnabled() const;
|
||||
bool getGpuCpuTimestamps(TimeStampData *timeStamp, OSTime *osTime, bool forceKmdCall);
|
||||
void setDeviceTimerResolution(HardwareInfo const &hwInfo);
|
||||
void setDeviceTimerResolution();
|
||||
void setRefreshTimestampsFlag() {
|
||||
refreshTimestamps = true;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ class OSTime {
|
||||
virtual double getHostTimerResolution() const;
|
||||
virtual uint64_t getCpuRawTimestamp();
|
||||
|
||||
static double getDeviceTimerResolution(HardwareInfo const &hwInfo);
|
||||
static double getDeviceTimerResolution();
|
||||
|
||||
bool getGpuCpuTime(TimeStampData *gpuCpuTime, bool forceKmdCall) {
|
||||
return deviceTime->getGpuCpuTime(gpuCpuTime, this, forceKmdCall);
|
||||
@@ -72,18 +72,18 @@ class OSTime {
|
||||
return deviceTime->getGpuCpuTime(gpuCpuTime, this, false);
|
||||
}
|
||||
|
||||
double getDynamicDeviceTimerResolution(HardwareInfo const &hwInfo) const {
|
||||
return deviceTime->getDynamicDeviceTimerResolution(hwInfo);
|
||||
double getDynamicDeviceTimerResolution() const {
|
||||
return deviceTime->getDynamicDeviceTimerResolution();
|
||||
}
|
||||
|
||||
uint64_t getDynamicDeviceTimerClock(HardwareInfo const &hwInfo) const {
|
||||
return deviceTime->getDynamicDeviceTimerClock(hwInfo);
|
||||
uint64_t getDynamicDeviceTimerClock() const {
|
||||
return deviceTime->getDynamicDeviceTimerClock();
|
||||
}
|
||||
|
||||
uint64_t getMaxGpuTimeStamp() const { return maxGpuTimeStamp; }
|
||||
|
||||
void setDeviceTimerResolution(HardwareInfo const &hwInfo) const {
|
||||
deviceTime->setDeviceTimerResolution(hwInfo);
|
||||
void setDeviceTimerResolution() const {
|
||||
deviceTime->setDeviceTimerResolution();
|
||||
}
|
||||
|
||||
void setDeviceTimestampWidth(uint32_t timestampWidth) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -53,7 +53,7 @@ DeviceTimeWddm::DeviceTimeWddm(Wddm *wddm) {
|
||||
this->wddm = wddm;
|
||||
}
|
||||
|
||||
double DeviceTimeWddm::getDynamicDeviceTimerResolution(HardwareInfo const &hwInfo) const {
|
||||
double DeviceTimeWddm::getDynamicDeviceTimerResolution() const {
|
||||
double retVal = 0u;
|
||||
if (wddm) {
|
||||
retVal = 1000000000.0 / static_cast<double>(wddm->getTimestampFrequency());
|
||||
@@ -62,7 +62,7 @@ double DeviceTimeWddm::getDynamicDeviceTimerResolution(HardwareInfo const &hwInf
|
||||
return retVal;
|
||||
}
|
||||
|
||||
uint64_t DeviceTimeWddm::getDynamicDeviceTimerClock(HardwareInfo const &hwInfo) const {
|
||||
uint64_t DeviceTimeWddm::getDynamicDeviceTimerClock() const {
|
||||
uint64_t retVal = 0u;
|
||||
if (wddm) {
|
||||
retVal = static_cast<uint64_t>(wddm->getTimestampFrequency());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -20,8 +20,8 @@ class DeviceTimeWddm : public DeviceTime {
|
||||
public:
|
||||
DeviceTimeWddm(Wddm *wddm);
|
||||
bool getGpuCpuTimeImpl(TimeStampData *pGpuCpuTime, OSTime *osTime) override;
|
||||
double getDynamicDeviceTimerResolution(HardwareInfo const &hwInfo) const override;
|
||||
uint64_t getDynamicDeviceTimerClock(HardwareInfo const &hwInfo) const override;
|
||||
double getDynamicDeviceTimerResolution() const override;
|
||||
uint64_t getDynamicDeviceTimerClock() const override;
|
||||
|
||||
protected:
|
||||
MOCKABLE_VIRTUAL bool runEscape(Wddm *wddm, TimeStampDataHeader &escapeInfo);
|
||||
|
||||
@@ -39,7 +39,6 @@ const RuntimeCapabilityTable BMG::capabilityTable{
|
||||
{0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties
|
||||
MemoryConstants::max48BitAddress, // gpuAddressSpace
|
||||
0, // sharedSystemMemCapabilities
|
||||
83.333, // defaultProfilingTimerResolution
|
||||
MemoryConstants::pageSize, // requiredPreemptionSurfaceSize
|
||||
"", // deviceName
|
||||
nullptr, // preferredPlatformName
|
||||
|
||||
@@ -38,7 +38,6 @@ const RuntimeCapabilityTable LNL::capabilityTable{
|
||||
{0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties
|
||||
MemoryConstants::max48BitAddress, // gpuAddressSpace
|
||||
0, // sharedSystemMemCapabilities
|
||||
83.333, // defaultProfilingTimerResolution
|
||||
MemoryConstants::pageSize, // requiredPreemptionSurfaceSize
|
||||
"", // deviceName
|
||||
nullptr, // preferredPlatformName
|
||||
|
||||
@@ -50,7 +50,6 @@ const RuntimeCapabilityTable PVC::capabilityTable{
|
||||
{0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties
|
||||
maxNBitValue(57), // gpuAddressSpace
|
||||
0, // sharedSystemMemCapabilities
|
||||
83.333, // defaultProfilingTimerResolution
|
||||
MemoryConstants::pageSize, // requiredPreemptionSurfaceSize
|
||||
"", // deviceName
|
||||
nullptr, // preferredPlatformName
|
||||
|
||||
@@ -35,7 +35,6 @@ const RuntimeCapabilityTable ARL::capabilityTable{
|
||||
{0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties
|
||||
MemoryConstants::max48BitAddress, // gpuAddressSpace
|
||||
0, // sharedSystemMemCapabilities
|
||||
83.333, // defaultProfilingTimerResolution
|
||||
MemoryConstants::pageSize, // requiredPreemptionSurfaceSize
|
||||
"", // deviceName
|
||||
nullptr, // preferredPlatformName
|
||||
|
||||
@@ -40,7 +40,6 @@ const RuntimeCapabilityTable DG2::capabilityTable{
|
||||
{0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties
|
||||
MemoryConstants::max48BitAddress, // gpuAddressSpace
|
||||
0, // sharedSystemMemCapabilities
|
||||
83.333, // defaultProfilingTimerResolution
|
||||
MemoryConstants::pageSize, // requiredPreemptionSurfaceSize
|
||||
"", // deviceName
|
||||
nullptr, // preferredPlatformName
|
||||
|
||||
@@ -36,7 +36,6 @@ const RuntimeCapabilityTable MTL::capabilityTable{
|
||||
{0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties
|
||||
MemoryConstants::max48BitAddress, // gpuAddressSpace
|
||||
0, // sharedSystemMemCapabilities
|
||||
83.333, // defaultProfilingTimerResolution
|
||||
MemoryConstants::pageSize, // requiredPreemptionSurfaceSize
|
||||
"", // deviceName
|
||||
nullptr, // preferredPlatformName
|
||||
|
||||
@@ -26,9 +26,9 @@ class MockDeviceTimeDrm : public DeviceTimeDrm {
|
||||
return getGpuCpuTimeImplResult;
|
||||
}
|
||||
|
||||
double getDynamicDeviceTimerResolution(HardwareInfo const &hwInfo) const override {
|
||||
double getDynamicDeviceTimerResolution() const override {
|
||||
if (callGetDynamicDeviceTimerResolution) {
|
||||
return DeviceTimeDrm::getDynamicDeviceTimerResolution(hwInfo);
|
||||
return DeviceTimeDrm::getDynamicDeviceTimerResolution();
|
||||
}
|
||||
return dynamicDeviceTimerResolutionValue;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ MockDevice::MockDevice(ExecutionEnvironment *executionEnvironment, uint32_t root
|
||||
auto &hwInfo = getHardwareInfo();
|
||||
if (!getOSTime()) {
|
||||
getRootDeviceEnvironmentRef().osTime = MockOSTime::create();
|
||||
getRootDeviceEnvironmentRef().osTime->setDeviceTimerResolution(hwInfo);
|
||||
getRootDeviceEnvironmentRef().osTime->setDeviceTimerResolution();
|
||||
}
|
||||
executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->setHwInfoAndInitHelpers(&hwInfo);
|
||||
UnitTestSetter::setRcsExposure(*executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -30,12 +30,12 @@ class MockDeviceTime : public DeviceTime {
|
||||
return true;
|
||||
}
|
||||
|
||||
double getDynamicDeviceTimerResolution(HardwareInfo const &hwInfo) const override {
|
||||
return OSTime::getDeviceTimerResolution(hwInfo);
|
||||
double getDynamicDeviceTimerResolution() const override {
|
||||
return OSTime::getDeviceTimerResolution();
|
||||
}
|
||||
|
||||
uint64_t getDynamicDeviceTimerClock(HardwareInfo const &hwInfo) const override {
|
||||
return static_cast<uint64_t>(1000000000.0 / OSTime::getDeviceTimerResolution(hwInfo));
|
||||
uint64_t getDynamicDeviceTimerClock() const override {
|
||||
return static_cast<uint64_t>(1000000000.0 / OSTime::getDeviceTimerResolution());
|
||||
}
|
||||
std::optional<uint64_t> gpuTimeStampResult{};
|
||||
std::optional<uint64_t> cpuTimeResult{};
|
||||
@@ -81,12 +81,12 @@ class MockDeviceTimeWithConstTimestamp : public DeviceTime {
|
||||
return true;
|
||||
}
|
||||
|
||||
double getDynamicDeviceTimerResolution(HardwareInfo const &hwInfo) const override {
|
||||
double getDynamicDeviceTimerResolution() const override {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
uint64_t getDynamicDeviceTimerClock(HardwareInfo const &hwInfo) const override {
|
||||
return static_cast<uint64_t>(1000000000.0 / OSTime::getDeviceTimerResolution(hwInfo));
|
||||
uint64_t getDynamicDeviceTimerClock() const override {
|
||||
return static_cast<uint64_t>(1000000000.0 / OSTime::getDeviceTimerResolution());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 Intel Corporation
|
||||
* Copyright (C) 2022-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -75,7 +75,7 @@ TEST_F(MockOSTimeWinTest, whenCreatingTimerThenResolutionIsSetCorrectly) {
|
||||
std::unique_ptr<MockOSTimeWin> timeWin(new MockOSTimeWin(wddmMock));
|
||||
|
||||
double res = 0.0;
|
||||
res = timeWin->getDynamicDeviceTimerResolution(device->getHardwareInfo());
|
||||
res = timeWin->getDynamicDeviceTimerResolution();
|
||||
EXPECT_EQ(res, 1e+06);
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ TEST(RootDeviceEnvironment, whenCreatingRootDeviceEnvironmentThenCreateOsAgnosti
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
executionEnvironment.rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
|
||||
auto profilingTimerResolution = defaultHwInfo->capabilityTable.defaultProfilingTimerResolution;
|
||||
auto profilingTimerResolution = CommonConstants::defaultProfilingTimerResolution;
|
||||
|
||||
auto rootDeviceEnvironment = static_cast<MockRootDeviceEnvironment *>(executionEnvironment.rootDeviceEnvironments[0].get());
|
||||
|
||||
@@ -109,8 +109,8 @@ TEST(RootDeviceEnvironment, whenCreatingRootDeviceEnvironmentThenCreateOsAgnosti
|
||||
EXPECT_EQ(0u, tsData.cpuTimeinNS);
|
||||
EXPECT_EQ(0u, tsData.gpuTimeStamp);
|
||||
|
||||
EXPECT_EQ(profilingTimerResolution, rootDeviceEnvironment->osTime->getDynamicDeviceTimerResolution(*defaultHwInfo));
|
||||
EXPECT_EQ(static_cast<uint64_t>(1000000000.0 / OSTime::getDeviceTimerResolution(*defaultHwInfo)), rootDeviceEnvironment->osTime->getDynamicDeviceTimerClock(*defaultHwInfo));
|
||||
EXPECT_EQ(profilingTimerResolution, rootDeviceEnvironment->osTime->getDynamicDeviceTimerResolution());
|
||||
EXPECT_EQ(static_cast<uint64_t>(1000000000.0 / OSTime::getDeviceTimerResolution()), rootDeviceEnvironment->osTime->getDynamicDeviceTimerClock());
|
||||
|
||||
struct MockOSTime : public OSTime {
|
||||
using OSTime::deviceTime;
|
||||
|
||||
@@ -49,8 +49,7 @@ struct DrmTimeTest : public ::testing::Test {
|
||||
osTime = MockOSTimeLinux::create(*rootDeviceEnvironment.osInterface);
|
||||
osTime->setResolutionFunc(resolutionFuncTrue);
|
||||
osTime->setGetTimeFunc(getTimeFuncTrue);
|
||||
auto hwInfo = rootDeviceEnvironment.getMutableHardwareInfo();
|
||||
osTime->setDeviceTimerResolution(*hwInfo);
|
||||
osTime->setDeviceTimerResolution();
|
||||
deviceTime = osTime->getDeviceTime();
|
||||
}
|
||||
|
||||
@@ -198,7 +197,7 @@ TEST_F(DrmTimeTest, GivenInvalidFuncTimeWhenGettingGpuCpuTimeCpuThenFails) {
|
||||
}
|
||||
|
||||
TEST_F(DrmTimeTest, givenGpuTimestampResolutionQueryWhenIoctlFailsThenDefaultResolutionIsReturned) {
|
||||
auto defaultResolution = defaultHwInfo->capabilityTable.defaultProfilingTimerResolution;
|
||||
auto defaultResolution = CommonConstants::defaultProfilingTimerResolution;
|
||||
|
||||
auto drm = DrmMockCustom::create(*executionEnvironment.rootDeviceEnvironments[0]).release();
|
||||
osTime->updateDrm(drm);
|
||||
@@ -206,12 +205,12 @@ TEST_F(DrmTimeTest, givenGpuTimestampResolutionQueryWhenIoctlFailsThenDefaultRes
|
||||
drm->getParamRetValue = 0;
|
||||
drm->ioctlRes = -1;
|
||||
deviceTime->callGetDynamicDeviceTimerResolution = true;
|
||||
auto result = osTime->getDynamicDeviceTimerResolution(*defaultHwInfo);
|
||||
auto result = osTime->getDynamicDeviceTimerResolution();
|
||||
EXPECT_DOUBLE_EQ(result, defaultResolution);
|
||||
}
|
||||
|
||||
TEST_F(DrmTimeTest, givenGetDynamicDeviceTimerClockWhenIoctlFailsThenDefaultClockIsReturned) {
|
||||
auto defaultResolution = defaultHwInfo->capabilityTable.defaultProfilingTimerResolution;
|
||||
auto defaultResolution = CommonConstants::defaultProfilingTimerResolution;
|
||||
|
||||
auto drm = DrmMockCustom::create(*executionEnvironment.rootDeviceEnvironments[0]).release();
|
||||
osTime->updateDrm(drm);
|
||||
@@ -219,7 +218,7 @@ TEST_F(DrmTimeTest, givenGetDynamicDeviceTimerClockWhenIoctlFailsThenDefaultCloc
|
||||
drm->getParamRetValue = 0;
|
||||
drm->ioctlRes = -1;
|
||||
|
||||
auto result = osTime->getDynamicDeviceTimerClock(*defaultHwInfo);
|
||||
auto result = osTime->getDynamicDeviceTimerClock();
|
||||
auto expectedResult = static_cast<uint64_t>(1000000000.0 / defaultResolution);
|
||||
EXPECT_EQ(result, expectedResult);
|
||||
}
|
||||
@@ -231,7 +230,7 @@ TEST_F(DrmTimeTest, givenGetDynamicDeviceTimerClockWhenIoctlSucceedsThenNonDefau
|
||||
uint64_t frequency = 1500;
|
||||
drm->getParamRetValue = static_cast<int>(frequency);
|
||||
|
||||
auto result = osTime->getDynamicDeviceTimerClock(*defaultHwInfo);
|
||||
auto result = osTime->getDynamicDeviceTimerClock();
|
||||
EXPECT_EQ(result, frequency);
|
||||
}
|
||||
|
||||
@@ -243,7 +242,7 @@ TEST_F(DrmTimeTest, givenGpuTimestampResolutionQueryWhenIoctlSuccedsThenCorrectR
|
||||
drm->getParamRetValue = 19200000;
|
||||
drm->ioctlRes = 0;
|
||||
deviceTime->callGetDynamicDeviceTimerResolution = true;
|
||||
auto result = osTime->getDynamicDeviceTimerResolution(*defaultHwInfo);
|
||||
auto result = osTime->getDynamicDeviceTimerResolution();
|
||||
EXPECT_DOUBLE_EQ(result, 52.08333333333333);
|
||||
}
|
||||
|
||||
@@ -292,11 +291,10 @@ TEST_F(DrmTimeTest, whenGettingGpuTimeStampValueWithinIntervalThenReuseFromPrevi
|
||||
|
||||
// Recreate mock to apply debug flag
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
osTime = MockOSTimeLinux::create(*rootDeviceEnvironment.osInterface);
|
||||
osTime->setResolutionFunc(resolutionFuncTrue);
|
||||
osTime->setGetTimeFunc(getTimeFuncTrue);
|
||||
osTime->setDeviceTimerResolution(*hwInfo);
|
||||
osTime->setDeviceTimerResolution();
|
||||
auto deviceTime = osTime->getDeviceTime();
|
||||
|
||||
EXPECT_EQ(deviceTime->getGpuCpuTimeImplCalled, 0u);
|
||||
@@ -314,7 +312,7 @@ TEST_F(DrmTimeTest, whenGettingGpuTimeStampValueWithinIntervalThenReuseFromPrevi
|
||||
auto cpuTimeAfter = actualTime;
|
||||
|
||||
auto cpuTimeDiff = cpuTimeAfter - cpuTimeBefore;
|
||||
auto deviceTimerResolution = deviceTime->getDynamicDeviceTimerResolution(*hwInfo);
|
||||
auto deviceTimerResolution = deviceTime->getDynamicDeviceTimerResolution();
|
||||
auto gpuTimestampDiff = static_cast<uint64_t>(cpuTimeDiff / deviceTimerResolution);
|
||||
EXPECT_EQ(gpuTimestampAfter, gpuTimestampBefore + gpuTimestampDiff);
|
||||
}
|
||||
@@ -325,11 +323,10 @@ TEST_F(DrmTimeTest, whenGettingGpuTimeStampValueAfterIntervalThenCallToKmdAndAda
|
||||
|
||||
// Recreate mock to apply debug flag
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
osTime = MockOSTimeLinux::create(*rootDeviceEnvironment.osInterface);
|
||||
osTime->setResolutionFunc(resolutionFuncTrue);
|
||||
osTime->setGetTimeFunc(getTimeFuncTrue);
|
||||
osTime->setDeviceTimerResolution(*hwInfo);
|
||||
osTime->setDeviceTimerResolution();
|
||||
auto deviceTime = osTime->getDeviceTime();
|
||||
deviceTime->callBaseGetGpuCpuTimeImpl = false;
|
||||
EXPECT_EQ(deviceTime->getGpuCpuTimeImplCalled, 0u);
|
||||
|
||||
@@ -35,7 +35,7 @@ class MockDeviceTimeWin : public MockDeviceTime {
|
||||
return getGpuCpuTimeImplResult;
|
||||
}
|
||||
|
||||
double getDynamicDeviceTimerResolution(HardwareInfo const &hwInfo) const override {
|
||||
double getDynamicDeviceTimerResolution() const override {
|
||||
return deviceTimerResolution;
|
||||
}
|
||||
|
||||
@@ -53,8 +53,7 @@ struct OSTimeWinTest : public ::testing::Test {
|
||||
rootDeviceEnvironment.osInterface = std::make_unique<OSInterface>();
|
||||
rootDeviceEnvironment.osInterface->setDriverModel(std::unique_ptr<DriverModel>(wddm));
|
||||
osTime = std::unique_ptr<MockOSTimeWin>(new MockOSTimeWin(*rootDeviceEnvironment.osInterface));
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
osTime->setDeviceTimerResolution(*hwInfo);
|
||||
osTime->setDeviceTimerResolution();
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
@@ -64,11 +63,9 @@ struct OSTimeWinTest : public ::testing::Test {
|
||||
};
|
||||
|
||||
TEST_F(OSTimeWinTest, given36BitGpuTimeStampWhenGpuTimeStampOverflowThenGpuTimeDoesNotDecrease) {
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
auto deviceTime = new MockDeviceTimeWin();
|
||||
osTime->deviceTime.reset(deviceTime);
|
||||
osTime->setDeviceTimerResolution(*hwInfo);
|
||||
osTime->setDeviceTimerResolution();
|
||||
|
||||
TimeStampData gpuCpuTime = {0ull, 0ull};
|
||||
|
||||
@@ -100,11 +97,9 @@ TEST_F(OSTimeWinTest, given36BitGpuTimeStampWhenGpuTimeStampOverflowThenGpuTimeD
|
||||
}
|
||||
|
||||
TEST_F(OSTimeWinTest, given64BitGpuTimeStampWhenGpuTimeStampOverflowThenOverflowsAreNotDetected) {
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
auto deviceTime = new MockDeviceTimeWin();
|
||||
osTime->deviceTime.reset(deviceTime);
|
||||
osTime->setDeviceTimerResolution(*hwInfo);
|
||||
osTime->setDeviceTimerResolution();
|
||||
|
||||
TimeStampData gpuCpuTime = {0ull, 0ull};
|
||||
|
||||
@@ -195,8 +190,7 @@ TEST(OSTimeWinTests, givenOSInterfaceWhenGetGpuCpuTimeThenReturnsSuccess) {
|
||||
rootDeviceEnvironment.osInterface->setDriverModel(std::unique_ptr<DriverModel>(wddm));
|
||||
wddm->init();
|
||||
auto osTime = OSTime::create(rootDeviceEnvironment.osInterface.get());
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
osTime->setDeviceTimerResolution(*hwInfo);
|
||||
osTime->setDeviceTimerResolution();
|
||||
auto success = osTime->getGpuCpuTime(&gpuCpuTime01);
|
||||
EXPECT_TRUE(success);
|
||||
EXPECT_NE(0u, gpuCpuTime01.cpuTimeinNS);
|
||||
@@ -226,9 +220,7 @@ TEST_F(OSTimeWinTest, whenGettingMaxGpuTimeStampValueWithinIntervalThenReuseFrom
|
||||
|
||||
auto deviceTime = new MockDeviceTimeWin();
|
||||
osTime->deviceTime.reset(deviceTime);
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
osTime->setDeviceTimerResolution(*hwInfo);
|
||||
osTime->setDeviceTimerResolution();
|
||||
|
||||
EXPECT_EQ(deviceTime->getGpuCpuTimeImplCalled, 0u);
|
||||
TimeStampData gpuCpuTime;
|
||||
@@ -248,7 +240,7 @@ TEST_F(OSTimeWinTest, whenGettingMaxGpuTimeStampValueWithinIntervalThenReuseFrom
|
||||
|
||||
auto cpuTimeDiff = cpuTimeAfter - cpuTimeBefore;
|
||||
|
||||
auto deviceTimerResolution = deviceTime->getDynamicDeviceTimerResolution(*hwInfo);
|
||||
auto deviceTimerResolution = deviceTime->getDynamicDeviceTimerResolution();
|
||||
auto gpuTimestampDiff = static_cast<uint64_t>(cpuTimeDiff / deviceTimerResolution);
|
||||
EXPECT_EQ(gpuTimestampAfter, gpuTimestampBefore + gpuTimestampDiff);
|
||||
}
|
||||
@@ -260,11 +252,9 @@ TEST_F(OSTimeWinTest, whenGettingGpuTimeStampValueAfterIntervalThenCallToKmdAndA
|
||||
osTime->setFrequency(frequency);
|
||||
|
||||
// Recreate mock to apply debug flag
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
auto deviceTime = new MockDeviceTimeWin();
|
||||
osTime->deviceTime.reset(deviceTime);
|
||||
osTime->setDeviceTimerResolution(*hwInfo);
|
||||
osTime->setDeviceTimerResolution();
|
||||
EXPECT_EQ(deviceTime->getGpuCpuTimeImplCalled, 0u);
|
||||
|
||||
const auto initialExpectedTimeoutNS = NSEC_PER_MSEC * 100;
|
||||
@@ -312,11 +302,9 @@ TEST_F(OSTimeWinTest, whenGetGpuCpuTimeFailedThenReturnFalse) {
|
||||
|
||||
TEST_F(OSTimeWinTest, whenGettingMaxGpuTimeStampValueAfterFlagSetThenCallToKmd) {
|
||||
TimeStampData gpuCpuTime;
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
auto deviceTime = new MockDeviceTimeWin();
|
||||
osTime->deviceTime.reset(deviceTime);
|
||||
osTime->setDeviceTimerResolution(*hwInfo);
|
||||
osTime->setDeviceTimerResolution();
|
||||
|
||||
EXPECT_EQ(deviceTime->getGpuCpuTimeImplCalled, 0u);
|
||||
deviceTime->gpuCpuTimeValue = {1u, 1u};
|
||||
@@ -336,9 +324,7 @@ TEST_F(OSTimeWinTest, whenGettingMaxGpuTimeStampValueWhenForceFlagSetThenCallToK
|
||||
|
||||
auto deviceTime = new MockDeviceTimeWin();
|
||||
osTime->deviceTime.reset(deviceTime);
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
osTime->setDeviceTimerResolution(*hwInfo);
|
||||
osTime->setDeviceTimerResolution();
|
||||
|
||||
EXPECT_EQ(deviceTime->getGpuCpuTimeImplCalled, 0u);
|
||||
TimeStampData gpuCpuTime;
|
||||
@@ -355,11 +341,9 @@ TEST_F(OSTimeWinTest, whenGettingMaxGpuTimeStampValueWhenForceFlagSetThenCallToK
|
||||
TEST_F(OSTimeWinTest, givenReusingTimestampsDisabledWhenGetGpuCpuTimeThenAlwaysCallKmd) {
|
||||
DebugManagerStateRestore restore;
|
||||
debugManager.flags.EnableReusingGpuTimestamps.set(0);
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
auto deviceTime = new MockDeviceTimeWin();
|
||||
osTime->deviceTime.reset(deviceTime);
|
||||
osTime->setDeviceTimerResolution(*hwInfo);
|
||||
osTime->setDeviceTimerResolution();
|
||||
TimeStampData gpuCpuTime;
|
||||
osTime->getGpuCpuTime(&gpuCpuTime);
|
||||
EXPECT_EQ(deviceTime->getGpuCpuTimeImplCalled, 1u);
|
||||
|
||||
@@ -85,7 +85,6 @@ TEST(Wddm20EnumAdaptersTest, givenEmptyHardwareInfoWhenEnumAdapterIsCalledThenCa
|
||||
|
||||
EXPECT_EQ(outHwInfo.platform.eDisplayCoreFamily, hwInfo->platform.eDisplayCoreFamily);
|
||||
|
||||
EXPECT_EQ(outHwInfo.capabilityTable.defaultProfilingTimerResolution, hwInfo->capabilityTable.defaultProfilingTimerResolution);
|
||||
EXPECT_EQ(outHwInfo.capabilityTable.clVersionSupport, hwInfo->capabilityTable.clVersionSupport);
|
||||
EXPECT_EQ(outHwInfo.capabilityTable.kmdNotifyProperties.enableKmdNotify, hwInfo->capabilityTable.kmdNotifyProperties.enableKmdNotify);
|
||||
EXPECT_EQ(outHwInfo.capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds, hwInfo->capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);
|
||||
|
||||
Reference in New Issue
Block a user