This repository was archived by the owner on Jan 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -556,6 +556,10 @@ struct Info : public amd::EmbeddedObject {
556556
557557 // ! Target ID string
558558 char targetId_[0x40 ];
559+
560+ uint32_t hmmSupported_; // !< ROCr supports HMM interfaces
561+ uint32_t hmmCpuMemoryAccessible_; // !< CPU memory is accessible by GPU without pinning/register
562+ uint32_t hmmDirectHostAccess_; // !< HMM memory is accessible from the host without migration
559563};
560564
561565// ! Device settings
Original file line number Diff line number Diff line change @@ -1418,7 +1418,7 @@ bool Device::populateOCLDeviceConstants() {
14181418 return false ;
14191419 }
14201420
1421- uint32_t asic_revision;
1421+ uint32_t asic_revision = 0 ;
14221422 if (HSA_STATUS_SUCCESS !=
14231423 hsa_agent_get_info (_bkendDevice,
14241424 static_cast <hsa_agent_info_t >(HSA_AMD_AGENT_INFO_ASIC_REVISION),
@@ -1470,6 +1470,21 @@ bool Device::populateOCLDeviceConstants() {
14701470 ? (atoi (sgprValue.c_str ()))
14711471 : 0 ;
14721472 }
1473+
1474+ #if AMD_HMM_SUPPORT
1475+ // Generic support for HMM interfaces
1476+ if (HSA_STATUS_SUCCESS != hsa_system_get_info (HSA_AMD_SYSTEM_INFO_SVM_SUPPORTED,
1477+ &info_.hmmSupported_ )) {
1478+ LogError (" HSA_AMD_SYSTEM_INFO_SVM_SUPPORTED query failed. HMM will be disabled" );
1479+ }
1480+
1481+ // This capability should be available with xnack enabled
1482+ if (HSA_STATUS_SUCCESS != hsa_system_get_info (HSA_AMD_SYSTEM_INFO_SVM_ACCESSIBLE_BY_DEFAULT,
1483+ &info_.hmmCpuMemoryAccessible_ )) {
1484+ LogError (" HSA_AMD_SYSTEM_INFO_SVM_ACCESSIBLE_BY_DEFAULT query failed." );
1485+ }
1486+ #endif // AMD_HMM_SUPPORT
1487+
14731488 return true ;
14741489}
14751490
You can’t perform that action at this time.
0 commit comments