Commit 90aca5c3 authored by Paul's avatar Paul
Browse files

Formatting

parent 37236428
...@@ -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()
......
...@@ -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
......
...@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment