diff --git a/Tensile/Source/lib/source/hip/HipHardware.cpp b/Tensile/Source/lib/source/hip/HipHardware.cpp index ffa4f0f..f894366 100644 --- a/Tensile/Source/lib/source/hip/HipHardware.cpp +++ b/Tensile/Source/lib/source/hip/HipHardware.cpp @@ -24,6 +24,8 @@ * *******************************************************************************/ +#include + #include #include #include @@ -55,6 +57,20 @@ namespace Tensile { hipDeviceProp_t prop; HIP_CHECK_EXC(hipGetDeviceProperties(&prop, deviceId)); + // coerce to compatible arch + int gcnArch = strncmp(prop.gcnArchName, "gfx", 3) == 0 ? std::stoi(prop.gcnArchName + 3) : 0; + switch(gcnArch) + { + case 902: case 909: case 912: + std::strcpy(prop.gcnArchName, "gfx900"); + break; + case 1013: + std::strcpy(prop.gcnArchName, "gfx1010"); + break; + case 1031: case 1032: case 1033: case 1034: case 1035: case 1036: + std::strcpy(prop.gcnArchName, "gfx1030"); + break; + } #if HIP_VERSION >= 50220730 int hip_version; HIP_CHECK_EXC(hipRuntimeGetVersion(&hip_version));