@@ -705,6 +705,27 @@ bool Device::create() {
705705 return false ;
706706 }
707707
708+ setupCpuAgent ();
709+
710+ // Get Agent HDP Flush Register Memory
711+ hsa_amd_hdp_flush_t hdpInfo;
712+ if (HSA_STATUS_SUCCESS !=
713+ hsa_agent_get_info (bkendDevice_,
714+ static_cast <hsa_agent_info_t >(HSA_AMD_AGENT_INFO_HDP_FLUSH), &hdpInfo)) {
715+ LogPrintfError (" Unable to determine HDP flush info for HSA device %s" , agent_name);
716+ return false ;
717+ }
718+
719+ info_.hdpMemFlushCntl = hdpInfo.HDP_MEM_FLUSH_CNTL ;
720+ info_.hdpRegFlushCntl = hdpInfo.HDP_REG_FLUSH_CNTL ;
721+
722+ bool device_kernel_args = true ;
723+ if (!isXgmi_ && ((info_.hdpMemFlushCntl == nullptr ) || (info_.hdpRegFlushCntl == nullptr ))) {
724+ LogWarning (" Unable to determine HDP flush register address. "
725+ " Device kernel arguments are not supported" );
726+ device_kernel_args = false ;
727+ }
728+
708729 // Create HSA settings
709730 assert (!settings_);
710731 roc::Settings* hsaSettings = new roc::Settings ();
@@ -713,7 +734,7 @@ bool Device::create() {
713734 !hsaSettings->create ((agent_profile_ == HSA_PROFILE_FULL), isa->versionMajor (),
714735 isa->versionMinor (), isa->versionStepping (),
715736 isa->xnack () == amd::Isa::Feature::Enabled,
716- coop_groups)) {
737+ coop_groups, device_kernel_args )) {
717738 LogPrintfError (" Unable to create settings for HSA device %s (PCI ID %x)" , agent_name,
718739 pciDeviceId_);
719740 return false ;
@@ -754,17 +775,6 @@ bool Device::create() {
754775 }
755776 info_.pciDomainID = pci_domain_id;
756777
757- // Get Agent HDP Flush Register Memory
758- hsa_amd_hdp_flush_t hdpInfo;
759- if (HSA_STATUS_SUCCESS !=
760- hsa_agent_get_info (bkendDevice_,
761- static_cast <hsa_agent_info_t >(HSA_AMD_AGENT_INFO_HDP_FLUSH), &hdpInfo)) {
762- LogPrintfError (" Unable to determine HDP flush info for HSA device %s" , agent_name);
763- return false ;
764- }
765- info_.hdpMemFlushCntl = hdpInfo.HDP_MEM_FLUSH_CNTL ;
766- info_.hdpRegFlushCntl = hdpInfo.HDP_REG_FLUSH_CNTL ;
767-
768778 if (populateOCLDeviceConstants () == false ) {
769779 LogPrintfError (" populateOCLDeviceConstants failed for HSA device %s (PCI ID %x)" , agent_name,
770780 pciDeviceId_);
@@ -1257,7 +1267,6 @@ bool Device::populateOCLDeviceConstants() {
12571267 engineAssignMap_[1 << i] = 0 ;
12581268 }
12591269
1260- setupCpuAgent ();
12611270
12621271 checkAtomicSupport ();
12631272
0 commit comments