Add hipDeviceAttributeExpertSchedMode (#2435)
* Add hipDeviceAttributeExpertSchedMode --------- Co-authored-by: Stefan Sokolovic <stefan.sokolovic2@amd.com> * Update hipDeviceAttributeExpertSchedMode unit test * Move check to ROCr from thunk interface * Revert unrelated whitespace changes * Revert version bump --------- Co-authored-by: Stefan Sokolovic <stefan.sokolovic2@amd.com>
This commit is contained in:
@@ -457,6 +457,9 @@ hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int device)
|
||||
case hipDeviceAttributeHostNumaId:
|
||||
*pi = static_cast<int>(g_devices[device]->devices()[0]->getPreferredNumaNode());
|
||||
break;
|
||||
case hipDeviceAttributeExpertSchedMode:
|
||||
*pi = static_cast<int>(g_devices[device]->devices()[0]->info().hasExpertSchedMode_);
|
||||
break;
|
||||
default:
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
@@ -667,6 +667,8 @@ struct Info : public amd::EmbeddedObject {
|
||||
size_t scratchLimitMax; //! Maximum size of scratch limit of this device memory in bytes.
|
||||
|
||||
uint32_t numberOfXccs_; //! The number of XCC(s) on the device
|
||||
|
||||
bool hasExpertSchedMode_; //! Device supports expert scheduling mode
|
||||
};
|
||||
|
||||
//! Device settings
|
||||
|
||||
@@ -1638,6 +1638,14 @@ bool Device::populateOCLDeviceConstants() {
|
||||
LogError("HSA_AMD_AGENT_INFO_PM4_EMULATION query failed.");
|
||||
}
|
||||
|
||||
info_.hasExpertSchedMode_ = false;
|
||||
if (HSA_STATUS_SUCCESS !=
|
||||
Hsa::agent_get_info(bkendDevice_,
|
||||
static_cast<hsa_agent_info_t>(HSA_AMD_AGENT_INFO_HAS_EXPERT_SCHED_MODE),
|
||||
&info_.hasExpertSchedMode_)) {
|
||||
LogWarning("HSA_AMD_AGENT_INFO_HAS_EXPERT_SCHED_MODE query failed.");
|
||||
}
|
||||
|
||||
ClPrint(amd::LOG_INFO, amd::LOG_INIT, "Gfx Major/Minor/Stepping: %d/%d/%d", isa().versionMajor(),
|
||||
isa().versionMinor(), isa().versionStepping());
|
||||
ClPrint(amd::LOG_INFO, amd::LOG_INIT, "HMM support: %d, XNACK: %d, Direct host access: %d",
|
||||
|
||||
Reference in New Issue
Block a user