Commit dacfb9b8 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

clang format

parent 9c172a77
...@@ -36,7 +36,7 @@ struct miopen_quant_convolution ...@@ -36,7 +36,7 @@ struct miopen_quant_convolution
return shapes.size() - 1; return shapes.size() - 1;
} }
private: private:
shape pack_int8_shape(const shape& s) const; shape pack_int8_shape(const shape& s) const;
}; };
......
...@@ -187,12 +187,11 @@ struct miopen_apply ...@@ -187,12 +187,11 @@ struct miopen_apply
auto conv = miopen_quant_convolution{op, make_conv(op)}; auto conv = miopen_quant_convolution{op, make_conv(op)};
auto ws = conv.compile(ctx, ins->get_shape(), to_shapes(ins->inputs())); auto ws = conv.compile(ctx, ins->get_shape(), to_shapes(ins->inputs()));
auto args = ins->inputs(); auto args = ins->inputs();
auto workspace = insert_allocation(ins, ws, "workspace"); auto workspace = insert_allocation(ins, ws, "workspace");
auto output = insert_allocation(ins, ins->get_shape()); auto output = insert_allocation(ins, ins->get_shape());
return prog->replace_instruction( return prog->replace_instruction(ins, conv, args[0], args[1], workspace, output);
ins, conv, args[0], args[1], workspace, output);
}); });
} }
......
...@@ -39,12 +39,16 @@ void pack_int8_args::apply(program& p) const ...@@ -39,12 +39,16 @@ void pack_int8_args::apply(program& p) const
else if(ins->name() == "gpu::quant_convolution") else if(ins->name() == "gpu::quant_convolution")
{ {
auto inputs = ins->inputs(); auto inputs = ins->inputs();
auto packed_x = p.insert_instruction(ins, hip_allocate{pack_int8_shape(inputs[0]->get_shape())}); auto packed_x =
auto output_x = p.insert_instruction(ins, miopen_int8_conv_pack{}, {inputs[0], packed_x}); p.insert_instruction(ins, hip_allocate{pack_int8_shape(inputs[0]->get_shape())});
auto output_x =
p.insert_instruction(ins, miopen_int8_conv_pack{}, {inputs[0], packed_x});
instruction::replace_argument(ins, inputs[0], output_x); instruction::replace_argument(ins, inputs[0], output_x);
auto packed_w = p.insert_instruction(ins, hip_allocate{pack_int8_shape(inputs[1]->get_shape())}); auto packed_w =
auto output_w = p.insert_instruction(ins, miopen_int8_conv_pack{}, {inputs[1], packed_w}); p.insert_instruction(ins, hip_allocate{pack_int8_shape(inputs[1]->get_shape())});
auto output_w =
p.insert_instruction(ins, miopen_int8_conv_pack{}, {inputs[1], packed_w});
instruction::replace_argument(ins, inputs[1], output_w); instruction::replace_argument(ins, inputs[1], output_w);
} }
} }
...@@ -65,7 +69,6 @@ shape pack_int8_args::pack_int8_shape(const shape& s) const ...@@ -65,7 +69,6 @@ shape pack_int8_args::pack_int8_shape(const shape& s) const
return {s.type(), lens, strides}; return {s.type(), lens, strides};
} }
} // namespace gpu } // namespace gpu
} // namespace MIGRAPHX_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
} // 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