"conda/vscode:/vscode.git/clone" did not exist on "08892a31f7ee472c9339bf5dabf47ee148e51f18"
Commit eca3cb69 authored by Paul's avatar Paul
Browse files

Fix problem with no output

parent 3e6d18a4
...@@ -31,7 +31,10 @@ void fuse_ops::apply(program& p) const ...@@ -31,7 +31,10 @@ void fuse_ops::apply(program& p) const
auto add_ins = ins->arguments.front(); auto add_ins = ins->arguments.front();
if(add_ins->op.name() != "gpu::add") if(add_ins->op.name() != "gpu::add")
continue; continue;
p.replace_instruction(ins, hip_add_relu{}, add_ins->arguments); auto args = add_ins->arguments;
// Use the allocation from the relu operator
args.back() = ins->arguments.back();
p.replace_instruction(ins, hip_add_relu{}, args);
} }
} }
......
...@@ -355,7 +355,7 @@ struct miopen_apply ...@@ -355,7 +355,7 @@ struct miopen_apply
instruction_ref insert_allocation(instruction_ref ins, const shape& s, std::string tag = "") instruction_ref insert_allocation(instruction_ref ins, const shape& s, std::string tag = "")
{ {
if(ins == --prog->end() and not tag.empty()) if(ins == --prog->end() and tag.empty())
{ {
return prog->add_parameter("output", s); return prog->add_parameter("output", s);
} }
......
...@@ -123,7 +123,7 @@ migraph::argument run_gpu() ...@@ -123,7 +123,7 @@ migraph::argument run_gpu()
{ {
m[x.first] = migraph::gpu::to_gpu(migraph::generate_argument(x.second, get_hash(x.first))); m[x.first] = migraph::gpu::to_gpu(migraph::generate_argument(x.second, get_hash(x.first)));
} }
EXPECT(bool{m.find("output") != m.end()});
return migraph::gpu::from_gpu(p.eval(m)); return migraph::gpu::from_gpu(p.eval(m));
} }
...@@ -235,6 +235,19 @@ struct test_add_broadcast5 ...@@ -235,6 +235,19 @@ struct test_add_broadcast5
} }
}; };
struct test_conv
{
migraph::program create_program() const
{
migraph::program p;
auto input = p.add_parameter("x", migraph::shape{migraph::shape::float_type, {4, 3, 3, 3}});
auto weights =
p.add_parameter("w", migraph::shape{migraph::shape::float_type, {4, 3, 3, 3}});
p.add_instruction(migraph::convolution{}, input, weights);
return p;
}
};
struct test_conv_relu struct test_conv_relu
{ {
migraph::program create_program() const migraph::program create_program() const
...@@ -482,6 +495,7 @@ int main() ...@@ -482,6 +495,7 @@ int main()
verify_program<test_add_broadcast3>(); verify_program<test_add_broadcast3>();
verify_program<test_add_broadcast4>(); verify_program<test_add_broadcast4>();
verify_program<test_add_broadcast5>(); verify_program<test_add_broadcast5>();
verify_program<test_conv>();
verify_program<test_conv_relu>(); verify_program<test_conv_relu>();
verify_program<test_add_relu>(); verify_program<test_add_relu>();
verify_program<test_conv_pooling>(); verify_program<test_conv_pooling>();
......
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