blob: 7a72d833bba00a210f37ad347ee9ce10d1422121 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
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 <cstring>
+
#include <Tensile/AMDGPU.hpp>
#include <Tensile/hip/HipHardware.hpp>
#include <Tensile/hip/HipUtils.hpp>
@@ -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));
|