From 9d6165ad4f6e3acb7bd12f31c5e2d4e0cd68d535 Mon Sep 17 00:00:00 2001 From: qnqinan Date: Fri, 10 Aug 2018 11:28:30 +0800 Subject: [PATCH] add quantization support of added fpga kernel --- src/operators/kernel/fpga/elementwise_add_relu_kernel.cpp | 6 +++--- src/operators/kernel/fpga/fc_relu_kernel.cpp | 4 ++-- src/operators/kernel/fpga/fusion_fc_kernel.cpp | 4 ++-- src/operators/kernel/fpga/pool_kernel.cpp | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/operators/kernel/fpga/elementwise_add_relu_kernel.cpp b/src/operators/kernel/fpga/elementwise_add_relu_kernel.cpp index 5dd8991e2a..88a19beb41 100644 --- a/src/operators/kernel/fpga/elementwise_add_relu_kernel.cpp +++ b/src/operators/kernel/fpga/elementwise_add_relu_kernel.cpp @@ -25,9 +25,9 @@ bool ElementwiseAddReluKernel::Init( const Tensor *input_x = param->InputX(); const Tensor *input_y = param->InputY(); Tensor *out = param->Out(); - auto input_x_ptr = input_x->data(); - auto input_y_ptr = input_y->data(); - auto out_ptr = out->mutable_data(); + auto input_x_ptr = input_x->data(); + auto input_y_ptr = input_y->data(); + auto out_ptr = out->mutable_data(); fpga::EWAddArgs ewaddArgs; ewaddArgs.relu_enabled = relu_enabled; diff --git a/src/operators/kernel/fpga/fc_relu_kernel.cpp b/src/operators/kernel/fpga/fc_relu_kernel.cpp index 6b828f1024..21e334b12b 100644 --- a/src/operators/kernel/fpga/fc_relu_kernel.cpp +++ b/src/operators/kernel/fpga/fc_relu_kernel.cpp @@ -22,13 +22,13 @@ template <> bool FusionFcReluKernel::Init(FusionFcReluParam *param) { bool relu_enabled = true; const Tensor *input_x = param->InputX(); - auto input_x_ptr = input_x->data(); + auto input_x_ptr = input_x->data(); const Tensor *input_y = param->InputY(); auto input_y_ptr = input_y->data(); const Tensor *input_z = param->InputZ(); auto input_z_ptr = input_z->data(); Tensor *out = param->Out(); - auto out_ptr = out->mutable_data(); + auto out_ptr = out->mutable_data(); PADDLE_MOBILE_ENFORCE(input_x->dims()[1] == input_y->dims()[0], "Image channel should be equal to weight number"); diff --git a/src/operators/kernel/fpga/fusion_fc_kernel.cpp b/src/operators/kernel/fpga/fusion_fc_kernel.cpp index 340561a9aa..505b876856 100644 --- a/src/operators/kernel/fpga/fusion_fc_kernel.cpp +++ b/src/operators/kernel/fpga/fusion_fc_kernel.cpp @@ -22,13 +22,13 @@ template <> bool FusionFcKernel::Init(FusionFcParam *param) { bool relu_enabled = false; const Tensor *input_x = param->InputX(); - auto input_x_ptr = input_x->data(); + auto input_x_ptr = input_x->data(); const Tensor *input_y = param->InputY(); auto input_y_ptr = input_y->data(); const Tensor *input_z = param->InputZ(); auto input_z_ptr = input_z->data(); Tensor *out = param->Out(); - auto out_ptr = out->mutable_data(); + auto out_ptr = out->mutable_data(); PADDLE_MOBILE_ENFORCE(input_x->dims()[1] == input_y->dims()[0], "Image channel should be equal to weight number"); diff --git a/src/operators/kernel/fpga/pool_kernel.cpp b/src/operators/kernel/fpga/pool_kernel.cpp index 3e7dc5fd59..a7ff022c3b 100644 --- a/src/operators/kernel/fpga/pool_kernel.cpp +++ b/src/operators/kernel/fpga/pool_kernel.cpp @@ -22,9 +22,9 @@ namespace operators { template <> bool PoolKernel::Init(PoolParam *param) { const Tensor *input = param->Input(); - auto input_ptr = input->data(); + auto input_ptr = input->data(); Tensor *output = param->Output(); - auto output_ptr = output->mutable_data(); + auto output_ptr = output->mutable_data(); vector ksize = param->Ksize(); vector strides = param->Strides(); vector paddings = param->Paddings(); -- GitLab