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
90aca5c3
Commit
90aca5c3
authored
Jun 05, 2019
by
Paul
Browse files
Formatting
parent
37236428
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
16 deletions
+17
-16
src/driver/main.cpp
src/driver/main.cpp
+13
-9
src/driver/verify.cpp
src/driver/verify.cpp
+4
-6
src/driver/verify.hpp
src/driver/verify.hpp
+0
-1
No files found.
src/driver/main.cpp
View file @
90aca5c3
...
@@ -43,7 +43,7 @@ struct loader
...
@@ -43,7 +43,7 @@ struct loader
p
=
parse_onnx
(
file
);
p
=
parse_onnx
(
file
);
else
if
(
type
==
"tf"
)
else
if
(
type
==
"tf"
)
p
=
parse_tf
(
file
,
is_nhwc
);
p
=
parse_tf
(
file
,
is_nhwc
);
if
(
trim
>
0
)
if
(
trim
>
0
)
{
{
auto
last
=
std
::
prev
(
p
.
end
(),
trim
);
auto
last
=
std
::
prev
(
p
.
end
(),
trim
);
p
.
remove_instructions
(
last
,
p
.
end
());
p
.
remove_instructions
(
last
,
p
.
end
());
...
@@ -74,8 +74,12 @@ struct verify : command<verify>
...
@@ -74,8 +74,12 @@ struct verify : command<verify>
{
{
l
.
parse
(
ap
);
l
.
parse
(
ap
);
ap
.
add
(
tolerance
,
{
"--tolerance"
},
ap
.
help
(
"Tolerance for errors"
));
ap
.
add
(
tolerance
,
{
"--tolerance"
},
ap
.
help
(
"Tolerance for errors"
));
ap
.
add
(
per_instruction
,
{
"-i"
,
"--per-instruction"
},
ap
.
help
(
"Verify each instruction"
),
ap
.
set_value
(
true
));
ap
.
add
(
per_instruction
,
ap
.
add
(
reduce
,
{
"-r"
,
"--reduce"
},
ap
.
help
(
"Reduce program and verify"
),
ap
.
set_value
(
true
));
{
"-i"
,
"--per-instruction"
},
ap
.
help
(
"Verify each instruction"
),
ap
.
set_value
(
true
));
ap
.
add
(
reduce
,
{
"-r"
,
"--reduce"
},
ap
.
help
(
"Reduce program and verify"
),
ap
.
set_value
(
true
));
}
}
void
run
()
void
run
()
...
...
src/driver/verify.cpp
View file @
90aca5c3
...
@@ -41,8 +41,7 @@ argument run_gpu(program p)
...
@@ -41,8 +41,7 @@ argument run_gpu(program p)
program
::
parameter_map
m
;
program
::
parameter_map
m
;
for
(
auto
&&
x
:
p
.
get_parameter_shapes
())
for
(
auto
&&
x
:
p
.
get_parameter_shapes
())
{
{
m
[
x
.
first
]
=
m
[
x
.
first
]
=
gpu
::
to_gpu
(
generate_argument
(
x
.
second
,
get_hash
(
x
.
first
)));
gpu
::
to_gpu
(
generate_argument
(
x
.
second
,
get_hash
(
x
.
first
)));
}
}
auto
out
=
gpu
::
from_gpu
(
p
.
eval
(
m
));
auto
out
=
gpu
::
from_gpu
(
p
.
eval
(
m
));
std
::
cout
<<
p
<<
std
::
endl
;
std
::
cout
<<
p
<<
std
::
endl
;
...
@@ -81,8 +80,7 @@ void verify_instructions(const program& prog, double tolerance)
...
@@ -81,8 +80,7 @@ void verify_instructions(const program& prog, double tolerance)
if
(
arg
->
name
()
==
"@literal"
)
if
(
arg
->
name
()
==
"@literal"
)
inputs
.
push_back
(
p
.
add_literal
(
arg
->
get_literal
()));
inputs
.
push_back
(
p
.
add_literal
(
arg
->
get_literal
()));
else
else
inputs
.
push_back
(
inputs
.
push_back
(
p
.
add_parameter
(
std
::
to_string
(
inputs
.
size
()),
arg
->
get_shape
()));
p
.
add_parameter
(
std
::
to_string
(
inputs
.
size
()),
arg
->
get_shape
()));
}
}
p
.
add_instruction
(
ins
.
get_operator
(),
inputs
);
p
.
add_instruction
(
ins
.
get_operator
(),
inputs
);
try
try
...
...
src/driver/verify.hpp
View file @
90aca5c3
...
@@ -13,7 +13,6 @@ void verify_program(const std::string& name, program p, double tolerance = 100);
...
@@ -13,7 +13,6 @@ void verify_program(const std::string& name, program p, double tolerance = 100);
void
verify_instructions
(
const
program
&
prog
,
double
tolerance
=
80
);
void
verify_instructions
(
const
program
&
prog
,
double
tolerance
=
80
);
void
verify_reduced_program
(
program
p
,
double
tolerance
=
80
);
void
verify_reduced_program
(
program
p
,
double
tolerance
=
80
);
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace driver
}
// namespace driver
}
// namespace migraphx
}
// namespace migraphx
...
...
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