diff --git a/projects/clr/rocclr/device/device.hpp b/projects/clr/rocclr/device/device.hpp index 05c25b8911..5c6f12e79b 100644 --- a/projects/clr/rocclr/device/device.hpp +++ b/projects/clr/rocclr/device/device.hpp @@ -461,6 +461,12 @@ struct Info : public amd::EmbeddedObject { //! Returns PCI Bus Domain ID uint32_t pciDomainID; + //! Returns sddress of HDP_MEM_COHERENCY_FLUSH_CNTL register + uint32_t* hdpMemFlushCntl; + + //! Returns sddress of HDP_REG_COHERENCY_FLUSH_CNTL register + uint32_t* hdpRegFlushCntl; + //! Semaphore information uint32_t maxSemaphores_; uint32_t maxSemaphoreSize_; diff --git a/projects/clr/rocclr/device/rocm/rocdevice.cpp b/projects/clr/rocclr/device/rocm/rocdevice.cpp index 53e8958b5d..f1d831c6fc 100644 --- a/projects/clr/rocclr/device/rocm/rocdevice.cpp +++ b/projects/clr/rocclr/device/rocm/rocdevice.cpp @@ -710,6 +710,17 @@ bool Device::create() { } #endif + // Get Agent HDP Flush Register Memory + hsa_amd_hdp_flush_t hdpInfo; + if (HSA_STATUS_SUCCESS != + hsa_agent_get_info(_bkendDevice, + static_cast(HSA_AMD_AGENT_INFO_HDP_FLUSH), &hdpInfo)) { + LogPrintfError("Unable to determine HDP flush info for HSA device %s", agent_name); + return false; + } + info_.hdpMemFlushCntl = hdpInfo.HDP_MEM_FLUSH_CNTL; + info_.hdpRegFlushCntl = hdpInfo.HDP_REG_FLUSH_CNTL; + if (populateOCLDeviceConstants() == false) { LogPrintfError("populateOCLDeviceConstants failed for HSA device %s (PCI ID %x)", agent_name, pciDeviceId_);