From 06a6f6a928f00fffd5832d39dcc3212797928417 Mon Sep 17 00:00:00 2001 From: hjchen2 Date: Tue, 18 Dec 2018 15:03:07 +0800 Subject: [PATCH] Fix fpga compile --- src/framework/executor.cpp | 6 ++---- src/operators/kernel/fpga/V1/conv_bn_kernel.cpp | 1 + src/operators/kernel/fpga/V1/conv_bn_relu_kernel.cpp | 1 + src/operators/math/softmax.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/framework/executor.cpp b/src/framework/executor.cpp index 3641cb963d..884f5200f2 100644 --- a/src/framework/executor.cpp +++ b/src/framework/executor.cpp @@ -399,8 +399,7 @@ void Executor::FeedData(const Tensor &t) { template std::shared_ptr Executor::FetchResult(int id) { - std::shared_ptr to_predict_block = program_desc_->Block(0); - auto &ops = ops_of_block_[*to_predict_block.get()]; + auto &ops = ops_of_block_[0]; PADDLE_MOBILE_ENFORCE(id < (int)ops.size(), "Index out of range"); auto op = id < 0 ? ops[ops.size() - 1] : ops[id]; @@ -414,8 +413,7 @@ std::shared_ptr Executor::FetchResult(int id) { template void Executor::Predict_From_To(int start, int end) { - std::shared_ptr to_predict_block = program_desc_->Block(0); - auto &ops = ops_of_block_[*to_predict_block.get()]; + auto &ops = ops_of_block_[0]; end = end < 0 ? static_cast(ops.size()) : end; PADDLE_MOBILE_ENFORCE(start >= 0 && start < end && end <= ops.size(), "start or end parameter is wrong"); diff --git a/src/operators/kernel/fpga/V1/conv_bn_kernel.cpp b/src/operators/kernel/fpga/V1/conv_bn_kernel.cpp index ac9f19e411..da10350553 100644 --- a/src/operators/kernel/fpga/V1/conv_bn_kernel.cpp +++ b/src/operators/kernel/fpga/V1/conv_bn_kernel.cpp @@ -15,6 +15,7 @@ limitations under the License. */ #ifdef FUSION_CONVBN_OP #include "operators/kernel/conv_bn_kernel.h" +#include namespace paddle_mobile { namespace operators { diff --git a/src/operators/kernel/fpga/V1/conv_bn_relu_kernel.cpp b/src/operators/kernel/fpga/V1/conv_bn_relu_kernel.cpp index 4c9eb391ad..1382b20cdf 100644 --- a/src/operators/kernel/fpga/V1/conv_bn_relu_kernel.cpp +++ b/src/operators/kernel/fpga/V1/conv_bn_relu_kernel.cpp @@ -15,6 +15,7 @@ limitations under the License. */ #ifdef FUSION_CONVBNRELU_OP #include "operators/kernel/conv_bn_relu_kernel.h" +#include namespace paddle_mobile { namespace operators { diff --git a/src/operators/math/softmax.cpp b/src/operators/math/softmax.cpp index 756f707d95..48f8b35ea2 100644 --- a/src/operators/math/softmax.cpp +++ b/src/operators/math/softmax.cpp @@ -97,7 +97,7 @@ void SoftmaxFuntor::operator()(const framework::Tensor *X, } #endif // __ARM_NEON__ for (int i = 0; i < remain; ++i) { - output[i] = std::expf(input[i] - max); + output[i] = expf(input[i] - max); } // sum(exp(x - max)) -- GitLab