diff --git a/CMakeLists.txt b/CMakeLists.txt index 635b7ef6f5e64181eff042df059e74f90f4f20ec..4ccf73763c08a748b53027d7f4a0f254774a1843 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,9 +6,9 @@ option(USE_OPENMP "openmp support" OFF) option(USE_EXCEPTION "use std exception" ON) option(LOG_PROFILE "log profile" ON) # select the platform to build -option(CPU "armv7 with neon" OFF) +option(CPU "armv7 with neon" ON) option(MALI_GPU "mali gpu" OFF) -option(FPGA "fpga" ON) +option(FPGA "fpga" OFF) file(GLOB_RECURSE PADDLE_MOBILE_CC src/*.cc src/*.cpp src/*.c src/*.mm) file(GLOB_RECURSE PADDLE_MOBILE_H src/*.h) @@ -139,7 +139,7 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY build) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY build) # NET default -set(NET "FPGAnets" CACHE STRING "select net type") +set(NET "default" CACHE STRING "select net type") set_property(CACHE NET PROPERTY STRINGS "default" "googlenet" "mobilenet" "yolo" "squeezenet" "FPGAnets") include("${CMAKE_CURRENT_LIST_DIR}/tools/op.cmake") diff --git a/src/io/executor.cpp b/src/io/executor.cpp index 4d73a4c085977a0388926ea2dea5f7961742e871..73e6c9d6f170fc4eebb6af2f8b7a67c847961950 100644 --- a/src/io/executor.cpp +++ b/src/io/executor.cpp @@ -77,7 +77,6 @@ Executor::Executor(const framework::Program p, int batch_size, auto op_base = framework::OpRegistry::CreateOp( op->Type(), op->GetInputs(), op->GetOutputs(), op->GetAttrMap(), program_.scope); - DLOG << "InferShape: "; op_base->InferShape(); ops_of_block_[*block_desc.get()].push_back(op_base); #ifdef PADDLE_EXECUTOR_MULTITHREAD @@ -85,19 +84,15 @@ Executor::Executor(const framework::Program p, int batch_size, #endif } } - DLOG << "InitMemory: "; - if (program_.combined) { InitCombineMemory(); } else { InitMemory(); } - DLOG << "InitMemory end "; std::shared_ptr to_predict_block = to_predict_program_->Block(0); auto &ops = ops_of_block_[*to_predict_block.get()]; for (const auto &op : ops) { - DLOG << "Init op " << op->Type(); op->Init(); } } diff --git a/src/operators/feed_op.h b/src/operators/feed_op.h index a79c2f95fcf85dc00744a3329391f8ec96f19843..7a58e29cea635e62e64806a0c40956baf684d76e 100644 --- a/src/operators/feed_op.h +++ b/src/operators/feed_op.h @@ -37,11 +37,11 @@ class FeedOp : public framework::OperatorBase { param_.Out()->Resize(out_dims); } -#ifdef PADDLE_MOBILE_FPGA__VV +#ifdef PADDLE_MOBILE_FPGA void RunImpl() const { fpga::PerformBypass(param_.FpgaArgs()); } void Init() { const Tensor *input = param_.InputX(); - auto input_ptr = input->data(); + auto input_ptr = input->mutable_data(); Tensor *output = param_.Out(); auto output_ptr = output->mutable_data(); fpga::BypassArgs args; diff --git a/src/operators/kernel/fpga/conv_add_kernel.cpp b/src/operators/kernel/fpga/conv_add_kernel.cpp deleted file mode 100644 index 1f2697a9f60a8c195d0acaabe6f10c1ab70e0e1f..0000000000000000000000000000000000000000 --- a/src/operators/kernel/fpga/conv_add_kernel.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ -#ifdef FUSION_CONVADD_OP - -#include "operators/kernel/conv_add_kernel.h" -#include "../central-arm-func/conv_add_arm_func.h" -#include "fpga/fpga_quantilization.h" - -namespace paddle_mobile { -namespace operators { - -template <> -bool ConvAddKernel::Init(FusionConvAddParam *param) { - DLOG << ">>>>>>>>>>>>>>>>>>>> ConvKernel <<<<<<<<<<<<<<<<<<<<<<<"; - Tensor *filter = param->Filter(); - fpga::quantify_filter(filter); - return true; -} - -template <> -void ConvAddKernel::Compute(const FusionConvAddParam ¶m) const { - ConvAddCompute(param); -} - -template class ConvAddKernel; - -} // namespace operators -} // namespace paddle_mobile - -#endif - diff --git a/src/operators/kernel/fpga/conv_kernel.cpp b/src/operators/kernel/fpga/conv_kernel.cpp deleted file mode 100644 index fc13bbda64f2f3fef221ed821a01acc05be7ee2e..0000000000000000000000000000000000000000 --- a/src/operators/kernel/fpga/conv_kernel.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -#ifdef CONV_OP - -#include "operators/kernel/conv_kernel.h" -#include "operators/kernel/central-arm-func/conv_arm_func.h" - -namespace paddle_mobile { -namespace operators { - -template <> -bool ConvKernel::Init(ConvParam *param) { - return true; -} - -template <> -void ConvKernel::Compute(const ConvParam ¶m) const { - ConvCompute(param); -} - -template class ConvKernel; - -} // namespace operators -} // namespace paddle_mobile - -#endif diff --git a/tools/op.cmake b/tools/op.cmake index 374a8d91d478d2da3caffeb92576ca6c58eea04b..af246f1d48e7c687812c454af163f12d5f804571 100644 --- a/tools/op.cmake +++ b/tools/op.cmake @@ -82,7 +82,6 @@ if ("FPGAnets" IN_LIST NET) set(CONCAT_OP ON) set(SOFTMAX_OP ON) set(DROPOUT_OP ON) - set(FUSION_CONVADD_OP ON) # set(CONV_OP ON) set(FOUND_MATCH ON)