mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Windows: Use timestamp frequency from adapter info
Related-To: NEO-5435 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
0ca1cdc565
commit
2b0b2231a7
@@ -99,11 +99,9 @@ double OSTimeWin::getHostTimerResolution() const {
|
||||
}
|
||||
|
||||
double OSTimeWin::getDynamicDeviceTimerResolution(HardwareInfo const &hwInfo) const {
|
||||
double retVal = 0;
|
||||
TimeStampDataHeader escapeInfo = {0};
|
||||
|
||||
if (runEscape(wddm, escapeInfo)) {
|
||||
retVal = 1000000000.0 / (double)escapeInfo.m_Data.m_Out.gpuPerfFreq;
|
||||
double retVal = 0u;
|
||||
if (wddm) {
|
||||
retVal = 1000000000.0 / static_cast<double>(wddm->getTimestampFrequency());
|
||||
}
|
||||
|
||||
return retVal;
|
||||
|
||||
@@ -150,6 +150,7 @@ bool Wddm::queryAdapterInfo() {
|
||||
systemSharedMemory = adapterInfo.SystemSharedMemory;
|
||||
dedicatedVideoMemory = adapterInfo.DedicatedVideoMemory;
|
||||
maxRenderFrequency = adapterInfo.MaxRenderFreq;
|
||||
timestampFrequency = adapterInfo.GfxTimeStampFreq;
|
||||
instrumentationEnabled = adapterInfo.Caps.InstrumentationIsEnabled != 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -161,6 +161,8 @@ class Wddm {
|
||||
|
||||
const RootDeviceEnvironment &getRootDeviceEnvironment() const { return rootDeviceEnvironment; }
|
||||
|
||||
const uint32_t getTimestampFrequency() const { return timestampFrequency; }
|
||||
|
||||
protected:
|
||||
std::unique_ptr<HwDeviceId> hwDeviceId;
|
||||
D3DKMT_HANDLE device = 0;
|
||||
@@ -180,6 +182,7 @@ class Wddm {
|
||||
uint64_t systemSharedMemory = 0;
|
||||
uint64_t dedicatedVideoMemory = 0;
|
||||
uint32_t maxRenderFrequency = 0;
|
||||
uint32_t timestampFrequency = 0u;
|
||||
bool instrumentationEnabled = false;
|
||||
std::string deviceRegistryPath;
|
||||
RootDeviceEnvironment &rootDeviceEnvironment;
|
||||
|
||||
Reference in New Issue
Block a user