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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
--- a/library/src/handle.cpp
+++ b/library/src/handle.cpp
@@ -21,6 +21,7 @@
* ************************************************************************ */
#include "handle.hpp"
#include <cstdarg>
+#include <cstring>
#include <limits>
#ifdef WIN32
@@ -333,6 +334,20 @@ Processor _rocblas_handle::getActiveArch()
// strip out xnack/ecc from name
std::string deviceFullString(device_properties.gcnArchName);
std::string deviceString = deviceFullString.substr(0, deviceFullString.find(":"));
+ // coerce to compatible arch
+ int gcnArch = deviceString.substr(0, 3) == "gfx" ? std::stoi(deviceString.substr(3)) : 0;
+ switch(gcnArch)
+ {
+ case 902: case 909: case 912:
+ std::strcpy(device_properties.gcnArchName, "gfx900");
+ break;
+ case 1013:
+ std::strcpy(device_properties.gcnArchName, "gfx1010");
+ break;
+ case 1031: case 1032: case 1033: case 1034: case 1035: case 1036:
+ std::strcpy(device_properties.gcnArchName, "gfx1030");
+ break;
+ }
if(deviceString.find("gfx803") != std::string::npos)
{
--- a/library/src/rocblas_auxiliary.cpp
+++ b/library/src/rocblas_auxiliary.cpp
@@ -24,6 +24,7 @@
#include "logging.hpp"
#include "rocblas-auxiliary.h"
#include <cctype>
+#include <cstring>
#include <cstdlib>
#include <memory>
#include <string>
@@ -924,6 +925,20 @@ std::string rocblas_internal_get_arch_name()
hipGetDevice(&deviceId);
hipDeviceProp_t deviceProperties;
hipGetDeviceProperties(&deviceProperties, deviceId);
+ // coerce to compatible arch
+ int gcnArch = strncmp(deviceProperties.gcnArchName, "gfx", 3) == 0 ? std::stoi(deviceProperties.gcnArchName + 3) : 0;
+ switch(gcnArch)
+ {
+ case 902: case 909: case 912:
+ std::strcpy(deviceProperties.gcnArchName, "gfx900");
+ break;
+ case 1013:
+ std::strcpy(deviceProperties.gcnArchName, "gfx1010");
+ break;
+ case 1031: case 1032: case 1033: case 1034: case 1035: case 1036:
+ std::strcpy(deviceProperties.gcnArchName, "gfx1030");
+ break;
+ }
return ArchName<hipDeviceProp_t>{}(deviceProperties);
}
--- a/library/src/tensile_host.cpp
+++ b/library/src/tensile_host.cpp
@@ -51,6 +51,7 @@
#include <Tensile/hip/HipUtils.hpp>
#include <atomic>
#include <complex>
+#include <cstring>
#include <exception>
#include <future>
#include <iomanip>
@@ -831,6 +832,23 @@ namespace
std::string deviceFullString(prop.gcnArchName);
std::string deviceString
= deviceFullString.substr(0, deviceFullString.find(":"));
+ // coerce to compatible arch
+ int gcnArch = deviceString.substr(0, 3) == "gfx" ? std::stoi(deviceString.substr(3)) : 0;
+ switch(gcnArch)
+ {
+ case 902: case 909: case 912:
+ std::strcpy(prop.gcnArchName, "gfx900");
+ deviceString = prop.gcnArchName;
+ break;
+ case 1013:
+ std::strcpy(prop.gcnArchName, "gfx1010");
+ deviceString = prop.gcnArchName;
+ break;
+ case 1031: case 1032: case 1033: case 1034: case 1035: case 1036:
+ std::strcpy(prop.gcnArchName, "gfx1030");
+ deviceString = prop.gcnArchName;
+ break;
+ }
m_devicePropMap[deviceString] = std::make_shared<hipDeviceProp_t>(prop);
}
}
|