From d47db14a328a74415ac1cb8c649ab90eb82492a6 Mon Sep 17 00:00:00 2001 From: Jason Tang Date: Tue, 1 Dec 2020 18:33:25 -0500 Subject: [PATCH] SWDEV-260632 - [PAL] Report correct Target ID Change-Id: Ia39395e2c02e7c95b3df93be1f8030b4fa734583 [ROCm/clr commit: 054f25658919efce840a10b6a0b56d8163f5c204] --- projects/clr/rocclr/device/pal/paldefs.hpp | 44 ++++++++++---------- projects/clr/rocclr/device/pal/paldevice.cpp | 19 +++++++-- 2 files changed, 38 insertions(+), 25 deletions(-) diff --git a/projects/clr/rocclr/device/pal/paldefs.hpp b/projects/clr/rocclr/device/pal/paldefs.hpp index 9f3cbfda19..a8a2b26640 100644 --- a/projects/clr/rocclr/device/pal/paldefs.hpp +++ b/projects/clr/rocclr/device/pal/paldefs.hpp @@ -142,6 +142,8 @@ struct AMDDeviceInfo { uint gfxipVersion_; //!< The core engine GFXIP version bool xnackEnabled_; //!< Enable XNACK feature Pal::AsicRevision asicRevision_; //!< PAL AsicRevision + bool xnackSupported_; //!< XNACK is supported + bool srameccSumpported_; //!< SRAMECC is supported }; static constexpr AMDDeviceInfo UnknownDevice = {"", "", 16, 256, 32, 0, 0, false}; @@ -177,27 +179,27 @@ static constexpr AMDDeviceInfo DeviceInfo[] = { }; static constexpr AMDDeviceInfo Gfx9PlusSubDeviceInfo[] = { - /* Vega10 */ {"gfx900", "gfx900", 16, 256, 32, 900, 900, false, Pal::AsicRevision::Vega10}, - /* Vega10 XNACK */ {"gfx901", "gfx900", 16, 256, 32, 900, 901, true, Pal::AsicRevision::Vega10}, - /* Vega12 */ {"gfx904", "gfx904", 16, 256, 32, 904, 904, false, Pal::AsicRevision::Vega12}, - /* Vega12 XNACK */ {"gfx905", "gfx904", 16, 256, 32, 904, 905, true, Pal::AsicRevision::Vega12}, - /* Vega20 */ {"gfx906", "gfx906", 16, 256, 32, 906, 906, false, Pal::AsicRevision::Vega20}, - /* Vega20 XNACK */ {"gfx907", "gfx906", 16, 256, 32, 906, 907, true, Pal::AsicRevision::Vega20}, - /* Raven */ {"gfx902", "gfx902", 16, 256, 32, 902, 902, false, Pal::AsicRevision::Raven}, - /* Raven XNACK */ {"gfx903", "gfx902", 16, 256, 32, 902, 903, true, Pal::AsicRevision::Raven}, - /* Raven2 */ {"gfx902", "gfx902", 16, 256, 32, 902, 902, false, Pal::AsicRevision::Raven2}, - /* Raven2 XNACK */ {"gfx903", "gfx902", 16, 256, 32, 902, 903, true, Pal::AsicRevision::Raven2}, - /* Renoir */ {"gfx902", "gfx902", 16, 256, 32, 902, 902, false, Pal::AsicRevision::Renoir}, - /* Renoir XNACK */ {"gfx903", "gfx902", 16, 256, 32, 902, 903, true, Pal::AsicRevision::Renoir}, - /* Navi10 */ {"gfx1010", "gfx1010", 32, 256, 32, 1010, 1010, false, Pal::AsicRevision::Navi10}, - /* Navi10 XNACK */ {"gfx1010", "gfx1010", 32, 256, 32, 1010, 1010, true, Pal::AsicRevision::Navi10}, - /* Navi12 */ {"gfx1011", "gfx1011", 32, 256, 32, 1011, 1011, false, Pal::AsicRevision::Navi12}, - /* Navi12 XNACK */ {"gfx1011", "gfx1011", 32, 256, 32, 1011, 1011, true, Pal::AsicRevision::Navi12}, - /* Navi14 */ {"gfx1012", "gfx1012", 32, 256, 32, 1012, 1012, false, Pal::AsicRevision::Navi14}, - /* Navi14 XNACK */ {"gfx1012", "gfx1012", 32, 256, 32, 1012, 1012, true, Pal::AsicRevision::Navi14}, - /* Navi21 */ {"gfx1030", "gfx1030", 32, 256, 32, 1030, 1030, false, Pal::AsicRevision::Navi21}, - /* Navi22 */ {"gfx1031", "gfx1031", 32, 256, 32, 1031, 1031, false, Pal::AsicRevision::Navi22}, - /* Navi23 */ {"gfx1032", "gfx1032", 32, 256, 32, 1032, 1032, false, Pal::AsicRevision::Navi23}, + /* Vega10 */ {"gfx900", "gfx900", 16, 256, 32, 900, 900, false, Pal::AsicRevision::Vega10, true, false}, + /* Vega10 XNACK */ {"gfx901", "gfx900", 16, 256, 32, 900, 901, true, Pal::AsicRevision::Vega10, true, false}, + /* Vega12 */ {"gfx904", "gfx904", 16, 256, 32, 904, 904, false, Pal::AsicRevision::Vega12, true, false}, + /* Vega12 XNACK */ {"gfx905", "gfx904", 16, 256, 32, 904, 905, true, Pal::AsicRevision::Vega12, true, false}, + /* Vega20 */ {"gfx906", "gfx906", 16, 256, 32, 906, 906, false, Pal::AsicRevision::Vega20, true, true}, + /* Vega20 XNACK */ {"gfx907", "gfx906", 16, 256, 32, 906, 907, true, Pal::AsicRevision::Vega20, true, true}, + /* Raven */ {"gfx902", "gfx902", 16, 256, 32, 902, 902, false, Pal::AsicRevision::Raven, true, false}, + /* Raven XNACK */ {"gfx903", "gfx902", 16, 256, 32, 902, 903, true, Pal::AsicRevision::Raven, true, false}, + /* Raven2 */ {"gfx902", "gfx902", 16, 256, 32, 902, 902, false, Pal::AsicRevision::Raven2, true, false}, + /* Raven2 XNACK */ {"gfx903", "gfx902", 16, 256, 32, 902, 903, true, Pal::AsicRevision::Raven2, true, false}, + /* Renoir */ {"gfx902", "gfx902", 16, 256, 32, 902, 902, false, Pal::AsicRevision::Renoir, true, false}, + /* Renoir XNACK */ {"gfx903", "gfx902", 16, 256, 32, 902, 903, true, Pal::AsicRevision::Renoir, true, false}, + /* Navi10 */ {"gfx1010", "gfx1010", 32, 256, 32, 1010, 1010, false, Pal::AsicRevision::Navi10, true, false}, + /* Navi10 XNACK */ {"gfx1010", "gfx1010", 32, 256, 32, 1010, 1010, true, Pal::AsicRevision::Navi10, true, false}, + /* Navi12 */ {"gfx1011", "gfx1011", 32, 256, 32, 1011, 1011, false, Pal::AsicRevision::Navi12, true, false}, + /* Navi12 XNACK */ {"gfx1011", "gfx1011", 32, 256, 32, 1011, 1011, true, Pal::AsicRevision::Navi12, true, false}, + /* Navi14 */ {"gfx1012", "gfx1012", 32, 256, 32, 1012, 1012, false, Pal::AsicRevision::Navi14, true, false}, + /* Navi14 XNACK */ {"gfx1012", "gfx1012", 32, 256, 32, 1012, 1012, true, Pal::AsicRevision::Navi14, true, false}, + /* Navi21 */ {"gfx1030", "gfx1030", 32, 256, 32, 1030, 1030, false, Pal::AsicRevision::Navi21, false, false}, + /* Navi22 */ {"gfx1031", "gfx1031", 32, 256, 32, 1031, 1031, false, Pal::AsicRevision::Navi22, false, false}, + /* Navi23 */ {"gfx1032", "gfx1032", 32, 256, 32, 1032, 1032, false, Pal::AsicRevision::Navi23, false, false}, }; // Supported OpenCL versions diff --git a/projects/clr/rocclr/device/pal/paldevice.cpp b/projects/clr/rocclr/device/pal/paldevice.cpp index 3479a83c30..d7b7af67ee 100644 --- a/projects/clr/rocclr/device/pal/paldevice.cpp +++ b/projects/clr/rocclr/device/pal/paldevice.cpp @@ -514,12 +514,23 @@ void NullDevice::fillDeviceInfo(const Pal::DeviceProperties& palProp, if (settings().useLightning_) { ::strcpy(info_.name_, hwInfo()->machineTargetLC_); - if (hwInfo()->xnackEnabled_) { - ::strcat(info_.name_, ":xnack+"); + + if (hwInfo()->srameccSumpported_) { + if (palProp.gfxipProperties.shaderCore.flags.eccProtectedGprs) { + ::strcat(info_.name_, ":sramecc+"); + } else { + ::strcat(info_.name_, ":sramecc-"); + } } - if (palProp.gfxipProperties.shaderCore.flags.eccProtectedGprs) { - ::strcat(info_.name_, ":sramecc+"); + + if (hwInfo()->xnackSupported_) { + if (hwInfo()->xnackEnabled_) { + ::strcat(info_.name_, ":xnack+"); + } else { + ::strcat(info_.name_, ":xnack-"); + } } + ::strcpy(info_.targetId_, "amdgcn-amd-amdhsa--"); ::strcat(info_.targetId_, info_.name_); } else {