SWDEV-286739 - Support hipDeviceAttributeWallClockRate

Part 1: Query constant frequence of wall clock from RocR

Change-Id: I52cbba6d67d11cde6d019c5ab530059f426a9bf2
This commit is contained in:
Tao Sang
2022-07-08 21:59:42 -04:00
committed by Tao Sang
parent 175ad024d3
commit 1e26165cd0
3 changed files with 12 additions and 0 deletions
+8
View File
@@ -1164,6 +1164,14 @@ bool Device::populateOCLDeviceConstants() {
return false;
}
uint64_t wallClockFrequency = 0; // in Hz
if (HSA_STATUS_SUCCESS !=
hsa_agent_get_info(bkendDevice_, (hsa_agent_info_t)HSA_AMD_AGENT_INFO_TIMESTAMP_FREQUENCY ,
&wallClockFrequency)) {
LogWarning("HSA_AMD_AGENT_INFO_TIMESTAMP_FREQUENCY cannot be queried. Ignored!");
}
info_.wallClockFrequency_ = static_cast<uint32_t>(wallClockFrequency / 1000); // in KHz
if (HSA_STATUS_SUCCESS !=
hsa_agent_get_info(bkendDevice_,
static_cast<hsa_agent_info_t>(HSA_AMD_AGENT_INFO_MEMORY_WIDTH),