From f6bcab793696b81c1f24448fd718192516d9c64b Mon Sep 17 00:00:00 2001 From: yanghongtian Date: Wed, 15 Apr 2020 20:43:18 +0800 Subject: [PATCH] rename HW_ASCEND_NPU_DEPS --- lite/api/CMakeLists.txt | 12 ++++++------ lite/gen_code/CMakeLists.txt | 2 +- lite/kernels/hw_ascend_npu/bridges/CMakeLists.txt | 2 ++ lite/kernels/hw_ascend_npu/bridges/act_op.cc | 5 +++-- lite/tests/kernels/activation_compute_test.cc | 2 ++ 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/lite/api/CMakeLists.txt b/lite/api/CMakeLists.txt index 579b8a3ca4..aaf042d129 100644 --- a/lite/api/CMakeLists.txt +++ b/lite/api/CMakeLists.txt @@ -68,7 +68,7 @@ if (WITH_TESTING) X86_DEPS ${x86_kernels} XPU_DEPS ${xpu_kernels} BM_DEPS ${bm_kernels} - HWAscendNPU_DEPS ${hw_ascend_npu_kernels} + HW_ASCEND_NPU_DEPS ${hw_ascend_npu_kernels} MLU_DEPS ${mlu_kernels}) endif() if(LITE_WITH_FPGA) @@ -110,7 +110,7 @@ if (NOT LITE_ON_TINY_PUBLISH) BM_DEPS ${bm_kernels} CL_DEPS ${opencl_kernels} FPGA_DEPS ${fpga_kernels} - HWAscendNPU_DEPS ${hw_ascend_npu_kernels}) + HW_ASCEND_NPU_DEPS ${hw_ascend_npu_kernels}) endif() # for light api @@ -132,7 +132,7 @@ lite_cc_library(light_api SRCS light_api.cc CL_DEPS ${opencl_kernels} FPGA_DEPS ${fpga_kernels} BM_DEPS ${bm_kernels} - HWAscendNPU_DEPS ${hw_ascend_npu_kernels}) + HW_ASCEND_NPU_DEPS ${hw_ascend_npu_kernels}) include(ExternalProject) set(LITE_DEMO_INSTALL_DIR "${THIRD_PARTY_PATH}/inference_demo" CACHE STRING @@ -151,7 +151,7 @@ if(WITH_TESTING) CL_DEPS ${opencl_kernels} FPGA_DEPS ${fpga_kernels} BM_DEPS ${bm_kernels} - HWAscendNPU_DEPS ${hw_ascend_npu_kernels} + HW_ASCEND_NPU_DEPS ${hw_ascend_npu_kernels} EXCLUDE_COMPILE_DEPS "ON" ARGS --model_dir=${LITE_MODEL_DIR}/lite_naive_model --optimized_model=${LITE_MODEL_DIR}/lite_naive_model_opt SERIAL) @@ -299,7 +299,7 @@ lite_cc_test(test_apis SRCS apis_test.cc FPGA_DEPS ${fpga_kernels} BM_DEPS ${bm_kernels} MLU_DEPS ${mlu_kernels} - HWAscendNPU_DEPS ${hw_ascend_npu_kernels} + HW_ASCEND_NPU_DEPS ${hw_ascend_npu_kernels} ARGS --model_dir=${LITE_MODEL_DIR}/lite_naive_model --optimized_model=${LITE_MODEL_DIR}/lite_naive_model_opt SERIAL) @@ -338,7 +338,7 @@ lite_cc_test(test_paddle_api SRCS paddle_api_test.cc DEPS paddle_api_full paddle FPGA_DEPS ${fpga_kernels} BM_DEPS ${bm_kernels} MLU_DEPS ${mlu_kernels} - HWAscendNPU_DEPS ${hw_ascend_npu_kernels} + HW_ASCEND_NPU_DEPS ${hw_ascend_npu_kernels} ARGS --model_dir=${LITE_MODEL_DIR}/lite_naive_model SERIAL) if (WITH_TESTING) add_dependencies(test_paddle_api extern_lite_download_lite_naive_model_tar_gz) diff --git a/lite/gen_code/CMakeLists.txt b/lite/gen_code/CMakeLists.txt index 7193622333..904bdcec0e 100644 --- a/lite/gen_code/CMakeLists.txt +++ b/lite/gen_code/CMakeLists.txt @@ -17,7 +17,7 @@ lite_cc_test(test_gen_code SRCS gen_code_test.cc NPU_DEPS ${npu_kernels} XPU_DEPS ${xpu_kernels} CL_DEPS ${opencl_kernels} - HWAscendNPU_DEPS ${hw_ascend_npu_kernels} + HW_ASCEND_NPU_DEPS ${hw_ascend_npu_kernels} FPGA_DEPS ${fpga_kernels} EXCLUDE_COMPILE_DEPS "ON" ARGS --optimized_model=${LITE_MODEL_DIR}/lite_naive_model_opt SERIAL) diff --git a/lite/kernels/hw_ascend_npu/bridges/CMakeLists.txt b/lite/kernels/hw_ascend_npu/bridges/CMakeLists.txt index a9426b6e84..bd2a276857 100644 --- a/lite/kernels/hw_ascend_npu/bridges/CMakeLists.txt +++ b/lite/kernels/hw_ascend_npu/bridges/CMakeLists.txt @@ -15,3 +15,5 @@ lite_cc_library(subgraph_bridge_graph_hw_ascend_npu set(hw_ascend_npu_subgraph_bridges subgraph_bridge_graph_hw_ascend_npu CACHE INTERNAL "hw_ascend_npu_subgraph_bridges") + +lite_cc_library(subgraph_bridge_act_op_hw_ascend_npu SRCS act_op.cc DEPS ${hw_ascend_npu_subgraph_bridge_deps}) diff --git a/lite/kernels/hw_ascend_npu/bridges/act_op.cc b/lite/kernels/hw_ascend_npu/bridges/act_op.cc index 03808631a1..fd8f900f7f 100644 --- a/lite/kernels/hw_ascend_npu/bridges/act_op.cc +++ b/lite/kernels/hw_ascend_npu/bridges/act_op.cc @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include #include "lite/kernels/hw_ascend_npu/bridges/graph.h" #include "lite/kernels/hw_ascend_npu/bridges/utility.h" #include "lite/kernels/npu/bridges/registry.h" @@ -124,7 +125,7 @@ REGISTER_SUBGRAPH_BRIDGE( REGISTER_SUBGRAPH_BRIDGE( relu_clipped, kNPU, - paddle::lite::subgraph::npu::ActConverter); + paddle::lite::subgraph::hw_ascend_npu::ActConverter); REGISTER_SUBGRAPH_BRIDGE( relu6, kHWAscendNPU, @@ -132,7 +133,7 @@ REGISTER_SUBGRAPH_BRIDGE( REGISTER_SUBGRAPH_BRIDGE( leaky_relu, kHWAscendNPU, - paddle::lite::subgraph::npu::ActConverter); + paddle::lite::subgraph::hw_ascend_npu::ActConverter); REGISTER_SUBGRAPH_BRIDGE( abs, kHWAscendNPU, diff --git a/lite/tests/kernels/activation_compute_test.cc b/lite/tests/kernels/activation_compute_test.cc index c71eac8d45..7a0aa5e511 100644 --- a/lite/tests/kernels/activation_compute_test.cc +++ b/lite/tests/kernels/activation_compute_test.cc @@ -291,6 +291,8 @@ TEST(Activation_relu, precision) { place = TARGET(kARM); #elif defined(LITE_WITH_XPU) place = TARGET(kXPU); +#elif defined(LITE_WITH_HW_ASCEND_NPU) + place = TARGET(kHWAscendNPU); #else return; #endif -- GitLab