libhsakmt: add OverrideEngineId property

When HSA_OVERRIDE_GFX_VERSION is used, save the overrided GFX
version to OverrideEngineId instead of original EngineId. There
are places where real GFX properties still needed, e.g. CWSR size
calculation.

Change-Id: I9d9149bae465b7cfe55604fc19e7ca34e48b7b1c
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>


[ROCm/ROCR-Runtime commit: 3f1f68c8cb]
このコミットが含まれているのは:
Yifan Zhang
2024-08-15 17:10:38 +08:00
committed by David Yat Sin
コミット 45979fdfc7
3個のファイルの変更30行の追加11行の削除
+23 -7
ファイルの表示
@@ -127,10 +127,20 @@ GpuAgent::GpuAgent(HSAuint32 node, const HsaNodeProperties& node_props, bool xna
historical_clock_ratio_ = 0.0;
assert(err == HSAKMT_STATUS_SUCCESS && "hsaGetClockCounters error");
const core::Isa *isa_base = core::IsaRegistry::GetIsa(
core::Isa::Version(node_props.EngineId.ui32.Major,
node_props.EngineId.ui32.Minor,
node_props.EngineId.ui32.Stepping));
const core::Isa *isa_base;
if (node_props.OverrideEngineId.Value != 0) {
isa_base = core::IsaRegistry::GetIsa(
core::Isa::Version(node_props.OverrideEngineId.ui32.Major,
node_props.OverrideEngineId.ui32.Minor,
node_props.OverrideEngineId.ui32.Stepping));
} else {
isa_base = core::IsaRegistry::GetIsa(
core::Isa::Version(node_props.EngineId.ui32.Major,
node_props.EngineId.ui32.Minor,
node_props.EngineId.ui32.Stepping));
}
if (!isa_base) {
throw AMD::hsa_exception(HSA_STATUS_ERROR_INVALID_ISA, "Agent creation failed.\nThe GPU node has an unrecognized id.\n");
}
@@ -158,10 +168,16 @@ GpuAgent::GpuAgent(HSAuint32 node, const HsaNodeProperties& node_props, bool xna
: core::IsaFeature::Disabled;
}
if (node_props.OverrideEngineId.Value != 0) {
isa_ = (core::Isa*)core::IsaRegistry::GetIsa(
core::Isa::Version(node_props.OverrideEngineId.ui32.Major, node_props.OverrideEngineId.ui32.Minor,
node_props.OverrideEngineId.ui32.Stepping), sramecc, xnack);
} else {
// Set instruction set architecture via node property, only on GPU device.
isa_ = (core::Isa*)core::IsaRegistry::GetIsa(
core::Isa::Version(node_props.EngineId.ui32.Major, node_props.EngineId.ui32.Minor,
node_props.EngineId.ui32.Stepping), sramecc, xnack);
isa_ = (core::Isa*)core::IsaRegistry::GetIsa(
core::Isa::Version(node_props.EngineId.ui32.Major, node_props.EngineId.ui32.Minor,
node_props.EngineId.ui32.Stepping), sramecc, xnack);
}
assert(isa_ != nullptr && "ISA registry inconsistency.");