Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
30b40654
Commit
30b40654
authored
Oct 15, 2018
by
Paul
Browse files
Formatting
parent
6d84eb12
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
14 deletions
+19
-14
src/targets/gpu/fuse_ops.cpp
src/targets/gpu/fuse_ops.cpp
+8
-3
test/gpu/miopen.cpp
test/gpu/miopen.cpp
+11
-11
No files found.
src/targets/gpu/fuse_ops.cpp
View file @
30b40654
...
...
@@ -185,8 +185,10 @@ struct match_add_relu
{
auto
matcher
()
const
{
return
match
::
name
(
"gpu::relu"
)(
match
::
used_once
(),
match
::
arg
(
0
)(
match
::
any_of
(
match
::
name
(
"gpu::add"
),
match
::
name
(
"hip::triadd"
)).
bind
(
"add"
)));
return
match
::
name
(
"gpu::relu"
)(
match
::
used_once
(),
match
::
arg
(
0
)(
match
::
any_of
(
match
::
name
(
"gpu::add"
),
match
::
name
(
"hip::triadd"
)).
bind
(
"add"
)));
}
void
apply
(
program
&
p
,
match
::
matcher_result
r
)
const
...
...
@@ -356,7 +358,10 @@ struct match_conv_bias
struct
match_conv_bias_relu
{
context
*
ctx
=
nullptr
;
auto
matcher
()
const
{
return
match
::
name
(
"gpu::relu"
)(
match
::
used_once
(),
match
::
arg
(
0
)(
conv_bias
()));
}
auto
matcher
()
const
{
return
match
::
name
(
"gpu::relu"
)(
match
::
used_once
(),
match
::
arg
(
0
)(
conv_bias
()));
}
void
apply
(
program
&
p
,
match
::
matcher_result
r
)
const
{
...
...
test/gpu/miopen.cpp
View file @
30b40654
...
...
@@ -180,9 +180,9 @@ struct test_triadd
{
migraph
::
program
p
;
migraph
::
shape
s
{
migraph
::
shape
::
float_type
,
{
3
}};
auto
x
=
p
.
add_parameter
(
"x"
,
s
);
auto
y
=
p
.
add_parameter
(
"y"
,
s
);
auto
z
=
p
.
add_parameter
(
"z"
,
s
);
auto
x
=
p
.
add_parameter
(
"x"
,
s
);
auto
y
=
p
.
add_parameter
(
"y"
,
s
);
auto
z
=
p
.
add_parameter
(
"z"
,
s
);
auto
sum
=
p
.
add_instruction
(
migraph
::
op
::
add
{},
x
,
y
);
p
.
add_instruction
(
migraph
::
op
::
add
{},
sum
,
z
);
return
p
;
...
...
@@ -196,10 +196,10 @@ struct test_triadd2
migraph
::
program
p
;
migraph
::
shape
s
{
migraph
::
shape
::
float_type
,
{
2
,
3
}};
migraph
::
shape
b
{
migraph
::
shape
::
float_type
,
{
3
}};
auto
x
=
p
.
add_parameter
(
"x"
,
s
);
auto
y
=
p
.
add_parameter
(
"y"
,
s
);
auto
z
=
p
.
add_parameter
(
"z"
,
b
);
auto
zb
=
p
.
add_instruction
(
migraph
::
op
::
broadcast
{
1
,
s
},
z
);
auto
x
=
p
.
add_parameter
(
"x"
,
s
);
auto
y
=
p
.
add_parameter
(
"y"
,
s
);
auto
z
=
p
.
add_parameter
(
"z"
,
b
);
auto
zb
=
p
.
add_instruction
(
migraph
::
op
::
broadcast
{
1
,
s
},
z
);
auto
sum
=
p
.
add_instruction
(
migraph
::
op
::
add
{},
x
,
y
);
p
.
add_instruction
(
migraph
::
op
::
add
{},
sum
,
zb
);
return
p
;
...
...
@@ -282,10 +282,10 @@ struct test_triadd_broadcast
{
migraph
::
program
p
;
migraph
::
shape
s
{
migraph
::
shape
::
float_type
,
{
3
}};
auto
x
=
p
.
add_parameter
(
"x"
,
{
migraph
::
shape
::
float_type
,
{
2
,
2
,
3
}});
auto
y
=
p
.
add_parameter
(
"y"
,
{
migraph
::
shape
::
float_type
,
{
2
,
2
}});
auto
z
=
p
.
add_parameter
(
"z"
,
{
migraph
::
shape
::
float_type
,
{
2
,
2
,
3
}});
auto
by
=
p
.
add_instruction
(
migraph
::
op
::
broadcast
{
0
,
x
->
get_shape
()},
y
);
auto
x
=
p
.
add_parameter
(
"x"
,
{
migraph
::
shape
::
float_type
,
{
2
,
2
,
3
}});
auto
y
=
p
.
add_parameter
(
"y"
,
{
migraph
::
shape
::
float_type
,
{
2
,
2
}});
auto
z
=
p
.
add_parameter
(
"z"
,
{
migraph
::
shape
::
float_type
,
{
2
,
2
,
3
}});
auto
by
=
p
.
add_instruction
(
migraph
::
op
::
broadcast
{
0
,
x
->
get_shape
()},
y
);
auto
sum
=
p
.
add_instruction
(
migraph
::
op
::
add
{},
x
,
by
);
p
.
add_instruction
(
migraph
::
op
::
add
{},
sum
,
z
);
return
p
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment