提交 482a2aa8 编写于 作者: qnqinan's avatar qnqinan 提交者: Jiaying Zhao

fix a bug in ewadd in FPGA v2, test=mobile close#2574 (#2575)

* update proposal and psroipool kernel file in FPGA V2 track

* update, test=develop

* update FPGA v2 pe cpp file and ew kernel files, test=develop

* fix a bug of sigmoid kernel in FPGA v2 track, test=develop

* fix bugs of concat, reshape and slice op and add usleep in fpga regpoll, test=develop

* add interupt clear operation before op compute in FPGA V2 track, test=develop

* fix a bug in ewadd in FPGA v2, test=mobile
上级 381fa7f6
......@@ -534,7 +534,8 @@ uint64_t bypass_interrupt = reg_readq(REG_INTERRUPT);
(((uint64_t)args.image0.height * 2) << 32);
uint64_t image_row_col_padding_down = image_amount_per_row |
(image_amount_per_row << 32);
float quantParam = (args.output.scale_address)[0];
float quantParam =
((args.image0.scale_address)[0]) / ((args.output.scale_address)[0]);
uint32_t* ew_scale = reinterpret_cast<uint32_t*>(&quantParam);
uint64_t ew_scale_mult_factor = (*ew_scale) |
((uint64_t)args.const0 << 32) | ((uint64_t)args.const1 << 40);
......
......@@ -33,8 +33,8 @@ bool ElementwiseAddKernel<FPGA, float>::Init(ElementwiseAddParam<FPGA> *param) {
float C1 = Si_1 / So;
float C2 = Si_2 / So;
fpga::EWAddArgs ewaddArgs = {0};
ewaddArgs.const0 = fpga::fp32_2_fp16(C1);
ewaddArgs.const1 = fpga::fp32_2_fp16(C2);
ewaddArgs.const0 = 1;
ewaddArgs.const1 = 1;
ewaddArgs.relu_enabled = 0;
ewaddArgs.image0.address = input_x_ptr;
ewaddArgs.image0.channels = (uint32_t)input_x->dims()[1];
......
......@@ -35,8 +35,8 @@ bool ElementwiseAddReluKernel<FPGA, float>::Init(
float C2 = Si_2 / So;
fpga::EWAddArgs ewaddArgs = {0};
ewaddArgs.relu_enabled = 1;
ewaddArgs.const0 = fpga::fp32_2_fp16(C1);
ewaddArgs.const1 = fpga::fp32_2_fp16(C2);
ewaddArgs.const0 = 1;
ewaddArgs.const1 = 1;
ewaddArgs.image0.address = input_x_ptr;
ewaddArgs.image0.channels = (uint32_t)input_x->dims()[1];
ewaddArgs.image0.scale_address = input_x->scale;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册