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
5c7bee3a
Commit
5c7bee3a
authored
Jul 10, 2019
by
Paul
Browse files
Rename batchnorm pass
parent
cfd36b63
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
12 deletions
+12
-12
src/CMakeLists.txt
src/CMakeLists.txt
+1
-1
src/include/migraphx/rewrite_batchnorm.hpp
src/include/migraphx/rewrite_batchnorm.hpp
+2
-2
src/rewrite_batchnorm.cpp
src/rewrite_batchnorm.cpp
+2
-2
src/targets/gpu/target.cpp
src/targets/gpu/target.cpp
+2
-2
test/rewrite_batchnorm_test.cpp
test/rewrite_batchnorm_test.cpp
+5
-5
No files found.
src/CMakeLists.txt
View file @
5c7bee3a
...
...
@@ -12,7 +12,7 @@ add_library(migraphx
eliminate_concat.cpp
eliminate_identity.cpp
eliminate_pad.cpp
fwd_conv
_batchnorm
_rewrite
.cpp
rewrite
_batchnorm.cpp
rewrite_rnn.cpp
env.cpp
generate.cpp
...
...
src/include/migraphx/
fwd_conv
_batchnorm
_rewrite
.hpp
→
src/include/migraphx/
rewrite
_batchnorm.hpp
View file @
5c7bee3a
...
...
@@ -13,9 +13,9 @@ struct program;
/**
* Rewrite batchnorm to a multiply and add.
*/
struct
fwd_conv
_batchnorm
_rewrite
struct
rewrite
_batchnorm
{
std
::
string
name
()
const
{
return
"
fwd_conv
_batchnorm
_rewrite
"
;
}
std
::
string
name
()
const
{
return
"
rewrite
_batchnorm"
;
}
void
apply
(
program
&
p
)
const
;
};
...
...
src/
fwd_conv
_batchnorm
_rewrite
.cpp
→
src/
rewrite
_batchnorm.cpp
View file @
5c7bee3a
#include <migraphx/
fwd_conv
_batchnorm
_rewrite
.hpp>
#include <migraphx/
rewrite
_batchnorm.hpp>
#include <migraphx/program.hpp>
#include <migraphx/instruction.hpp>
#include <migraphx/op/batch_norm.hpp>
...
...
@@ -12,7 +12,7 @@
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
void
fwd_conv
_batchnorm
_rewrite
::
apply
(
program
&
p
)
const
void
rewrite
_batchnorm
::
apply
(
program
&
p
)
const
{
for
(
auto
ins
:
iterator_for
(
p
))
{
...
...
src/targets/gpu/target.cpp
View file @
5c7bee3a
...
...
@@ -14,7 +14,7 @@
#include <migraphx/propagate_constant.hpp>
#include <migraphx/eliminate_contiguous.hpp>
#include <migraphx/common_subexpression_elimination.hpp>
#include <migraphx/
fwd_conv
_batchnorm
_rewrite
.hpp>
#include <migraphx/
rewrite
_batchnorm.hpp>
#include <migraphx/rewrite_rnn.hpp>
#include <migraphx/eliminate_concat.hpp>
#include <migraphx/eliminate_identity.hpp>
...
...
@@ -42,7 +42,7 @@ std::vector<pass> target::get_passes(migraphx::context& gctx) const
eliminate_identity
{},
eliminate_pad
{},
dead_code_elimination
{},
fwd_conv
_batchnorm
_rewrite
{},
rewrite
_batchnorm
{},
dead_code_elimination
{},
rewrite_rnn
{},
dead_code_elimination
{},
...
...
test/
fwd_conv
_batchnorm_
rewrite_
test.cpp
→
test/
rewrite
_batchnorm_test.cpp
View file @
5c7bee3a
#include <migraphx/
fwd_conv
_batchnorm
_rewrite
.hpp>
#include <migraphx/
rewrite
_batchnorm.hpp>
#include <migraphx/program.hpp>
#include <migraphx/cpu/target.hpp>
#include <migraphx/op/convolution.hpp>
...
...
@@ -56,7 +56,7 @@ TEST_CASE(fwd_conv_batchnorm_rewrite_test)
migraphx
::
program
p1
=
create_program
();
migraphx
::
program
p2
=
create_program
();
migraphx
::
fwd_conv
_batchnorm
_rewrite
opt
;
migraphx
::
rewrite
_batchnorm
opt
;
opt
.
apply
(
p2
);
p1
.
compile
(
migraphx
::
cpu
::
target
{});
p2
.
compile
(
migraphx
::
cpu
::
target
{});
...
...
@@ -93,7 +93,7 @@ TEST_CASE(non_literal)
migraphx
::
program
p1
=
create_program
();
migraphx
::
program
p2
=
create_program
();
migraphx
::
fwd_conv
_batchnorm
_rewrite
opt
;
migraphx
::
rewrite
_batchnorm
opt
;
opt
.
apply
(
p2
);
EXPECT
(
any_of
(
p1
,
&
is_batch_norm
));
EXPECT
(
none_of
(
p2
,
&
is_batch_norm
));
...
...
@@ -121,7 +121,7 @@ TEST_CASE(as_literal)
migraphx
::
program
p1
=
create_program
();
migraphx
::
program
p2
=
create_program
();
migraphx
::
fwd_conv
_batchnorm
_rewrite
opt
;
migraphx
::
rewrite
_batchnorm
opt
;
opt
.
apply
(
p2
);
EXPECT
(
any_of
(
p1
,
&
is_batch_norm
));
EXPECT
(
none_of
(
p2
,
&
is_batch_norm
));
...
...
@@ -159,7 +159,7 @@ TEST_CASE(literal_reshape)
migraphx
::
program
p1
=
create_program
();
migraphx
::
program
p2
=
create_program
();
migraphx
::
fwd_conv
_batchnorm
_rewrite
opt
;
migraphx
::
rewrite
_batchnorm
opt
;
opt
.
apply
(
p2
);
EXPECT
(
any_of
(
p1
,
&
is_batch_norm
));
EXPECT
(
none_of
(
p2
,
&
is_batch_norm
));
...
...
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