From c5e6540230767338f955b6ede1622c88520b7f5f Mon Sep 17 00:00:00 2001 From: huzhiqiang <912790387@qq.com> Date: Tue, 3 Sep 2019 16:17:44 +0800 Subject: [PATCH] move npu into backends(directory) and move python/ into tools/python (#1958) --- lite/CMakeLists.txt | 1 - lite/api/cxx_api.cc | 2 +- lite/backends/CMakeLists.txt | 3 ++- lite/{ => backends}/npu/CMakeLists.txt | 0 lite/{ => backends}/npu/bridge/CMakeLists.txt | 0 lite/{ => backends}/npu/bridge/act_op.cc | 4 ++-- lite/{ => backends}/npu/bridge/act_op_test.cc | 4 ++-- lite/{ => backends}/npu/bridge/batch_norm_op.cc | 4 ++-- lite/{ => backends}/npu/bridge/batch_norm_op_test.cc | 4 ++-- lite/{ => backends}/npu/bridge/concat_op.cc | 6 +++--- lite/{ => backends}/npu/bridge/concat_op_test.cc | 4 ++-- lite/{ => backends}/npu/bridge/conv_op.cc | 4 ++-- lite/{ => backends}/npu/bridge/conv_op_test.cc | 4 ++-- lite/{ => backends}/npu/bridge/conv_transpose_op.cc | 4 ++-- lite/{ => backends}/npu/bridge/conv_transpose_op_test.cc | 4 ++-- lite/{ => backends}/npu/bridge/elementwise_ops.cc | 4 ++-- lite/{ => backends}/npu/bridge/elementwise_ops_test.cc | 4 ++-- lite/{ => backends}/npu/bridge/fc_op.cc | 4 ++-- lite/{ => backends}/npu/bridge/fc_op_test.cc | 4 ++-- lite/{ => backends}/npu/bridge/interpolate_op.cc | 4 ++-- lite/{ => backends}/npu/bridge/interpolate_op_test.cc | 4 ++-- lite/{ => backends}/npu/bridge/mul_op.cc | 6 +++--- lite/{ => backends}/npu/bridge/mul_op_test.cc | 4 ++-- lite/{ => backends}/npu/bridge/pad2d_op.cc | 4 ++-- lite/{ => backends}/npu/bridge/pad2d_op_test.cc | 4 ++-- lite/{ => backends}/npu/bridge/paddle_use_npu_bridges.h | 2 +- lite/{ => backends}/npu/bridge/pool_op.cc | 4 ++-- lite/{ => backends}/npu/bridge/pool_op_test.cc | 4 ++-- lite/{ => backends}/npu/bridge/registry.cc | 2 +- lite/{ => backends}/npu/bridge/registry.h | 0 lite/{ => backends}/npu/bridge/reshape_op.cc | 4 ++-- lite/{ => backends}/npu/bridge/reshape_op_test.cc | 4 ++-- lite/{ => backends}/npu/bridge/scale_op.cc | 4 ++-- lite/{ => backends}/npu/bridge/scale_op_test.cc | 4 ++-- lite/{ => backends}/npu/bridge/shuffle_channel_op.cc | 4 ++-- lite/{ => backends}/npu/bridge/shuffle_channel_op_test.cc | 4 ++-- lite/{ => backends}/npu/bridge/softmax_op.cc | 4 ++-- lite/{ => backends}/npu/bridge/softmax_op_test.cc | 4 ++-- lite/{ => backends}/npu/bridge/split_op.cc | 6 +++--- lite/{ => backends}/npu/bridge/split_op_test.cc | 4 ++-- lite/{ => backends}/npu/bridge/test_helper.cc | 6 +++--- lite/{ => backends}/npu/bridge/test_helper.h | 0 lite/{ => backends}/npu/bridge/transpose_op.cc | 4 ++-- lite/{ => backends}/npu/bridge/transpose_op_test.cc | 4 ++-- lite/{ => backends}/npu/bridge/utils.cc | 2 +- lite/{ => backends}/npu/bridge/utils.h | 0 lite/{ => backends}/npu/npu_helper.cc | 2 +- lite/{ => backends}/npu/npu_helper.h | 0 lite/core/context.h | 2 +- lite/core/mir/subgraph/generate_npu_program_pass.cc | 8 ++++---- lite/core/mir/subgraph/generate_npu_program_pass.h | 4 ++-- lite/model_parser/model_parser.cc | 2 +- lite/tools/ci_build.sh | 2 +- lite/{ => tools}/python/lite_test.py | 0 54 files changed, 90 insertions(+), 90 deletions(-) rename lite/{ => backends}/npu/CMakeLists.txt (100%) rename lite/{ => backends}/npu/bridge/CMakeLists.txt (100%) rename lite/{ => backends}/npu/bridge/act_op.cc (97%) rename lite/{ => backends}/npu/bridge/act_op_test.cc (96%) rename lite/{ => backends}/npu/bridge/batch_norm_op.cc (97%) rename lite/{ => backends}/npu/bridge/batch_norm_op_test.cc (98%) rename lite/{ => backends}/npu/bridge/concat_op.cc (95%) rename lite/{ => backends}/npu/bridge/concat_op_test.cc (97%) rename lite/{ => backends}/npu/bridge/conv_op.cc (98%) rename lite/{ => backends}/npu/bridge/conv_op_test.cc (99%) rename lite/{ => backends}/npu/bridge/conv_transpose_op.cc (98%) rename lite/{ => backends}/npu/bridge/conv_transpose_op_test.cc (99%) rename lite/{ => backends}/npu/bridge/elementwise_ops.cc (96%) rename lite/{ => backends}/npu/bridge/elementwise_ops_test.cc (98%) rename lite/{ => backends}/npu/bridge/fc_op.cc (97%) rename lite/{ => backends}/npu/bridge/fc_op_test.cc (97%) rename lite/{ => backends}/npu/bridge/interpolate_op.cc (98%) rename lite/{ => backends}/npu/bridge/interpolate_op_test.cc (99%) rename lite/{ => backends}/npu/bridge/mul_op.cc (97%) rename lite/{ => backends}/npu/bridge/mul_op_test.cc (97%) rename lite/{ => backends}/npu/bridge/pad2d_op.cc (97%) rename lite/{ => backends}/npu/bridge/pad2d_op_test.cc (98%) rename lite/{ => backends}/npu/bridge/paddle_use_npu_bridges.h (96%) rename lite/{ => backends}/npu/bridge/pool_op.cc (97%) rename lite/{ => backends}/npu/bridge/pool_op_test.cc (98%) rename lite/{ => backends}/npu/bridge/registry.cc (95%) rename lite/{ => backends}/npu/bridge/registry.h (100%) rename lite/{ => backends}/npu/bridge/reshape_op.cc (98%) rename lite/{ => backends}/npu/bridge/reshape_op_test.cc (98%) rename lite/{ => backends}/npu/bridge/scale_op.cc (97%) rename lite/{ => backends}/npu/bridge/scale_op_test.cc (97%) rename lite/{ => backends}/npu/bridge/shuffle_channel_op.cc (95%) rename lite/{ => backends}/npu/bridge/shuffle_channel_op_test.cc (97%) rename lite/{ => backends}/npu/bridge/softmax_op.cc (96%) rename lite/{ => backends}/npu/bridge/softmax_op_test.cc (97%) rename lite/{ => backends}/npu/bridge/split_op.cc (96%) rename lite/{ => backends}/npu/bridge/split_op_test.cc (98%) rename lite/{ => backends}/npu/bridge/test_helper.cc (96%) rename lite/{ => backends}/npu/bridge/test_helper.h (100%) rename lite/{ => backends}/npu/bridge/transpose_op.cc (96%) rename lite/{ => backends}/npu/bridge/transpose_op_test.cc (98%) rename lite/{ => backends}/npu/bridge/utils.cc (98%) rename lite/{ => backends}/npu/bridge/utils.h (100%) rename lite/{ => backends}/npu/npu_helper.cc (99%) rename lite/{ => backends}/npu/npu_helper.h (100%) rename lite/{ => tools}/python/lite_test.py (100%) diff --git a/lite/CMakeLists.txt b/lite/CMakeLists.txt index 10d94f7b5a..cc958f1b59 100644 --- a/lite/CMakeLists.txt +++ b/lite/CMakeLists.txt @@ -15,7 +15,6 @@ set(LITE_ON_MOBILE ${LITE_WITH_LIGHT_WEIGHT_FRAMEWORK}) add_subdirectory(utils) add_subdirectory(operators) add_subdirectory(kernels) -add_subdirectory(npu) add_subdirectory(core) add_subdirectory(model_parser) add_subdirectory(api) diff --git a/lite/api/cxx_api.cc b/lite/api/cxx_api.cc index 4236789b34..eeba686301 100644 --- a/lite/api/cxx_api.cc +++ b/lite/api/cxx_api.cc @@ -19,7 +19,7 @@ #include #include "lite/utils/io.h" #ifdef LITE_WITH_NPU -#include "lite/npu/npu_helper.h" +#include "lite/backends/npu/npu_helper.h" #endif namespace paddle { diff --git a/lite/backends/CMakeLists.txt b/lite/backends/CMakeLists.txt index 77b04b54f4..80dc574de8 100644 --- a/lite/backends/CMakeLists.txt +++ b/lite/backends/CMakeLists.txt @@ -1,6 +1,7 @@ +add_subdirectory(arm) add_subdirectory(x86) add_subdirectory(cuda) add_subdirectory(fpga) add_subdirectory(host) -add_subdirectory(arm) add_subdirectory(opencl) +add_subdirectory(npu) diff --git a/lite/npu/CMakeLists.txt b/lite/backends/npu/CMakeLists.txt similarity index 100% rename from lite/npu/CMakeLists.txt rename to lite/backends/npu/CMakeLists.txt diff --git a/lite/npu/bridge/CMakeLists.txt b/lite/backends/npu/bridge/CMakeLists.txt similarity index 100% rename from lite/npu/bridge/CMakeLists.txt rename to lite/backends/npu/bridge/CMakeLists.txt diff --git a/lite/npu/bridge/act_op.cc b/lite/backends/npu/bridge/act_op.cc similarity index 97% rename from lite/npu/bridge/act_op.cc rename to lite/backends/npu/bridge/act_op.cc index 34299844f2..9573f7d7e9 100644 --- a/lite/npu/bridge/act_op.cc +++ b/lite/backends/npu/bridge/act_op.cc @@ -18,8 +18,8 @@ #include "ai_ddk_lib/include/graph/op/all_ops.h" #include "ai_ddk_lib/include/graph/operator.h" #include "ai_ddk_lib/include/graph/operator_reg.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/utils.h" +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/utils.h" #include "lite/operators/relu_op.h" namespace paddle { diff --git a/lite/npu/bridge/act_op_test.cc b/lite/backends/npu/bridge/act_op_test.cc similarity index 96% rename from lite/npu/bridge/act_op_test.cc rename to lite/backends/npu/bridge/act_op_test.cc index 85304de98c..edbfbb416f 100644 --- a/lite/npu/bridge/act_op_test.cc +++ b/lite/backends/npu/bridge/act_op_test.cc @@ -14,9 +14,9 @@ #include #include +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/test_helper.h" #include "lite/core/op_registry.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/test_helper.h" #include "lite/operators/relu_op.h" namespace paddle { diff --git a/lite/npu/bridge/batch_norm_op.cc b/lite/backends/npu/bridge/batch_norm_op.cc similarity index 97% rename from lite/npu/bridge/batch_norm_op.cc rename to lite/backends/npu/bridge/batch_norm_op.cc index 4fffb85cf1..76b4ac3d9b 100644 --- a/lite/npu/bridge/batch_norm_op.cc +++ b/lite/backends/npu/bridge/batch_norm_op.cc @@ -19,8 +19,8 @@ #include "ai_ddk_lib/include/graph/op/all_ops.h" #include "ai_ddk_lib/include/graph/operator.h" #include "ai_ddk_lib/include/graph/operator_reg.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/utils.h" +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/utils.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/batch_norm_op_test.cc b/lite/backends/npu/bridge/batch_norm_op_test.cc similarity index 98% rename from lite/npu/bridge/batch_norm_op_test.cc rename to lite/backends/npu/bridge/batch_norm_op_test.cc index e090b1ecfd..ec5898f6c8 100644 --- a/lite/npu/bridge/batch_norm_op_test.cc +++ b/lite/backends/npu/bridge/batch_norm_op_test.cc @@ -14,9 +14,9 @@ #include "lite/operators/batch_norm_op.h" #include +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/test_helper.h" #include "lite/core/op_registry.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/test_helper.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/concat_op.cc b/lite/backends/npu/bridge/concat_op.cc similarity index 95% rename from lite/npu/bridge/concat_op.cc rename to lite/backends/npu/bridge/concat_op.cc index e3d937a477..8548225181 100644 --- a/lite/npu/bridge/concat_op.cc +++ b/lite/backends/npu/bridge/concat_op.cc @@ -19,9 +19,9 @@ #include "ai_ddk_lib/include/graph/op/all_ops.h" #include "ai_ddk_lib/include/graph/operator.h" #include "ai_ddk_lib/include/graph/operator_reg.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/utils.h" -#include "lite/npu/npu_helper.h" +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/utils.h" +#include "lite/backends/npu/npu_helper.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/concat_op_test.cc b/lite/backends/npu/bridge/concat_op_test.cc similarity index 97% rename from lite/npu/bridge/concat_op_test.cc rename to lite/backends/npu/bridge/concat_op_test.cc index c9aa157b75..f1bf3101b2 100644 --- a/lite/npu/bridge/concat_op_test.cc +++ b/lite/backends/npu/bridge/concat_op_test.cc @@ -15,9 +15,9 @@ #include "lite/operators/concat_op.h" #include #include +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/test_helper.h" #include "lite/core/op_registry.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/test_helper.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/conv_op.cc b/lite/backends/npu/bridge/conv_op.cc similarity index 98% rename from lite/npu/bridge/conv_op.cc rename to lite/backends/npu/bridge/conv_op.cc index 481e4f9834..1be3d17cb6 100644 --- a/lite/npu/bridge/conv_op.cc +++ b/lite/backends/npu/bridge/conv_op.cc @@ -19,8 +19,8 @@ #include "ai_ddk_lib/include/graph/op/all_ops.h" #include "ai_ddk_lib/include/graph/operator.h" #include "ai_ddk_lib/include/graph/operator_reg.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/utils.h" +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/utils.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/conv_op_test.cc b/lite/backends/npu/bridge/conv_op_test.cc similarity index 99% rename from lite/npu/bridge/conv_op_test.cc rename to lite/backends/npu/bridge/conv_op_test.cc index 534a5d27c1..27e1226eaf 100644 --- a/lite/npu/bridge/conv_op_test.cc +++ b/lite/backends/npu/bridge/conv_op_test.cc @@ -15,9 +15,9 @@ #include "lite/operators/conv_op.h" #include #include +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/test_helper.h" #include "lite/core/op_registry.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/test_helper.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/conv_transpose_op.cc b/lite/backends/npu/bridge/conv_transpose_op.cc similarity index 98% rename from lite/npu/bridge/conv_transpose_op.cc rename to lite/backends/npu/bridge/conv_transpose_op.cc index cc587289bf..e27132c216 100644 --- a/lite/npu/bridge/conv_transpose_op.cc +++ b/lite/backends/npu/bridge/conv_transpose_op.cc @@ -19,8 +19,8 @@ #include "ai_ddk_lib/include/graph/op/all_ops.h" #include "ai_ddk_lib/include/graph/operator.h" #include "ai_ddk_lib/include/graph/operator_reg.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/utils.h" +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/utils.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/conv_transpose_op_test.cc b/lite/backends/npu/bridge/conv_transpose_op_test.cc similarity index 99% rename from lite/npu/bridge/conv_transpose_op_test.cc rename to lite/backends/npu/bridge/conv_transpose_op_test.cc index 3d55e291ce..02e3c7a1ce 100644 --- a/lite/npu/bridge/conv_transpose_op_test.cc +++ b/lite/backends/npu/bridge/conv_transpose_op_test.cc @@ -15,9 +15,9 @@ #include "lite/operators/conv_transpose_op.h" #include #include +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/test_helper.h" #include "lite/core/op_registry.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/test_helper.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/elementwise_ops.cc b/lite/backends/npu/bridge/elementwise_ops.cc similarity index 96% rename from lite/npu/bridge/elementwise_ops.cc rename to lite/backends/npu/bridge/elementwise_ops.cc index 784caf6a7a..5459d819bb 100644 --- a/lite/npu/bridge/elementwise_ops.cc +++ b/lite/backends/npu/bridge/elementwise_ops.cc @@ -19,8 +19,8 @@ #include "ai_ddk_lib/include/graph/op/all_ops.h" #include "ai_ddk_lib/include/graph/operator.h" #include "ai_ddk_lib/include/graph/operator_reg.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/utils.h" +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/utils.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/elementwise_ops_test.cc b/lite/backends/npu/bridge/elementwise_ops_test.cc similarity index 98% rename from lite/npu/bridge/elementwise_ops_test.cc rename to lite/backends/npu/bridge/elementwise_ops_test.cc index cbf0bae0ef..ff82daec10 100644 --- a/lite/npu/bridge/elementwise_ops_test.cc +++ b/lite/backends/npu/bridge/elementwise_ops_test.cc @@ -15,9 +15,9 @@ #include "lite/operators/elementwise_ops.h" #include #include +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/test_helper.h" #include "lite/core/op_registry.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/test_helper.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/fc_op.cc b/lite/backends/npu/bridge/fc_op.cc similarity index 97% rename from lite/npu/bridge/fc_op.cc rename to lite/backends/npu/bridge/fc_op.cc index 452e795490..1321498db6 100644 --- a/lite/npu/bridge/fc_op.cc +++ b/lite/backends/npu/bridge/fc_op.cc @@ -19,8 +19,8 @@ #include "ai_ddk_lib/include/graph/op/all_ops.h" #include "ai_ddk_lib/include/graph/operator.h" #include "ai_ddk_lib/include/graph/operator_reg.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/utils.h" +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/utils.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/fc_op_test.cc b/lite/backends/npu/bridge/fc_op_test.cc similarity index 97% rename from lite/npu/bridge/fc_op_test.cc rename to lite/backends/npu/bridge/fc_op_test.cc index 85f9e18a53..7bfee2034f 100644 --- a/lite/npu/bridge/fc_op_test.cc +++ b/lite/backends/npu/bridge/fc_op_test.cc @@ -14,9 +14,9 @@ #include "lite/operators/fc_op.h" #include +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/test_helper.h" #include "lite/core/op_registry.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/test_helper.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/interpolate_op.cc b/lite/backends/npu/bridge/interpolate_op.cc similarity index 98% rename from lite/npu/bridge/interpolate_op.cc rename to lite/backends/npu/bridge/interpolate_op.cc index cb63cca014..83cae61e3f 100644 --- a/lite/npu/bridge/interpolate_op.cc +++ b/lite/backends/npu/bridge/interpolate_op.cc @@ -18,8 +18,8 @@ #include "ai_ddk_lib/include/graph/op/all_ops.h" #include "ai_ddk_lib/include/graph/operator.h" #include "ai_ddk_lib/include/graph/operator_reg.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/utils.h" +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/utils.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/interpolate_op_test.cc b/lite/backends/npu/bridge/interpolate_op_test.cc similarity index 99% rename from lite/npu/bridge/interpolate_op_test.cc rename to lite/backends/npu/bridge/interpolate_op_test.cc index 30c52530d0..79dd612c59 100644 --- a/lite/npu/bridge/interpolate_op_test.cc +++ b/lite/backends/npu/bridge/interpolate_op_test.cc @@ -15,9 +15,9 @@ #include "lite/operators/interpolate_op.h" #include #include +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/test_helper.h" #include "lite/core/op_registry.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/test_helper.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/mul_op.cc b/lite/backends/npu/bridge/mul_op.cc similarity index 97% rename from lite/npu/bridge/mul_op.cc rename to lite/backends/npu/bridge/mul_op.cc index efc0a9785d..290f3d88f8 100644 --- a/lite/npu/bridge/mul_op.cc +++ b/lite/backends/npu/bridge/mul_op.cc @@ -19,9 +19,9 @@ #include "ai_ddk_lib/include/graph/op/all_ops.h" #include "ai_ddk_lib/include/graph/operator.h" #include "ai_ddk_lib/include/graph/operator_reg.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/utils.h" -#include "lite/npu/npu_helper.h" +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/utils.h" +#include "lite/backends/npu/npu_helper.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/mul_op_test.cc b/lite/backends/npu/bridge/mul_op_test.cc similarity index 97% rename from lite/npu/bridge/mul_op_test.cc rename to lite/backends/npu/bridge/mul_op_test.cc index d90af63492..c28d0487cc 100644 --- a/lite/npu/bridge/mul_op_test.cc +++ b/lite/backends/npu/bridge/mul_op_test.cc @@ -14,9 +14,9 @@ #include "lite/operators/mul_op.h" #include +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/test_helper.h" #include "lite/core/op_registry.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/test_helper.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/pad2d_op.cc b/lite/backends/npu/bridge/pad2d_op.cc similarity index 97% rename from lite/npu/bridge/pad2d_op.cc rename to lite/backends/npu/bridge/pad2d_op.cc index e99b7da3a6..2c67383c0c 100644 --- a/lite/npu/bridge/pad2d_op.cc +++ b/lite/backends/npu/bridge/pad2d_op.cc @@ -18,8 +18,8 @@ #include "ai_ddk_lib/include/graph/op/all_ops.h" #include "ai_ddk_lib/include/graph/operator.h" #include "ai_ddk_lib/include/graph/operator_reg.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/utils.h" +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/utils.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/pad2d_op_test.cc b/lite/backends/npu/bridge/pad2d_op_test.cc similarity index 98% rename from lite/npu/bridge/pad2d_op_test.cc rename to lite/backends/npu/bridge/pad2d_op_test.cc index 404bb4a62f..7a10e0a559 100644 --- a/lite/npu/bridge/pad2d_op_test.cc +++ b/lite/backends/npu/bridge/pad2d_op_test.cc @@ -14,9 +14,9 @@ #include "lite/operators/pad2d_op.h" #include +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/test_helper.h" #include "lite/core/op_registry.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/test_helper.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/paddle_use_npu_bridges.h b/lite/backends/npu/bridge/paddle_use_npu_bridges.h similarity index 96% rename from lite/npu/bridge/paddle_use_npu_bridges.h rename to lite/backends/npu/bridge/paddle_use_npu_bridges.h index 9b7f717a41..404d003954 100644 --- a/lite/npu/bridge/paddle_use_npu_bridges.h +++ b/lite/backends/npu/bridge/paddle_use_npu_bridges.h @@ -14,7 +14,7 @@ #pragma once -#include "lite/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/registry.h" USE_NPU_BRIDGE(mul); USE_NPU_BRIDGE(fc); diff --git a/lite/npu/bridge/pool_op.cc b/lite/backends/npu/bridge/pool_op.cc similarity index 97% rename from lite/npu/bridge/pool_op.cc rename to lite/backends/npu/bridge/pool_op.cc index 7a701c62fb..aebfd68856 100644 --- a/lite/npu/bridge/pool_op.cc +++ b/lite/backends/npu/bridge/pool_op.cc @@ -19,8 +19,8 @@ #include "ai_ddk_lib/include/graph/op/all_ops.h" #include "ai_ddk_lib/include/graph/operator.h" #include "ai_ddk_lib/include/graph/operator_reg.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/utils.h" +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/utils.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/pool_op_test.cc b/lite/backends/npu/bridge/pool_op_test.cc similarity index 98% rename from lite/npu/bridge/pool_op_test.cc rename to lite/backends/npu/bridge/pool_op_test.cc index afc4c0c256..86ad893084 100644 --- a/lite/npu/bridge/pool_op_test.cc +++ b/lite/backends/npu/bridge/pool_op_test.cc @@ -15,9 +15,9 @@ #include "lite/operators/pool_op.h" #include #include +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/test_helper.h" #include "lite/core/op_registry.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/test_helper.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/registry.cc b/lite/backends/npu/bridge/registry.cc similarity index 95% rename from lite/npu/bridge/registry.cc rename to lite/backends/npu/bridge/registry.cc index 4e30cf5096..180e0aa46e 100644 --- a/lite/npu/bridge/registry.cc +++ b/lite/backends/npu/bridge/registry.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "lite/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/registry.h" #include namespace paddle { diff --git a/lite/npu/bridge/registry.h b/lite/backends/npu/bridge/registry.h similarity index 100% rename from lite/npu/bridge/registry.h rename to lite/backends/npu/bridge/registry.h diff --git a/lite/npu/bridge/reshape_op.cc b/lite/backends/npu/bridge/reshape_op.cc similarity index 98% rename from lite/npu/bridge/reshape_op.cc rename to lite/backends/npu/bridge/reshape_op.cc index 439d85c06f..af160f9c72 100644 --- a/lite/npu/bridge/reshape_op.cc +++ b/lite/backends/npu/bridge/reshape_op.cc @@ -19,8 +19,8 @@ #include "ai_ddk_lib/include/graph/op/all_ops.h" #include "ai_ddk_lib/include/graph/operator.h" #include "ai_ddk_lib/include/graph/operator_reg.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/utils.h" +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/utils.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/reshape_op_test.cc b/lite/backends/npu/bridge/reshape_op_test.cc similarity index 98% rename from lite/npu/bridge/reshape_op_test.cc rename to lite/backends/npu/bridge/reshape_op_test.cc index 5f5377a0a1..4a75961fdf 100644 --- a/lite/npu/bridge/reshape_op_test.cc +++ b/lite/backends/npu/bridge/reshape_op_test.cc @@ -15,9 +15,9 @@ #include "lite/operators/reshape_op.h" #include #include +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/test_helper.h" #include "lite/core/op_registry.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/test_helper.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/scale_op.cc b/lite/backends/npu/bridge/scale_op.cc similarity index 97% rename from lite/npu/bridge/scale_op.cc rename to lite/backends/npu/bridge/scale_op.cc index b2664dc963..a884b34856 100644 --- a/lite/npu/bridge/scale_op.cc +++ b/lite/backends/npu/bridge/scale_op.cc @@ -19,8 +19,8 @@ #include "ai_ddk_lib/include/graph/op/all_ops.h" #include "ai_ddk_lib/include/graph/operator.h" #include "ai_ddk_lib/include/graph/operator_reg.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/utils.h" +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/utils.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/scale_op_test.cc b/lite/backends/npu/bridge/scale_op_test.cc similarity index 97% rename from lite/npu/bridge/scale_op_test.cc rename to lite/backends/npu/bridge/scale_op_test.cc index baa828a1a0..f4a241c8d9 100644 --- a/lite/npu/bridge/scale_op_test.cc +++ b/lite/backends/npu/bridge/scale_op_test.cc @@ -15,9 +15,9 @@ #include "lite/operators/scale_op.h" #include #include +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/test_helper.h" #include "lite/core/op_registry.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/test_helper.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/shuffle_channel_op.cc b/lite/backends/npu/bridge/shuffle_channel_op.cc similarity index 95% rename from lite/npu/bridge/shuffle_channel_op.cc rename to lite/backends/npu/bridge/shuffle_channel_op.cc index c87bcfe1a9..ac4ae58d34 100644 --- a/lite/npu/bridge/shuffle_channel_op.cc +++ b/lite/backends/npu/bridge/shuffle_channel_op.cc @@ -19,8 +19,8 @@ #include "ai_ddk_lib/include/graph/op/all_ops.h" #include "ai_ddk_lib/include/graph/operator.h" #include "ai_ddk_lib/include/graph/operator_reg.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/utils.h" +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/utils.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/shuffle_channel_op_test.cc b/lite/backends/npu/bridge/shuffle_channel_op_test.cc similarity index 97% rename from lite/npu/bridge/shuffle_channel_op_test.cc rename to lite/backends/npu/bridge/shuffle_channel_op_test.cc index 1ed6b59bc3..c37c97a3b4 100644 --- a/lite/npu/bridge/shuffle_channel_op_test.cc +++ b/lite/backends/npu/bridge/shuffle_channel_op_test.cc @@ -14,9 +14,9 @@ #include "lite/operators/shuffle_channel_op.h" #include +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/test_helper.h" #include "lite/core/op_registry.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/test_helper.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/softmax_op.cc b/lite/backends/npu/bridge/softmax_op.cc similarity index 96% rename from lite/npu/bridge/softmax_op.cc rename to lite/backends/npu/bridge/softmax_op.cc index 3062e7e454..6c556e6ca7 100644 --- a/lite/npu/bridge/softmax_op.cc +++ b/lite/backends/npu/bridge/softmax_op.cc @@ -19,8 +19,8 @@ #include "ai_ddk_lib/include/graph/op/all_ops.h" #include "ai_ddk_lib/include/graph/operator.h" #include "ai_ddk_lib/include/graph/operator_reg.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/utils.h" +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/utils.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/softmax_op_test.cc b/lite/backends/npu/bridge/softmax_op_test.cc similarity index 97% rename from lite/npu/bridge/softmax_op_test.cc rename to lite/backends/npu/bridge/softmax_op_test.cc index 51e69e731c..c3114f5360 100644 --- a/lite/npu/bridge/softmax_op_test.cc +++ b/lite/backends/npu/bridge/softmax_op_test.cc @@ -14,9 +14,9 @@ #include "lite/operators/softmax_op.h" #include +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/test_helper.h" #include "lite/core/op_registry.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/test_helper.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/split_op.cc b/lite/backends/npu/bridge/split_op.cc similarity index 96% rename from lite/npu/bridge/split_op.cc rename to lite/backends/npu/bridge/split_op.cc index f1348c8472..86de45fedf 100644 --- a/lite/npu/bridge/split_op.cc +++ b/lite/backends/npu/bridge/split_op.cc @@ -19,9 +19,9 @@ #include "ai_ddk_lib/include/graph/op/all_ops.h" #include "ai_ddk_lib/include/graph/operator.h" #include "ai_ddk_lib/include/graph/operator_reg.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/utils.h" -#include "lite/npu/npu_helper.h" +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/utils.h" +#include "lite/backends/npu/npu_helper.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/split_op_test.cc b/lite/backends/npu/bridge/split_op_test.cc similarity index 98% rename from lite/npu/bridge/split_op_test.cc rename to lite/backends/npu/bridge/split_op_test.cc index c8a74ee5a9..91629a70fc 100644 --- a/lite/npu/bridge/split_op_test.cc +++ b/lite/backends/npu/bridge/split_op_test.cc @@ -14,9 +14,9 @@ #include "lite/operators/split_op.h" #include +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/test_helper.h" #include "lite/core/op_registry.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/test_helper.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/test_helper.cc b/lite/backends/npu/bridge/test_helper.cc similarity index 96% rename from lite/npu/bridge/test_helper.cc rename to lite/backends/npu/bridge/test_helper.cc index 7937fbe6ea..3d6dc03481 100644 --- a/lite/npu/bridge/test_helper.cc +++ b/lite/backends/npu/bridge/test_helper.cc @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "lite/npu/bridge/test_helper.h" +#include "lite/backends/npu/bridge/test_helper.h" #include #include "ai_ddk_lib/include/graph/op/all_ops.h" +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/utils.h" #include "lite/core/op_registry.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/utils.h" #include "lite/operators/graph_op.h" namespace paddle { diff --git a/lite/npu/bridge/test_helper.h b/lite/backends/npu/bridge/test_helper.h similarity index 100% rename from lite/npu/bridge/test_helper.h rename to lite/backends/npu/bridge/test_helper.h diff --git a/lite/npu/bridge/transpose_op.cc b/lite/backends/npu/bridge/transpose_op.cc similarity index 96% rename from lite/npu/bridge/transpose_op.cc rename to lite/backends/npu/bridge/transpose_op.cc index cc10a9b44a..ad00e599ce 100644 --- a/lite/npu/bridge/transpose_op.cc +++ b/lite/backends/npu/bridge/transpose_op.cc @@ -19,8 +19,8 @@ #include "ai_ddk_lib/include/graph/op/all_ops.h" #include "ai_ddk_lib/include/graph/operator.h" #include "ai_ddk_lib/include/graph/operator_reg.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/utils.h" +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/utils.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/transpose_op_test.cc b/lite/backends/npu/bridge/transpose_op_test.cc similarity index 98% rename from lite/npu/bridge/transpose_op_test.cc rename to lite/backends/npu/bridge/transpose_op_test.cc index 5bb3006f2b..9bbfb11123 100644 --- a/lite/npu/bridge/transpose_op_test.cc +++ b/lite/backends/npu/bridge/transpose_op_test.cc @@ -14,9 +14,9 @@ #include "lite/operators/transpose_op.h" #include +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/test_helper.h" #include "lite/core/op_registry.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/test_helper.h" namespace paddle { namespace lite { diff --git a/lite/npu/bridge/utils.cc b/lite/backends/npu/bridge/utils.cc similarity index 98% rename from lite/npu/bridge/utils.cc rename to lite/backends/npu/bridge/utils.cc index 3f42395488..8abd7dbda4 100644 --- a/lite/npu/bridge/utils.cc +++ b/lite/backends/npu/bridge/utils.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "lite/npu/bridge/utils.h" +#include "lite/backends/npu/bridge/utils.h" #include #include // NOLINT #include diff --git a/lite/npu/bridge/utils.h b/lite/backends/npu/bridge/utils.h similarity index 100% rename from lite/npu/bridge/utils.h rename to lite/backends/npu/bridge/utils.h diff --git a/lite/npu/npu_helper.cc b/lite/backends/npu/npu_helper.cc similarity index 99% rename from lite/npu/npu_helper.cc rename to lite/backends/npu/npu_helper.cc index b91455e8cf..688c62c7f6 100644 --- a/lite/npu/npu_helper.cc +++ b/lite/backends/npu/npu_helper.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "lite/npu/npu_helper.h" +#include "lite/backends/npu/npu_helper.h" #include #include #include diff --git a/lite/npu/npu_helper.h b/lite/backends/npu/npu_helper.h similarity index 100% rename from lite/npu/npu_helper.h rename to lite/backends/npu/npu_helper.h diff --git a/lite/core/context.h b/lite/core/context.h index 2980646a87..4109c33334 100644 --- a/lite/core/context.h +++ b/lite/core/context.h @@ -26,7 +26,7 @@ #include "lite/backends/opencl/cl_runtime.h" #endif #ifdef LITE_WITH_NPU -#include "lite/npu/npu_helper.h" +#include "lite/backends/npu/npu_helper.h" #endif #include diff --git a/lite/core/mir/subgraph/generate_npu_program_pass.cc b/lite/core/mir/subgraph/generate_npu_program_pass.cc index f1e248bf4a..bbf9a21854 100644 --- a/lite/core/mir/subgraph/generate_npu_program_pass.cc +++ b/lite/core/mir/subgraph/generate_npu_program_pass.cc @@ -27,10 +27,10 @@ #include "ai_ddk_lib/include/graph/model.h" #include "ai_ddk_lib/include/graph/op/all_ops.h" // for ge::op::Data #include "ai_ddk_lib/include/graph/operator_reg.h" -#include "lite/npu/bridge/paddle_use_npu_bridges.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/bridge/utils.h" -#include "lite/npu/npu_helper.h" +#include "lite/backends/npu/bridge/paddle_use_npu_bridges.h" +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/bridge/utils.h" +#include "lite/backends/npu/npu_helper.h" namespace paddle { namespace lite { diff --git a/lite/core/mir/subgraph/generate_npu_program_pass.h b/lite/core/mir/subgraph/generate_npu_program_pass.h index ab0ea658e3..45c04b0bfe 100644 --- a/lite/core/mir/subgraph/generate_npu_program_pass.h +++ b/lite/core/mir/subgraph/generate_npu_program_pass.h @@ -20,10 +20,10 @@ #include #include #include +#include "lite/backends/npu/bridge/registry.h" +#include "lite/backends/npu/npu_helper.h" #include "lite/core/mir/pass.h" #include "lite/core/mir/subgraph/subgraph_program_pass.h" -#include "lite/npu/bridge/registry.h" -#include "lite/npu/npu_helper.h" namespace paddle { namespace lite { diff --git a/lite/model_parser/model_parser.cc b/lite/model_parser/model_parser.cc index cc7c22ea6f..7f50726c80 100644 --- a/lite/model_parser/model_parser.cc +++ b/lite/model_parser/model_parser.cc @@ -32,7 +32,7 @@ #include "lite/utils/io.h" #ifdef LITE_WITH_NPU -#include "lite/npu/npu_helper.h" +#include "lite/backends/npu/npu_helper.h" #endif namespace paddle { diff --git a/lite/tools/ci_build.sh b/lite/tools/ci_build.sh index 433e08c251..eb91e15a6f 100755 --- a/lite/tools/ci_build.sh +++ b/lite/tools/ci_build.sh @@ -243,7 +243,7 @@ function build_test_train { make -j$NUM_CORES_FOR_COMPILE find -name "*.whl" | xargs pip2 install - python ../lite/python/lite_test.py + python ../lite/tools/python/lite_test.py } diff --git a/lite/python/lite_test.py b/lite/tools/python/lite_test.py similarity index 100% rename from lite/python/lite_test.py rename to lite/tools/python/lite_test.py -- GitLab