diff --git a/src/fpga/V2/api.cpp b/src/fpga/V2/api.cpp index daf8c72b8338d483dc4401c713fa7956e1b2bc1b..8010e43a61c8f8d1b5fb00370b987ab14cbf2727 100644 --- a/src/fpga/V2/api.cpp +++ b/src/fpga/V2/api.cpp @@ -146,11 +146,11 @@ int format_conv_data(framework::Tensor *filter_tensor, } int format_fc_data(framework::Tensor *filter_tensor, - framework::Tensor *ofm_tensor, float *bs_ptr) { + framework::Tensor *ofm_tensor, float **bs_ptr) { float max_value = fpga::filter_find_max(filter_tensor); fpga::format_fc_filter(filter_tensor, max_value); int aligned_num = get_aligned_filter_num(filter_tensor); - fpga::format_bias_scale_array(&bs_ptr, + fpga::format_bias_scale_array(bs_ptr, (int)filter_tensor->dims()[0], // NOLINT aligned_num); int aligned_channel = fpga::get_conv_output_channel(filter_tensor); diff --git a/src/fpga/V2/api.h b/src/fpga/V2/api.h index 59c1b006183e4355ebe9316766773215b6edf12f..7f87f158a82a2ab666afa3ef35d6ad3b417cad9a 100644 --- a/src/fpga/V2/api.h +++ b/src/fpga/V2/api.h @@ -41,7 +41,7 @@ void format_concat_output(framework::Tensor* out, int height, int width, int format_conv_data(framework::Tensor* filter_tensor, framework::Tensor* ofm_tensor, float** bs_ptr, int group); int format_fc_data(framework::Tensor* filter_tensor, - framework::Tensor* ofm_tensor, float* bs_ptr); + framework::Tensor* ofm_tensor, float** bs_ptr); void fill_split_arg(struct SplitConvArgs* arg, framework::Tensor* input, framework::Tensor* out, framework::Tensor* filter, bool relu_enabled, int group_num, int stride_h, diff --git a/src/operators/kernel/fpga/V2/fusion_fc_kernel.cpp b/src/operators/kernel/fpga/V2/fusion_fc_kernel.cpp index 589c21d667f39e24e8f62abafd38ab30523dd2de..8d24c44340a29f934749e6e68f22b9fb43f3610f 100644 --- a/src/operators/kernel/fpga/V2/fusion_fc_kernel.cpp +++ b/src/operators/kernel/fpga/V2/fusion_fc_kernel.cpp @@ -47,7 +47,7 @@ bool FusionFcKernel::Init(FusionFcParam *param) { out->Resize(framework::make_ddim({1, channel, 1, 1})); filter->Resize(framework::make_ddim({num, filter_channel, height, width})); - fpga::format_fc_data(filter, out, bs_ptr); + fpga::format_fc_data(filter, out, &bs_ptr); fpga::SplitConvArgs conv_arg = {0}; fpga::fill_split_arg(&conv_arg, input_x, out, filter, relu_enabled, 1, 1, 1,