Commit 11d00d61 authored by Paul's avatar Paul
Browse files

Formatting

parent 3d1ae7d1
......@@ -70,10 +70,10 @@ struct hip_write
struct hip_copy
{
std::string name() const { return "hip_copy"; }
shape compute_shape(std::vector<shape> inputs) const
{
shape compute_shape(std::vector<shape> inputs) const
{
check_shapes{inputs}.has(2);
return inputs.at(1);
return inputs.at(1);
}
argument compute(context&, const shape&, std::vector<argument> args) const
{
......
......@@ -35,12 +35,12 @@ void write_literals::apply(program& p) const
{
if(enabled(MIGRAPH_COPY_LITERALS{}))
{
literal l = ins->get_literal();
auto pre = p.add_literal(l);
auto s = p.add_outline(l.get_shape());
literal l = ins->get_literal();
auto pre = p.add_literal(l);
auto s = p.add_outline(l.get_shape());
auto alloc = p.insert_instruction(std::next(pre), hip_allocate{}, s);
p.replace_instruction(ins, hip_copy{}, pre, alloc);
}
}
else
{
argument a = to_gpu(ins->get_literal().get_argument());
......
......@@ -13,10 +13,13 @@ void gpu_literal_test()
p.add_literal(lit);
p.compile(migraph::gpu::target{});
auto scratch = p.get_parameter("scratch");
if(scratch == p.end()) {
auto result = p.eval({});
EXPECT(lit == migraph::gpu::from_gpu(result));
} else {
if(scratch == p.end())
{
auto result = p.eval({});
EXPECT(lit == migraph::gpu::from_gpu(result));
}
else
{
EXPECT(scratch->get_shape().bytes() == lit.get_shape().bytes());
}
}
......
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