5
5
#include < migraphx/gpu/miopen.hpp>
6
6
#include < migraphx/gpu/clip.hpp>
7
7
#include < migraphx/gpu/convolution.hpp>
8
+ #include < migraphx/gpu/device_name.hpp>
8
9
#include < migraphx/gpu/oper.hpp>
9
10
#include < migraphx/gpu/add.hpp>
10
11
#include < migraphx/gpu/mul.hpp>
26
27
#include < migraphx/array.hpp>
27
28
#include < migraphx/op/clip.hpp>
28
29
#include < cmath>
30
+ #include < set>
29
31
30
32
namespace migraphx {
31
33
inline namespace MIGRAPHX_INLINE_NS {
@@ -152,6 +154,12 @@ struct fusion
152
154
}
153
155
};
154
156
157
+ const std::unordered_set<std::string>& get_supported_archs ()
158
+ {
159
+ static std::unordered_set<std::string> supported_archs{" gfx900" , " gfx906" , " gfx908" , " gfx1030" };
160
+ return supported_archs;
161
+ }
162
+
155
163
MIGRAPHX_PRED_MATCHER (bias_shape, instruction_ref ins)
156
164
{
157
165
auto && s = ins->get_shape ();
@@ -161,6 +169,9 @@ MIGRAPHX_PRED_MATCHER(bias_shape, instruction_ref ins)
161
169
162
170
MIGRAPHX_PRED_MATCHER (fusable_conv, instruction_ref ins)
163
171
{
172
+ const auto device_name = split_string (get_device_name (), ' :' ).front ();
173
+ if (not contains (get_supported_archs (), device_name))
174
+ return false ;
164
175
if (enabled (MIGRAPHX_DISABLE_MIOPEN_FUSION{}))
165
176
return false ;
166
177
if (ins->name () != " gpu::convolution" )
0 commit comments