diff --git a/lite/CMakeLists.txt b/lite/CMakeLists.txt index 10d94f7b5a2635efb80f526c55cf899c8198c3cc..cc958f1b59d439e57e1b0ec093ffad9345687476 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 4236789b34adf3c3c3835b61655b89ad06fe5d35..eeba68630146870fd43bac3cd7eeaa1d9c576eac 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 77b04b54f4916c3add52839c2b98b6a2a0c323b3..80dc574de894280575837584dadd8024660c6dc6 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 34299844f22e4ffa3602c13f845dd2e169bb96e6..9573f7d7e90035c4dc1a29d40120c88470c0def2 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 85304de98c3c0ac5c5a45fcf140563a8fdd5a362..edbfbb416f1ae1798d885e22b9438e05f7e8f3d4 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 4fffb85cf181f5bfe53b96b75d34f1a7a4ba1398..76b4ac3d9b112701c2c606e3adbb75ff54c70a1b 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 e090b1ecfd7b613dfdae8b5e449e0b3b7ebb7713..ec5898f6c8299dc0068391431af60b9f075cc55c 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 e3d937a477fada68f049f4594b14cda2ad802f58..85482251815a6bb94135c38331e4b0f3e4611e05 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 c9aa157b752484faccb0b82a32d94003e6abdae7..f1bf3101b2dfd6ad363496cb442634ce63e2aa8e 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 481e4f98346c73d977dfd833ec5fa843bad3a499..1be3d17cb6430104c846feb14e76ab48fe43c544 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 534a5d27c1ab510c7b781915d5256cda49c99804..27e1226eaf471ca8ec8c5a9100cbed09070aa83e 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 cc587289bf6694b27dd9c10738062d9b70dafc0f..e27132c21658d31a857d8ca70fad698ba071a7d0 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 3d55e291cefc44b3df654510f000991b98dd64eb..02e3c7a1ce1a963474db1aa38ccf743f966cbab0 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 784caf6a7acde1203741662cdb2ab58c1b5af6e8..5459d819bbd2ca7bd8f3dad90bab6a6cf6faa4e8 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 cbf0bae0efcc85ea9bd0f22672fe2dc643a64f90..ff82daec100278be6e577c8efcef3995095adb9f 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 452e7954904d849a59b849edf7c6225d9ca6dbce..1321498db68eadd85b596b79c88201ad6bbe979b 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 85f9e18a53bfcd0489dc9c69a3809e63359f6082..7bfee2034fd96cf12582b36cf766ec9170ad965b 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 cb63cca01442ab65fb46c042d1c0dabebff2b9f2..83cae61e3f895e49638d5ee75e4c98a1503e626d 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 30c52530d0351f2124eb8b88541dfed48645b0d5..79dd612c59c51287710ee239ed069bc27752c488 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 efc0a9785d5e5d657733b8f94666ca107783ba61..290f3d88f874169f5bee629dd504791e172a4718 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 d90af63492baa53ffa02443115e7451b9a6d1594..c28d0487cc181c5a5af77fb61191bb20870ee0dd 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 e99b7da3a6f7302a3fba9be4da61d72b1086dfde..2c67383c0c9733265202df2ef3f0a1432701cb1a 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 404bb4a62f08639c8e9003e6d03547e5d8d569cd..7a10e0a5592997ba972f9a8d7d59a5de7287830b 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 9b7f717a415d0c70ed936b08a3ceb2ecae99e033..404d0039540ae8c37012cb081f22777358d41080 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 7a701c62fb745d04c86097e5b49bef8c18c313e2..aebfd68856da6e5ad416e65861d845ba16d83214 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 afc4c0c256d9acb9d0a24a69eada5ffc666049a4..86ad89308489fb1459f4e3c436753758cc612683 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 4e30cf5096862a569a424b715f881432480093f3..180e0aa46eb55ab74498bc3e58990bc7f0767072 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 439d85c06fbb01b7233ee7565e465e951c0b7dc4..af160f9c72d68219979a54bac203b743de733786 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 5f5377a0a103e196df8949f185c8016eb2583aeb..4a75961fdf9c62192d4637f783ff07eff5783a30 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 b2664dc963f35121b025fbed528c8159dfd90b79..a884b34856d336682036408c329efe3b0323909d 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 baa828a1a0a6f47fc744d6318388ae09c89f2399..f4a241c8d915d39abeaaf3a84ae53e89de162210 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 c87bcfe1a9d160a95f4f9edf179284d4921f6b18..ac4ae58d34489155d8a359ef7d5ab663ef8b239a 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 1ed6b59bc364ddea284923a143a98f8e335281a5..c37c97a3b4b85b746ea16c475646da6560919c41 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 3062e7e45479f55dd80f9e685e369f1e83a4ea17..6c556e6ca776e05c4f34695e825a4426ec8ca5de 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 51e69e731c7efb9813169c312c8afe965e6bb7b1..c3114f5360fa24b7694c946323d3272eefc46a31 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 f1348c84721d403a2b24b5537298a14307374265..86de45fedfbaaf9380857f26d507d20142a57676 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 c8a74ee5a98417612e1e0c627c6dce309050786e..91629a70fc47b5cd89f11943d44cd0c4cbd67af7 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 7937fbe6ead6785b689491e79a3895af337bfe80..3d6dc034816a7d37c28829e6b84573f852d5c935 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 cc10a9b44a1960e26b471b45add8a22f6bd36674..ad00e599ce77d7727c692db157db64d17cd13a5c 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 5bb3006f2b0c726ddeed2a363d5d09201ad2e0af..9bbfb11123fc3148968049d3b35faa308d7efcc0 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 3f423954884c215ed989da5d82a85e3cae897eeb..8abd7dbda45b2f2ac493ccfb4928252b01ab63e4 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 b91455e8cfb7c88294e931b87a52e509672636d4..688c62c7f65b50386612077ef2633bb1ac880254 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 2980646a8744d1f342a7ebe197f05707e503640c..4109c3333410604f03eaf3818adf183ff407a26f 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 f1e248bf4a38e67c1b93f985fa3abba5f5595cec..bbf9a21854fdccc2a48f9bfe4f6e76affcfd6965 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 ab0ea658e33231e34c8ddcb2252287b366fa6b82..45c04b0bfe226389c208e72f6bbb6f0037786b6a 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 cc7c22ea6f87d510041320cc470ef1c9040327ba..7f50726c80d52557fa741ae060f93eb889df64ad 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 433e08c2516ac66a376bd18c4bf0c7317948cc19..eb91e15a6f2e6b7d4e32e434cb87b109bca33db7 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