From a3024131615055f9ee4b0150fe917ed86fef656d Mon Sep 17 00:00:00 2001 From: w30052974 Date: Sat, 29 Mar 2025 14:56:13 +0800 Subject: [PATCH] =?UTF-8?q?nnrt=205.1.0=E4=BB=A3=E7=A0=81=E5=90=8C?= =?UTF-8?q?=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: w30052974 --- .../delegates/nnrt_delegate/nnrt_delegate.h | 2 +- .../nnrt_delegate/nnrt_delegate_provider.cpp | 2 +- .../delegates/nnrt_delegate/nnrt_op_builder.h | 2 +- .../tflite/tools/utils.h | 2 +- .../native/neural_network_core/BUILD.gn | 1 - .../native/neural_network_core/backend.h | 2 +- .../neural_network_core/backend_manager.h | 2 +- .../neural_network_core/backend_registrar.cpp | 4 +- .../native/neural_network_core/compilation.h | 2 +- .../native/neural_network_core/compiler.h | 2 +- .../native/neural_network_core/cpp_type.h | 2 +- .../native/neural_network_core/executor.h | 2 +- .../neural_network_core.cpp | 4 +- .../neural_network_core/nnrt_client.cpp | 2 +- .../neural_network_core/tensor_desc.cpp | 2 +- .../native/neural_network_core/tensor_desc.h | 2 +- .../native/neural_network_core/utils.cpp | 2 +- .../native/neural_network_core/validation.h | 4 +- .../native/neural_network_runtime/BUILD.gn | 3 +- .../native/neural_network_runtime/device.h | 2 +- .../hdi_device_v1_0.cpp | 4 +- .../hdi_device_v2_0.cpp | 4 +- .../hdi_device_v2_1.cpp | 4 +- .../hdi_prepared_model_v1_0.cpp | 2 +- .../hdi_prepared_model_v2_0.cpp | 2 +- .../hdi_prepared_model_v2_1.cpp | 2 +- .../hdi_returncode_utils.h | 2 +- .../hdi_returncode_utils_v2_1.h | 2 +- .../neural_network_runtime/inner_model.cpp | 4 +- .../neural_network_runtime/inner_model.h | 4 +- .../lite_graph_to_hdi_model_v1_0.cpp | 2 +- .../lite_graph_to_hdi_model_v2_0.cpp | 2 +- .../lite_graph_to_hdi_model_v2_1.cpp | 2 +- .../neural_network_runtime/memory_manager.cpp | 2 +- .../neural_network_runtime/memory_manager.h | 2 +- .../neural_network_runtime.cpp | 6 +- .../neural_network_runtime_compat.cpp | 6 +- .../neural_network_runtime/nn_tensor.cpp | 2 +- .../native/neural_network_runtime/nn_tensor.h | 4 +- .../neural_network_runtime/nnbackend.cpp | 4 +- .../nncompiled_cache.cpp | 2 +- .../neural_network_runtime/nncompiled_cache.h | 2 +- .../neural_network_runtime/nncompiler.cpp | 2 +- .../neural_network_runtime/nnexecutor.cpp | 6 +- .../neural_network_runtime/nntensor.cpp | 4 +- .../ops/strided_slice_builder.cpp | 2 +- .../neural_network_runtime/ops_builder.h | 4 +- .../neural_network_runtime/ops_registry.h | 2 +- .../neural_network_runtime/prepared_model.h | 2 +- .../neural_network_runtime/quant_param.cpp | 2 +- .../neural_network_runtime/quant_param.h | 2 +- .../register_hdi_device_v1_0.cpp | 4 +- .../register_hdi_device_v2_0.cpp | 4 +- .../register_hdi_device_v2_1.cpp | 4 +- .../neural_network_runtime/transform.cpp | 2 +- .../native/neural_network_runtime/transform.h | 2 +- .../c/neural_network_runtime_inner.h | 2 +- test/fuzztest/data.h | 2 +- test/fuzztest/hdinnrtdevice_fuzzer/BUILD.gn | 5 +- .../hdinnrtdevice_fuzzer.cpp | 6 +- .../hdinnrtpreparedmodel_fuzzer/BUILD.gn | 5 +- .../hdinnrtpreparedmodel_fuzzer.cpp | 6 +- test/fuzztest/nnrt_device_impl.h | 2 +- test/fuzztest/nnrt_prepare_model_impl.h | 2 +- test/system_test/common/nnrt_test.cpp | 2 +- test/system_test/common/nnrt_test.h | 2 +- test/system_test/device_test.cpp | 2 +- test/system_test/end_to_end_test.cpp | 4 +- test/system_test/end_to_end_test.h | 2 +- test/unittest/common/file_utils.cpp | 2 +- .../common/v1_0/compilation_mock_idevice.cpp | 2 +- .../common/v1_0/inner_model_mock_device.cpp | 2 +- .../common/v2_0/compilation_mock_idevice.cpp | 2 +- .../common/v2_0/inner_model_mock_device.cpp | 2 +- test/unittest/components/BUILD.gn | 443 +++++++++++------- .../components/nn_backend/nn_backend_test.cpp | 2 +- .../nn_compiled_cache_test.cpp | 4 +- .../nn_compiler/nn_compiler_test.cpp | 4 +- .../nn_executor/nn_executor_test.cpp | 6 +- .../components/nn_tensor/nn_tensor_test.cpp | 6 +- .../device_manager/device_manager_test.cpp | 4 +- .../device_registrar_test.cpp | 2 +- .../v1_0/executor/executor_test.cpp | 2 +- .../hdi_prepared_model_test.cpp | 2 +- .../v1_0/inner_model/inner_model_test.cpp | 6 +- .../neural_network_core_test.cpp | 6 +- .../neural_network_core_test.h | 2 +- .../neural_network_runtime_test.cpp | 19 +- .../neural_network_runtime_test.h | 2 +- .../device_manager/device_manager_test.cpp | 2 +- .../device_registrar_test.cpp | 2 +- .../v2_0/executor/executor_test.cpp | 2 +- .../v2_0/hdi_device/hdi_device_test.cpp | 4 +- .../hdi_prepared_model_test.cpp | 2 +- .../v2_0/inner_model/inner_model_test.cpp | 6 +- .../neural_network_runtime_test.cpp | 19 +- .../neural_network_runtime_test.h | 2 +- .../hdi_prepared_model_test.cpp | 2 +- test/unittest/inner_kits/BUILD.gn | 20 +- .../neural_network_runtime_inner_test.h | 2 +- test/unittest/ops/BUILD.gn | 23 +- 101 files changed, 476 insertions(+), 326 deletions(-) diff --git a/example/deep_learning_framework/tflite/delegates/nnrt_delegate/nnrt_delegate.h b/example/deep_learning_framework/tflite/delegates/nnrt_delegate/nnrt_delegate.h index 50588bc..681e069 100644 --- a/example/deep_learning_framework/tflite/delegates/nnrt_delegate/nnrt_delegate.h +++ b/example/deep_learning_framework/tflite/delegates/nnrt_delegate/nnrt_delegate.h @@ -24,7 +24,7 @@ #include "tensorflow/lite/c/common.h" #include "tensorflow/lite/delegates/serialization.h" -#include "nnrt_implementation.h" +#include "../nnrt/nnrt_implementation.h" namespace tflite { namespace delegate { diff --git a/example/deep_learning_framework/tflite/delegates/nnrt_delegate/nnrt_delegate_provider.cpp b/example/deep_learning_framework/tflite/delegates/nnrt_delegate/nnrt_delegate_provider.cpp index 6bcd7f1..e7592a3 100644 --- a/example/deep_learning_framework/tflite/delegates/nnrt_delegate/nnrt_delegate_provider.cpp +++ b/example/deep_learning_framework/tflite/delegates/nnrt_delegate/nnrt_delegate_provider.cpp @@ -19,7 +19,7 @@ #include "tensorflow/lite/tools/delegates/delegate_provider.h" #include "nnrt_delegate.h" -#include "nnrt_implementation.h" +#include "../nnrt/nnrt_implementation.h" namespace tflite { namespace tools { diff --git a/example/deep_learning_framework/tflite/delegates/nnrt_delegate/nnrt_op_builder.h b/example/deep_learning_framework/tflite/delegates/nnrt_delegate/nnrt_op_builder.h index 5753075..bb4e823 100644 --- a/example/deep_learning_framework/tflite/delegates/nnrt_delegate/nnrt_op_builder.h +++ b/example/deep_learning_framework/tflite/delegates/nnrt_delegate/nnrt_op_builder.h @@ -23,7 +23,7 @@ #include "tensorflow/lite/kernels/kernel_util.h" #include "tensorflow/lite/minimal_logging.h" -#include "nnrt_implementation.h" +#include "../nnrt/nnrt_implementation.h" #include "tensor_mapping.h" namespace tflite { diff --git a/example/deep_learning_framework/tflite/tools/utils.h b/example/deep_learning_framework/tflite/tools/utils.h index 1efea84..f97a883 100644 --- a/example/deep_learning_framework/tflite/tools/utils.h +++ b/example/deep_learning_framework/tflite/tools/utils.h @@ -16,7 +16,7 @@ #ifndef TENSORFLOW_LITE_EXAMPLES_LABEL_CLASSIFY_UTILS_H #define TENSORFLOW_LITE_EXAMPLES_LABEL_CLASSIFY_UTILS_H -#include "label_classify.h" +#include "../label_classify/label_classify.h" #include "sys/time.h" diff --git a/frameworks/native/neural_network_core/BUILD.gn b/frameworks/native/neural_network_core/BUILD.gn index 02ece69..5d221b4 100644 --- a/frameworks/native/neural_network_core/BUILD.gn +++ b/frameworks/native/neural_network_core/BUILD.gn @@ -21,7 +21,6 @@ config("nnrt_config") { config("nnrt_public_config") { include_dirs = [ "./", - "../../../common", "../neural_network_runtime", "../../../interfaces/innerkits/c", "../../../interfaces/kits/c", diff --git a/frameworks/native/neural_network_core/backend.h b/frameworks/native/neural_network_core/backend.h index 977758a..1d3b21d 100644 --- a/frameworks/native/neural_network_core/backend.h +++ b/frameworks/native/neural_network_core/backend.h @@ -23,7 +23,7 @@ #include "compiler.h" #include "executor.h" #include "tensor.h" -#include "neural_network_runtime/neural_network_runtime_type.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_core/backend_manager.h b/frameworks/native/neural_network_core/backend_manager.h index 506f0c2..954fab5 100644 --- a/frameworks/native/neural_network_core/backend_manager.h +++ b/frameworks/native/neural_network_core/backend_manager.h @@ -26,7 +26,7 @@ #include #include "backend.h" -#include "log.h" +#include "common/log.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_core/backend_registrar.cpp b/frameworks/native/neural_network_core/backend_registrar.cpp index 54ed758..0a9b2a6 100644 --- a/frameworks/native/neural_network_core/backend_registrar.cpp +++ b/frameworks/native/neural_network_core/backend_registrar.cpp @@ -15,8 +15,8 @@ #include "backend_registrar.h" -#include "log.h" -#include "neural_network_runtime/neural_network_runtime_type.h" +#include "common/log.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_core/compilation.h b/frameworks/native/neural_network_core/compilation.h index 531773b..c327f7a 100644 --- a/frameworks/native/neural_network_core/compilation.h +++ b/frameworks/native/neural_network_core/compilation.h @@ -22,7 +22,7 @@ #include #include "compiler.h" -#include "neural_network_runtime/neural_network_runtime_type.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_core/compiler.h b/frameworks/native/neural_network_core/compiler.h index 6d62c9a..7bbed9e 100644 --- a/frameworks/native/neural_network_core/compiler.h +++ b/frameworks/native/neural_network_core/compiler.h @@ -19,7 +19,7 @@ #include #include -#include "neural_network_runtime/neural_network_runtime_type.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" #include "cpp_type.h" namespace OHOS { diff --git a/frameworks/native/neural_network_core/cpp_type.h b/frameworks/native/neural_network_core/cpp_type.h index 3122297..18f2a3f 100644 --- a/frameworks/native/neural_network_core/cpp_type.h +++ b/frameworks/native/neural_network_core/cpp_type.h @@ -21,7 +21,7 @@ #include #include -#include "neural_network_runtime/neural_network_runtime_type.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_core/executor.h b/frameworks/native/neural_network_core/executor.h index d63ad39..cf05e8c 100644 --- a/frameworks/native/neural_network_core/executor.h +++ b/frameworks/native/neural_network_core/executor.h @@ -23,7 +23,7 @@ #include "compiler.h" #include "tensor_desc.h" #include "executor_config.h" -#include "neural_network_runtime/neural_network_runtime_type.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_core/neural_network_core.cpp b/frameworks/native/neural_network_core/neural_network_core.cpp index ee8aa28..276aa82 100644 --- a/frameworks/native/neural_network_core/neural_network_core.cpp +++ b/frameworks/native/neural_network_core/neural_network_core.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "neural_network_runtime/neural_network_core.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_core.h" #include #include @@ -22,7 +22,7 @@ #include #include -#include "log.h" +#include "common/log.h" #include "executor.h" #include "tensor.h" #include "compilation.h" diff --git a/frameworks/native/neural_network_core/nnrt_client.cpp b/frameworks/native/neural_network_core/nnrt_client.cpp index 4921ac1..618efe1 100644 --- a/frameworks/native/neural_network_core/nnrt_client.cpp +++ b/frameworks/native/neural_network_core/nnrt_client.cpp @@ -18,7 +18,7 @@ #include #include -#include "log.h" +#include "common/log.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_core/tensor_desc.cpp b/frameworks/native/neural_network_core/tensor_desc.cpp index 2f1a8bf..34c3ce4 100644 --- a/frameworks/native/neural_network_core/tensor_desc.cpp +++ b/frameworks/native/neural_network_core/tensor_desc.cpp @@ -15,7 +15,7 @@ #include "tensor_desc.h" #include "validation.h" -#include "log.h" +#include "common/log.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_core/tensor_desc.h b/frameworks/native/neural_network_core/tensor_desc.h index 6297f06..08981a3 100644 --- a/frameworks/native/neural_network_core/tensor_desc.h +++ b/frameworks/native/neural_network_core/tensor_desc.h @@ -18,7 +18,7 @@ #include #include -#include "neural_network_runtime/neural_network_runtime_type.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_core/utils.cpp b/frameworks/native/neural_network_core/utils.cpp index 53334b8..2a635fe 100644 --- a/frameworks/native/neural_network_core/utils.cpp +++ b/frameworks/native/neural_network_core/utils.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "utils.h" +#include "common/utils.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_core/validation.h b/frameworks/native/neural_network_core/validation.h index 940033d..ddcd289 100644 --- a/frameworks/native/neural_network_core/validation.h +++ b/frameworks/native/neural_network_core/validation.h @@ -16,8 +16,8 @@ #ifndef NEURAL_NETWORK_RUNTIME_VALIDATION_H #define NEURAL_NETWORK_RUNTIME_VALIDATION_H -#include "log.h" -#include "neural_network_runtime/neural_network_runtime_type.h" +#include "common/log.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_runtime/BUILD.gn b/frameworks/native/neural_network_runtime/BUILD.gn index 31959c7..1d43ecd 100644 --- a/frameworks/native/neural_network_runtime/BUILD.gn +++ b/frameworks/native/neural_network_runtime/BUILD.gn @@ -18,7 +18,6 @@ config("nnrt_config") { cflags_cc = [ "-fexceptions" ] include_dirs = [ "./", - "../../../common", "../neural_network_core", "../../../interfaces/innerkits/c", "../../../interfaces/kits/c", @@ -195,7 +194,7 @@ ohos_shared_library("libneural_network_runtime") { "hitrace:libhitracechain", "init:libbegetutil", "ipc:ipc_core", - "mindspore:mindir_lib", + "mindspore:mindir", ] deps = [ "../neural_network_core:libneural_network_core" ] diff --git a/frameworks/native/neural_network_runtime/device.h b/frameworks/native/neural_network_runtime/device.h index 17017ba..5dd2d67 100644 --- a/frameworks/native/neural_network_runtime/device.h +++ b/frameworks/native/neural_network_runtime/device.h @@ -20,7 +20,7 @@ #include #include -#include "neural_network_runtime/neural_network_runtime_type.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" #include "cpp_type.h" #include "tensor_desc.h" #include "prepared_model.h" diff --git a/frameworks/native/neural_network_runtime/hdi_device_v1_0.cpp b/frameworks/native/neural_network_runtime/hdi_device_v1_0.cpp index a8fac98..c271b72 100644 --- a/frameworks/native/neural_network_runtime/hdi_device_v1_0.cpp +++ b/frameworks/native/neural_network_runtime/hdi_device_v1_0.cpp @@ -22,8 +22,8 @@ #include "lite_graph_to_hdi_model_v1_0.h" #include "memory_manager.h" #include "transform.h" -#include "log.h" -#include "utils.h" +#include "common/log.h" +#include "common/utils.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_runtime/hdi_device_v2_0.cpp b/frameworks/native/neural_network_runtime/hdi_device_v2_0.cpp index 459f3f0..6656124 100644 --- a/frameworks/native/neural_network_runtime/hdi_device_v2_0.cpp +++ b/frameworks/native/neural_network_runtime/hdi_device_v2_0.cpp @@ -24,8 +24,8 @@ #include "hdi_returncode_utils.h" #include "memory_manager.h" #include "transform.h" -#include "log.h" -#include "utils.h" +#include "common/log.h" +#include "common/utils.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_runtime/hdi_device_v2_1.cpp b/frameworks/native/neural_network_runtime/hdi_device_v2_1.cpp index 2f3135c..330fcce 100644 --- a/frameworks/native/neural_network_runtime/hdi_device_v2_1.cpp +++ b/frameworks/native/neural_network_runtime/hdi_device_v2_1.cpp @@ -24,8 +24,8 @@ #include "hdi_returncode_utils_v2_1.h" #include "memory_manager.h" #include "transform.h" -#include "log.h" -#include "utils.h" +#include "common/log.h" +#include "common/utils.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_runtime/hdi_prepared_model_v1_0.cpp b/frameworks/native/neural_network_runtime/hdi_prepared_model_v1_0.cpp index 2213dee..15b7548 100644 --- a/frameworks/native/neural_network_runtime/hdi_prepared_model_v1_0.cpp +++ b/frameworks/native/neural_network_runtime/hdi_prepared_model_v1_0.cpp @@ -15,7 +15,7 @@ #include "hdi_prepared_model_v1_0.h" -#include "log.h" +#include "common/log.h" #include "memory_manager.h" #include "nntensor.h" diff --git a/frameworks/native/neural_network_runtime/hdi_prepared_model_v2_0.cpp b/frameworks/native/neural_network_runtime/hdi_prepared_model_v2_0.cpp index b55cf7d..e4c2d68 100644 --- a/frameworks/native/neural_network_runtime/hdi_prepared_model_v2_0.cpp +++ b/frameworks/native/neural_network_runtime/hdi_prepared_model_v2_0.cpp @@ -15,7 +15,7 @@ #include "hdi_prepared_model_v2_0.h" -#include "log.h" +#include "common/log.h" #include "hdi_returncode_utils.h" #include "memory_manager.h" #include "nntensor.h" diff --git a/frameworks/native/neural_network_runtime/hdi_prepared_model_v2_1.cpp b/frameworks/native/neural_network_runtime/hdi_prepared_model_v2_1.cpp index 5be2fc3..c568239 100644 --- a/frameworks/native/neural_network_runtime/hdi_prepared_model_v2_1.cpp +++ b/frameworks/native/neural_network_runtime/hdi_prepared_model_v2_1.cpp @@ -15,7 +15,7 @@ #include "hdi_prepared_model_v2_1.h" -#include "log.h" +#include "common/log.h" #include "hdi_returncode_utils_v2_1.h" #include "memory_manager.h" #include "nntensor.h" diff --git a/frameworks/native/neural_network_runtime/hdi_returncode_utils.h b/frameworks/native/neural_network_runtime/hdi_returncode_utils.h index bd663a1..01f4252 100644 --- a/frameworks/native/neural_network_runtime/hdi_returncode_utils.h +++ b/frameworks/native/neural_network_runtime/hdi_returncode_utils.h @@ -20,7 +20,7 @@ #include #include #include -#include "log.h" +#include "common/log.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_runtime/hdi_returncode_utils_v2_1.h b/frameworks/native/neural_network_runtime/hdi_returncode_utils_v2_1.h index d95ba40..8c4df90 100644 --- a/frameworks/native/neural_network_runtime/hdi_returncode_utils_v2_1.h +++ b/frameworks/native/neural_network_runtime/hdi_returncode_utils_v2_1.h @@ -20,7 +20,7 @@ #include #include #include -#include "log.h" +#include "common/log.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_runtime/inner_model.cpp b/frameworks/native/neural_network_runtime/inner_model.cpp index cfe6423..0933e43 100644 --- a/frameworks/native/neural_network_runtime/inner_model.cpp +++ b/frameworks/native/neural_network_runtime/inner_model.cpp @@ -21,8 +21,8 @@ #include "securec.h" -#include "utils.h" -#include "scoped_trace.h" +#include "common/utils.h" +#include "common/scoped_trace.h" #include "backend_manager.h" #include "validation.h" #include "ops_builder.h" diff --git a/frameworks/native/neural_network_runtime/inner_model.h b/frameworks/native/neural_network_runtime/inner_model.h index 187d2a5..a041f26 100644 --- a/frameworks/native/neural_network_runtime/inner_model.h +++ b/frameworks/native/neural_network_runtime/inner_model.h @@ -22,8 +22,8 @@ #include "mindir.h" #include "ops_builder.h" #include "tensor_desc.h" -#include "neural_network_runtime_inner.h" -#include "neural_network_runtime/neural_network_runtime.h" +#include "interfaces/innerkits/c/neural_network_runtime_inner.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_runtime/lite_graph_to_hdi_model_v1_0.cpp b/frameworks/native/neural_network_runtime/lite_graph_to_hdi_model_v1_0.cpp index dca43ff..22a9b70 100644 --- a/frameworks/native/neural_network_runtime/lite_graph_to_hdi_model_v1_0.cpp +++ b/frameworks/native/neural_network_runtime/lite_graph_to_hdi_model_v1_0.cpp @@ -17,7 +17,7 @@ #include #include #include -#include "log.h" +#include "common/log.h" #include "message_parcel.h" #include "nnrt/v1_0/nnrt_types.h" #include "nnrt/v1_0/node_attr_types.h" diff --git a/frameworks/native/neural_network_runtime/lite_graph_to_hdi_model_v2_0.cpp b/frameworks/native/neural_network_runtime/lite_graph_to_hdi_model_v2_0.cpp index e34b571..772a486 100644 --- a/frameworks/native/neural_network_runtime/lite_graph_to_hdi_model_v2_0.cpp +++ b/frameworks/native/neural_network_runtime/lite_graph_to_hdi_model_v2_0.cpp @@ -17,7 +17,7 @@ #include #include #include -#include "log.h" +#include "common/log.h" #include "message_parcel.h" #include "nnrt/v2_0/nnrt_types.h" #include "nnrt/v2_0/node_attr_types.h" diff --git a/frameworks/native/neural_network_runtime/lite_graph_to_hdi_model_v2_1.cpp b/frameworks/native/neural_network_runtime/lite_graph_to_hdi_model_v2_1.cpp index d58b4ea..577223b 100644 --- a/frameworks/native/neural_network_runtime/lite_graph_to_hdi_model_v2_1.cpp +++ b/frameworks/native/neural_network_runtime/lite_graph_to_hdi_model_v2_1.cpp @@ -17,7 +17,7 @@ #include #include #include -#include "log.h" +#include "common/log.h" #include "message_parcel.h" #include "nnrt/v2_1/nnrt_types.h" #include "nnrt/v2_1/node_attr_types.h" diff --git a/frameworks/native/neural_network_runtime/memory_manager.cpp b/frameworks/native/neural_network_runtime/memory_manager.cpp index 70a89c8..217b33b 100644 --- a/frameworks/native/neural_network_runtime/memory_manager.cpp +++ b/frameworks/native/neural_network_runtime/memory_manager.cpp @@ -20,7 +20,7 @@ #include #include "cpp_type.h" -#include "log.h" +#include "common/log.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_runtime/memory_manager.h b/frameworks/native/neural_network_runtime/memory_manager.h index 3158291..d6c9607 100644 --- a/frameworks/native/neural_network_runtime/memory_manager.h +++ b/frameworks/native/neural_network_runtime/memory_manager.h @@ -19,7 +19,7 @@ #include #include -#include "neural_network_runtime/neural_network_runtime_type.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_runtime/neural_network_runtime.cpp b/frameworks/native/neural_network_runtime/neural_network_runtime.cpp index 1228e74..111cce2 100644 --- a/frameworks/native/neural_network_runtime/neural_network_runtime.cpp +++ b/frameworks/native/neural_network_runtime/neural_network_runtime.cpp @@ -13,13 +13,13 @@ * limitations under the License. */ -#include "neural_network_runtime_inner.h" -#include "neural_network_runtime/neural_network_runtime.h" +#include "interfaces/innerkits/c/neural_network_runtime_inner.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime.h" #include "compilation.h" #include "executor.h" #include "inner_model.h" -#include "log.h" +#include "common/log.h" #include "quant_param.h" #include "validation.h" #include "syspara/parameter.h" diff --git a/frameworks/native/neural_network_runtime/neural_network_runtime_compat.cpp b/frameworks/native/neural_network_runtime/neural_network_runtime_compat.cpp index 295ae51..d1b348a 100644 --- a/frameworks/native/neural_network_runtime/neural_network_runtime_compat.cpp +++ b/frameworks/native/neural_network_runtime/neural_network_runtime_compat.cpp @@ -13,13 +13,13 @@ * limitations under the License. */ -#include "neural_network_runtime_inner.h" -#include "neural_network_runtime/neural_network_runtime.h" +#include "interfaces/innerkits/c/neural_network_runtime_inner.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime.h" #include "compilation.h" #include "nnexecutor.h" #include "inner_model.h" -#include "log.h" +#include "common/log.h" using namespace OHOS::NeuralNetworkRuntime; diff --git a/frameworks/native/neural_network_runtime/nn_tensor.cpp b/frameworks/native/neural_network_runtime/nn_tensor.cpp index df42f2f..d0b8a54 100644 --- a/frameworks/native/neural_network_runtime/nn_tensor.cpp +++ b/frameworks/native/neural_network_runtime/nn_tensor.cpp @@ -20,7 +20,7 @@ #include "nn_tensor.h" #include "validation.h" #include "transform.h" -#include "log.h" +#include "common/log.h" #include "mindir.h" #include "mindir_types.h" #include "quant_param.h" diff --git a/frameworks/native/neural_network_runtime/nn_tensor.h b/frameworks/native/neural_network_runtime/nn_tensor.h index ca3ac71..9eec18d 100644 --- a/frameworks/native/neural_network_runtime/nn_tensor.h +++ b/frameworks/native/neural_network_runtime/nn_tensor.h @@ -21,8 +21,8 @@ #include "cpp_type.h" #include "tensor_desc.h" -#include "neural_network_runtime/neural_network_runtime_type.h" -#include "neural_network_runtime_inner.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" +#include "interfaces/innerkits/c/neural_network_runtime_inner.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_runtime/nnbackend.cpp b/frameworks/native/neural_network_runtime/nnbackend.cpp index 0647e79..dd2cec2 100644 --- a/frameworks/native/neural_network_runtime/nnbackend.cpp +++ b/frameworks/native/neural_network_runtime/nnbackend.cpp @@ -16,8 +16,8 @@ #include "nnbackend.h" #include -#include "log.h" -#include "utils.h" +#include "common/log.h" +#include "common/utils.h" #include "nncompiler.h" #include "nnexecutor.h" #include "nntensor.h" diff --git a/frameworks/native/neural_network_runtime/nncompiled_cache.cpp b/frameworks/native/neural_network_runtime/nncompiled_cache.cpp index 5f5ab3c..92a749f 100644 --- a/frameworks/native/neural_network_runtime/nncompiled_cache.cpp +++ b/frameworks/native/neural_network_runtime/nncompiled_cache.cpp @@ -21,7 +21,7 @@ #include #include -#include "utils.h" +#include "common/utils.h" #include "backend_manager.h" #include "nnbackend.h" diff --git a/frameworks/native/neural_network_runtime/nncompiled_cache.h b/frameworks/native/neural_network_runtime/nncompiled_cache.h index f182ac4..3c59c23 100644 --- a/frameworks/native/neural_network_runtime/nncompiled_cache.h +++ b/frameworks/native/neural_network_runtime/nncompiled_cache.h @@ -21,7 +21,7 @@ #include #include "device.h" -#include "neural_network_runtime/neural_network_runtime.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime.h" #include "tensor_desc.h" namespace OHOS { diff --git a/frameworks/native/neural_network_runtime/nncompiler.cpp b/frameworks/native/neural_network_runtime/nncompiler.cpp index a55825e..6d7edd3 100644 --- a/frameworks/native/neural_network_runtime/nncompiler.cpp +++ b/frameworks/native/neural_network_runtime/nncompiler.cpp @@ -22,7 +22,7 @@ #include "validation.h" #include "nncompiled_cache.h" -#include "utils.h" +#include "common/utils.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_runtime/nnexecutor.cpp b/frameworks/native/neural_network_runtime/nnexecutor.cpp index dcf4e9c..4332663 100644 --- a/frameworks/native/neural_network_runtime/nnexecutor.cpp +++ b/frameworks/native/neural_network_runtime/nnexecutor.cpp @@ -16,12 +16,12 @@ #include "nnexecutor.h" #include "nntensor.h" -#include "log.h" +#include "common/log.h" #include "cpp_type.h" #include "securec.h" -#include "utils.h" -#include "scoped_trace.h" +#include "common/utils.h" +#include "common/scoped_trace.h" #include "transform.h" namespace OHOS { diff --git a/frameworks/native/neural_network_runtime/nntensor.cpp b/frameworks/native/neural_network_runtime/nntensor.cpp index ab1cae6..5c11945 100644 --- a/frameworks/native/neural_network_runtime/nntensor.cpp +++ b/frameworks/native/neural_network_runtime/nntensor.cpp @@ -16,11 +16,11 @@ #include #include -#include "log.h" +#include "common/log.h" #include "backend_manager.h" #include "nnbackend.h" #include "nntensor.h" -#include "neural_network_runtime/neural_network_runtime_type.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_runtime/ops/strided_slice_builder.cpp b/frameworks/native/neural_network_runtime/ops/strided_slice_builder.cpp index dea7374..93a1bbf 100644 --- a/frameworks/native/neural_network_runtime/ops/strided_slice_builder.cpp +++ b/frameworks/native/neural_network_runtime/ops/strided_slice_builder.cpp @@ -17,7 +17,7 @@ #include "mindir.h" -#include "neural_network_runtime/neural_network_runtime_type.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_runtime/ops_builder.h b/frameworks/native/neural_network_runtime/ops_builder.h index 316df27..c42604d 100644 --- a/frameworks/native/neural_network_runtime/ops_builder.h +++ b/frameworks/native/neural_network_runtime/ops_builder.h @@ -20,8 +20,8 @@ #include #include "nn_tensor.h" -#include "log.h" -#include "neural_network_runtime/neural_network_runtime.h" +#include "common/log.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_runtime/ops_registry.h b/frameworks/native/neural_network_runtime/ops_registry.h index 41087e2..4908483 100644 --- a/frameworks/native/neural_network_runtime/ops_registry.h +++ b/frameworks/native/neural_network_runtime/ops_registry.h @@ -21,7 +21,7 @@ #include #include "ops_builder.h" -#include "neural_network_runtime/neural_network_runtime.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_runtime/prepared_model.h b/frameworks/native/neural_network_runtime/prepared_model.h index 73c2174..490c397 100644 --- a/frameworks/native/neural_network_runtime/prepared_model.h +++ b/frameworks/native/neural_network_runtime/prepared_model.h @@ -18,7 +18,7 @@ #include -#include "neural_network_runtime/neural_network_runtime_type.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" #include "cpp_type.h" namespace OHOS { diff --git a/frameworks/native/neural_network_runtime/quant_param.cpp b/frameworks/native/neural_network_runtime/quant_param.cpp index c6de260..ba54c8f 100644 --- a/frameworks/native/neural_network_runtime/quant_param.cpp +++ b/frameworks/native/neural_network_runtime/quant_param.cpp @@ -15,7 +15,7 @@ #include "quant_param.h" -#include "log.h" +#include "common/log.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_runtime/quant_param.h b/frameworks/native/neural_network_runtime/quant_param.h index 088e5d4..9722e10 100644 --- a/frameworks/native/neural_network_runtime/quant_param.h +++ b/frameworks/native/neural_network_runtime/quant_param.h @@ -19,7 +19,7 @@ #include #include "cpp_type.h" -#include "neural_network_runtime/neural_network_runtime_type.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_runtime/register_hdi_device_v1_0.cpp b/frameworks/native/neural_network_runtime/register_hdi_device_v1_0.cpp index fd0a7cc..d76825e 100644 --- a/frameworks/native/neural_network_runtime/register_hdi_device_v1_0.cpp +++ b/frameworks/native/neural_network_runtime/register_hdi_device_v1_0.cpp @@ -16,8 +16,8 @@ #include #include "hdi_device_v1_0.h" -#include "log.h" -#include "utils.h" +#include "common/log.h" +#include "common/utils.h" #include "nnbackend.h" #include "backend_registrar.h" diff --git a/frameworks/native/neural_network_runtime/register_hdi_device_v2_0.cpp b/frameworks/native/neural_network_runtime/register_hdi_device_v2_0.cpp index d0a3634..c8957c2 100644 --- a/frameworks/native/neural_network_runtime/register_hdi_device_v2_0.cpp +++ b/frameworks/native/neural_network_runtime/register_hdi_device_v2_0.cpp @@ -17,8 +17,8 @@ #include "hdi_device_v2_0.h" #include "hdi_returncode_utils.h" -#include "log.h" -#include "utils.h" +#include "common/log.h" +#include "common/utils.h" #include "nnbackend.h" #include "backend_registrar.h" diff --git a/frameworks/native/neural_network_runtime/register_hdi_device_v2_1.cpp b/frameworks/native/neural_network_runtime/register_hdi_device_v2_1.cpp index eb90088..2f6730d 100644 --- a/frameworks/native/neural_network_runtime/register_hdi_device_v2_1.cpp +++ b/frameworks/native/neural_network_runtime/register_hdi_device_v2_1.cpp @@ -17,8 +17,8 @@ #include "hdi_device_v2_1.h" #include "hdi_returncode_utils_v2_1.h" -#include "log.h" -#include "utils.h" +#include "common/log.h" +#include "common/utils.h" #include "nnbackend.h" #include "backend_registrar.h" diff --git a/frameworks/native/neural_network_runtime/transform.cpp b/frameworks/native/neural_network_runtime/transform.cpp index 5b3289e..10ee391 100644 --- a/frameworks/native/neural_network_runtime/transform.cpp +++ b/frameworks/native/neural_network_runtime/transform.cpp @@ -15,7 +15,7 @@ #include "transform.h" -#include "log.h" +#include "common/log.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/frameworks/native/neural_network_runtime/transform.h b/frameworks/native/neural_network_runtime/transform.h index 2cd50f9..369223c 100644 --- a/frameworks/native/neural_network_runtime/transform.h +++ b/frameworks/native/neural_network_runtime/transform.h @@ -16,7 +16,7 @@ #ifndef NEURAL_NETWORK_RUNTIME_TRANSFORM_H #define NEURAL_NETWORK_RUNTIME_TRANSFORM_H -#include "neural_network_runtime/neural_network_runtime_type.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" #include "cpp_type.h" #include "mindir.h" #include "mindir_types.h" diff --git a/interfaces/innerkits/c/neural_network_runtime_inner.h b/interfaces/innerkits/c/neural_network_runtime_inner.h index 22de228..67007bf 100644 --- a/interfaces/innerkits/c/neural_network_runtime_inner.h +++ b/interfaces/innerkits/c/neural_network_runtime_inner.h @@ -16,7 +16,7 @@ #ifndef NEURAL_NETWORK_RUNTIME_INNER_H #define NEURAL_NETWORK_RUNTIME_INNER_H -#include "neural_network_runtime/neural_network_runtime_type.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" #ifdef __cplusplus extern "C" { diff --git a/test/fuzztest/data.h b/test/fuzztest/data.h index d2b5123..d13e72e 100644 --- a/test/fuzztest/data.h +++ b/test/fuzztest/data.h @@ -18,7 +18,7 @@ #include -#include "log.h" +#include "../../common/log.h" #include "securec.h" namespace OHOS { diff --git a/test/fuzztest/hdinnrtdevice_fuzzer/BUILD.gn b/test/fuzztest/hdinnrtdevice_fuzzer/BUILD.gn index 54acb5e..d14bd87 100644 --- a/test/fuzztest/hdinnrtdevice_fuzzer/BUILD.gn +++ b/test/fuzztest/hdinnrtdevice_fuzzer/BUILD.gn @@ -22,7 +22,7 @@ ohos_fuzztest("HdiNnrtDeviceFuzzTest") { module_out_path = module_output_path fuzz_config_file = "../hdinnrtdevice_fuzzer" - include_dirs = [ "../" ] + include_dirs = [ "//third_party/bounds_checking_function/include" ] cflags = [ "-g", @@ -34,13 +34,10 @@ ohos_fuzztest("HdiNnrtDeviceFuzzTest") { sources = [ "hdinnrtdevice_fuzzer.cpp" ] external_deps = [ - "bounds_checking_function:libsec_shared", "c_utils:utils", "drivers_interface_nnrt:libnnrt_stub_2.0", "hdf_core:libhdi", "hilog:libhilog", "ipc:ipc_core", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", ] } diff --git a/test/fuzztest/hdinnrtdevice_fuzzer/hdinnrtdevice_fuzzer.cpp b/test/fuzztest/hdinnrtdevice_fuzzer/hdinnrtdevice_fuzzer.cpp index b2ecda8..9e2caf5 100644 --- a/test/fuzztest/hdinnrtdevice_fuzzer/hdinnrtdevice_fuzzer.cpp +++ b/test/fuzztest/hdinnrtdevice_fuzzer/hdinnrtdevice_fuzzer.cpp @@ -13,9 +13,9 @@ * limitations under the License. */ #include "hdinnrtdevice_fuzzer.h" -#include "data.h" -#include "nnrt_device_impl.h" -#include "log.h" +#include "../data.h" +#include "../nnrt_device_impl.h" +#include "../../../common/log.h" #include #include "message_parcel.h" diff --git a/test/fuzztest/hdinnrtpreparedmodel_fuzzer/BUILD.gn b/test/fuzztest/hdinnrtpreparedmodel_fuzzer/BUILD.gn index 414278b..99a094e 100644 --- a/test/fuzztest/hdinnrtpreparedmodel_fuzzer/BUILD.gn +++ b/test/fuzztest/hdinnrtpreparedmodel_fuzzer/BUILD.gn @@ -22,7 +22,7 @@ ohos_fuzztest("HdiNnrtPreparedModelFuzzTest") { module_out_path = module_output_path fuzz_config_file = "../hdinnrtpreparedmodel_fuzzer" - include_dirs = [ "../" ] + include_dirs = [ "//third_party/bounds_checking_function/include" ] cflags = [ "-g", @@ -34,13 +34,10 @@ ohos_fuzztest("HdiNnrtPreparedModelFuzzTest") { sources = [ "hdinnrtpreparedmodel_fuzzer.cpp" ] external_deps = [ - "bounds_checking_function:libsec_shared", "c_utils:utils", "drivers_interface_nnrt:libnnrt_stub_2.0", "hdf_core:libhdi", "hilog:libhilog", "ipc:ipc_core", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", ] } diff --git a/test/fuzztest/hdinnrtpreparedmodel_fuzzer/hdinnrtpreparedmodel_fuzzer.cpp b/test/fuzztest/hdinnrtpreparedmodel_fuzzer/hdinnrtpreparedmodel_fuzzer.cpp index b47be9c..b02ae6e 100644 --- a/test/fuzztest/hdinnrtpreparedmodel_fuzzer/hdinnrtpreparedmodel_fuzzer.cpp +++ b/test/fuzztest/hdinnrtpreparedmodel_fuzzer/hdinnrtpreparedmodel_fuzzer.cpp @@ -13,9 +13,9 @@ * limitations under the License. */ #include "hdinnrtpreparedmodel_fuzzer.h" -#include "data.h" -#include "nnrt_prepare_model_impl.h" -#include "log.h" +#include "../data.h" +#include "../nnrt_prepare_model_impl.h" +#include "../../../common/log.h" #include #include "message_parcel.h" diff --git a/test/fuzztest/nnrt_device_impl.h b/test/fuzztest/nnrt_device_impl.h index 745eeda..1e21b53 100644 --- a/test/fuzztest/nnrt_device_impl.h +++ b/test/fuzztest/nnrt_device_impl.h @@ -14,7 +14,7 @@ */ #ifndef OHOS_HDI_NNRT_V2_0_NNRTDEVICEIMPL_H #define OHOS_HDI_NNRT_V2_0_NNRTDEVICEIMPL_H -#include "log.h" +#include "../../common/log.h" #include "v2_0/innrt_device.h" diff --git a/test/fuzztest/nnrt_prepare_model_impl.h b/test/fuzztest/nnrt_prepare_model_impl.h index 6306de5..e73dcd6 100644 --- a/test/fuzztest/nnrt_prepare_model_impl.h +++ b/test/fuzztest/nnrt_prepare_model_impl.h @@ -15,7 +15,7 @@ #ifndef OHOS_HDI_NNRT_V2_0_NNRTPREPAREMODELIMPL_H #define OHOS_HDI_NNRT_V2_0_NNRTPREPAREMODELIMPL_H -#include "log.h" +#include "../../common/log.h" #include "v2_0/iprepared_model.h" diff --git a/test/system_test/common/nnrt_test.cpp b/test/system_test/common/nnrt_test.cpp index cd3c1a8..a431b2a 100644 --- a/test/system_test/common/nnrt_test.cpp +++ b/test/system_test/common/nnrt_test.cpp @@ -17,7 +17,7 @@ #include "securec.h" -#include "log.h" +#include "common/log.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/test/system_test/common/nnrt_test.h b/test/system_test/common/nnrt_test.h index c24d874..6e057f6 100644 --- a/test/system_test/common/nnrt_test.h +++ b/test/system_test/common/nnrt_test.h @@ -21,7 +21,7 @@ #include #include -#include "neural_network_runtime/neural_network_runtime.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/test/system_test/device_test.cpp b/test/system_test/device_test.cpp index a3c48b2..5694873 100644 --- a/test/system_test/device_test.cpp +++ b/test/system_test/device_test.cpp @@ -18,7 +18,7 @@ #include #include -#include "neural_network_runtime/neural_network_runtime.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime.h" using namespace testing; using namespace testing::ext; diff --git a/test/system_test/end_to_end_test.cpp b/test/system_test/end_to_end_test.cpp index 0998465..9248993 100644 --- a/test/system_test/end_to_end_test.cpp +++ b/test/system_test/end_to_end_test.cpp @@ -23,8 +23,8 @@ #include "securec.h" -#include "log.h" -#include "neural_network_runtime/neural_network_runtime.h" +#include "common/log.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime.h" namespace fs = std::filesystem; diff --git a/test/system_test/end_to_end_test.h b/test/system_test/end_to_end_test.h index d1066c0..ae05663 100644 --- a/test/system_test/end_to_end_test.h +++ b/test/system_test/end_to_end_test.h @@ -20,7 +20,7 @@ #include #include -#include "neural_network_runtime/neural_network_runtime.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime.h" #include "test/system_test/common/nnrt_test.h" namespace OHOS { diff --git a/test/unittest/common/file_utils.cpp b/test/unittest/common/file_utils.cpp index 2649fd8..c6cd79f 100644 --- a/test/unittest/common/file_utils.cpp +++ b/test/unittest/common/file_utils.cpp @@ -18,7 +18,7 @@ #include #include -#include "log.h" +#include "common/log.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/test/unittest/common/v1_0/compilation_mock_idevice.cpp b/test/unittest/common/v1_0/compilation_mock_idevice.cpp index ad47e84..2861376 100644 --- a/test/unittest/common/v1_0/compilation_mock_idevice.cpp +++ b/test/unittest/common/v1_0/compilation_mock_idevice.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "utils.h" +#include "common/utils.h" #include "hdi_device_v1_0.h" #include "nn_tensor.h" #include "test/unittest/common/v1_0/mock_idevice.h" diff --git a/test/unittest/common/v1_0/inner_model_mock_device.cpp b/test/unittest/common/v1_0/inner_model_mock_device.cpp index 6d319c3..a37d1bd 100644 --- a/test/unittest/common/v1_0/inner_model_mock_device.cpp +++ b/test/unittest/common/v1_0/inner_model_mock_device.cpp @@ -16,7 +16,7 @@ #include #include -#include "utils.h" +#include "common/utils.h" #include "inner_model.h" #include "hdi_device_v1_0.h" #include "ops/div_builder.h" diff --git a/test/unittest/common/v2_0/compilation_mock_idevice.cpp b/test/unittest/common/v2_0/compilation_mock_idevice.cpp index 20b185c..8e70e0e 100644 --- a/test/unittest/common/v2_0/compilation_mock_idevice.cpp +++ b/test/unittest/common/v2_0/compilation_mock_idevice.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "utils.h" +#include "common/utils.h" #include "hdi_device_v2_0.h" #include "nn_tensor.h" #include "test/unittest/common/v2_0/mock_idevice.h" diff --git a/test/unittest/common/v2_0/inner_model_mock_device.cpp b/test/unittest/common/v2_0/inner_model_mock_device.cpp index 909e2f1..ef6f1a7 100644 --- a/test/unittest/common/v2_0/inner_model_mock_device.cpp +++ b/test/unittest/common/v2_0/inner_model_mock_device.cpp @@ -16,7 +16,7 @@ #include #include -#include "utils.h" +#include "common/utils.h" #include "inner_model.h" #include "hdi_device_v2_0.h" #include "ops/div_builder.h" diff --git a/test/unittest/components/BUILD.gn b/test/unittest/components/BUILD.gn index f5d7bdc..ef821b2 100644 --- a/test/unittest/components/BUILD.gn +++ b/test/unittest/components/BUILD.gn @@ -18,7 +18,15 @@ module_output_path = "neural_network_runtime/" config("module_private_config") { visibility = [ ":*" ] - include_dirs = [ "../../.." ] + include_dirs = [ + "//third_party/googletest/googlemock/include", + "../../..", + "../../../frameworks/native", + "../../../frameworks/native/neural_network_runtime", + "../../../frameworks/native/neural_network_core", + "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", + "//third_party/mindspore/mindspore-src/source/mindspore/lite/mindir/include", + ] } ohos_unittest("CompilationV1_0Test") { @@ -27,17 +35,20 @@ ohos_unittest("CompilationV1_0Test") { sources = [ "../common/v1_0/compilation_mock_idevice.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gmock_main", - "googletest:gtest_main", "hdf_core:libhdf_utils", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -47,17 +58,20 @@ ohos_unittest("ExecutorV1_0Test") { sources = [ "../common/v1_0/executor_mock_device.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gmock_main", - "googletest:gtest_main", "hdf_core:libhdf_utils", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -68,16 +82,19 @@ ohos_unittest("DeviceManagerV1_0Test") { sources += [ "../common/v1_0/mock_idevice.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gmock_main", - "googletest:gtest_main", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -88,16 +105,19 @@ ohos_unittest("DeviceRegistrarV1_0Test") { sources += [ "../common/v1_0/mock_idevice.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gmock_main", - "googletest:gtest_main", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -109,16 +129,19 @@ ohos_unittest("HDIDeviceV1_0Test") { sources += [ "../common/file_utils.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gmock_main", - "googletest:gtest_main", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -130,16 +153,19 @@ ohos_unittest("HDIPreparedModelV1_0Test") { sources += [ "../common/file_utils.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gmock_main", - "googletest:gtest_main", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -150,15 +176,18 @@ ohos_unittest("MemoryManagerTest") { sources += [ "../common/file_utils.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gmock_main", - "googletest:gtest_main", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -168,17 +197,19 @@ ohos_unittest("NeuralNetworkCoreV1_0Test") { sources = [ "./v1_0/neural_network_core_test/neural_network_core_test.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gmock_main", - "googletest:gtest_main", "hdf_core:libhdf_utils", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", ] } @@ -188,15 +219,17 @@ ohos_unittest("QuantParamsTest") { sources = [ "./quant_param/quant_param_test.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gmock_main", - "googletest:gtest_main", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", ] } @@ -206,15 +239,17 @@ ohos_unittest("NNBackendTest") { sources = [ "./nn_backend/nn_backend_test.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gmock_main", - "googletest:gtest_main", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", ] } @@ -224,15 +259,17 @@ ohos_unittest("NNCompiledCacheTest") { sources = [ "./nn_compiled_cache/nn_compiled_cache_test.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gmock_main", - "googletest:gtest_main", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", ] } @@ -242,15 +279,17 @@ ohos_unittest("NNCompilerTest") { sources = [ "./nn_compiler/nn_compiler_test.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gmock_main", - "googletest:gtest_main", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", ] } @@ -260,15 +299,17 @@ ohos_unittest("NNExecutorTest") { sources = [ "./nn_executor/nn_executor_test.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gmock_main", - "googletest:gtest_main", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", ] } @@ -278,15 +319,17 @@ ohos_unittest("NNTensor2_0Test") { sources = [ "./nn_tensor/nn_tensor_test.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gmock_main", - "googletest:gtest_main", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", ] } @@ -296,15 +339,18 @@ ohos_unittest("TransformV1_0Test") { sources = [ "./v1_0/transform/transform_test.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gmock_main", - "googletest:gtest_main", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -315,17 +361,20 @@ ohos_unittest("InnerModelV1_0Test") { sources += [ "../common/v1_0/inner_model_mock_device.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gmock_main", - "googletest:gtest_main", "hdf_core:libhdf_utils", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -335,17 +384,20 @@ ohos_unittest("NnTensorV1_0Test") { sources = [ "./v1_0/inner_model/nn_tensor_test.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gmock_main", - "googletest:gtest_main", "hdf_core:libhdf_utils", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -355,17 +407,19 @@ ohos_unittest("NnTensorDescV1_0Test") { sources = [ "./v1_0/inner_model/nn_tensor_desc_test.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gmock_main", - "googletest:gtest_main", "hdf_core:libhdf_utils", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", ] } @@ -375,17 +429,20 @@ ohos_unittest("NnValidationV1_0Test") { sources = [ "./v1_0/inner_model/nn_validation_test.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gmock_main", - "googletest:gtest_main", "hdf_core:libhdf_utils", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -395,17 +452,20 @@ ohos_unittest("OpsRegistryV1_0Test") { sources = [ "./v1_0/inner_model/ops_registry_test.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gmock_main", - "googletest:gtest_main", "hdf_core:libhdf_utils", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -418,17 +478,20 @@ ohos_unittest("NeuralNetworkRuntimeV1_0Test") { configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gmock_main", - "googletest:gtest_main", "hdf_core:libhdf_utils", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -438,17 +501,20 @@ ohos_unittest("CompilationV2_0Test") { sources = [ "../common/v2_0/compilation_mock_idevice.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_2.0", - "googletest:gmock_main", - "googletest:gtest_main", "hdf_core:libhdf_utils", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -458,17 +524,20 @@ ohos_unittest("ExecutorV2_0Test") { sources = [ "../common/v2_0/executor_mock_device.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_2.0", - "googletest:gmock_main", - "googletest:gtest_main", "hdf_core:libhdf_utils", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -479,16 +548,19 @@ ohos_unittest("DeviceManagerV2_0Test") { sources += [ "../common/v2_0/mock_idevice.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_2.0", - "googletest:gmock_main", - "googletest:gtest_main", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -499,16 +571,19 @@ ohos_unittest("DeviceRegistrarV2_0Test") { sources += [ "../common/v2_0/mock_idevice.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_2.0", - "googletest:gmock_main", - "googletest:gtest_main", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -520,16 +595,19 @@ ohos_unittest("HDIDeviceV2_0Test") { sources += [ "../common/file_utils.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_2.0", - "googletest:gmock_main", - "googletest:gtest_main", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -541,16 +619,19 @@ ohos_unittest("HDIPreparedModelV2_0Test") { sources += [ "../common/file_utils.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_2.0", - "googletest:gmock_main", - "googletest:gtest_main", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -562,16 +643,18 @@ ohos_unittest("HDIPreparedModelV2_1Test") { sources += [ "../common/file_utils.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_2.0", - "googletest:gmock_main", - "googletest:gtest_main", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", ] } @@ -581,15 +664,18 @@ ohos_unittest("TransformV2_0Test") { sources = [ "./v2_0/transform/transform_test.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "drivers_interface_nnrt:libnnrt_proxy_2.0", - "googletest:gmock_main", - "googletest:gtest_main", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -600,17 +686,20 @@ ohos_unittest("InnerModelV2_0Test") { sources += [ "../common/v2_0/inner_model_mock_device.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_2.0", - "googletest:gmock_main", - "googletest:gtest_main", "hdf_core:libhdf_utils", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -620,17 +709,20 @@ ohos_unittest("NnTensorV2_0Test") { sources = [ "./v2_0/inner_model/nn_tensor_test.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_2.0", - "googletest:gmock_main", - "googletest:gtest_main", "hdf_core:libhdf_utils", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -640,17 +732,20 @@ ohos_unittest("NnValidationV2_0Test") { sources = [ "./v2_0/inner_model/nn_validation_test.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_2.0", - "googletest:gmock_main", - "googletest:gtest_main", "hdf_core:libhdf_utils", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -660,17 +755,20 @@ ohos_unittest("OpsRegistryV2_0Test") { sources = [ "./v2_0/inner_model/ops_registry_test.cpp" ] configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_2.0", - "googletest:gmock_main", - "googletest:gtest_main", "hdf_core:libhdf_utils", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } @@ -683,17 +781,20 @@ ohos_unittest("NeuralNetworkRuntimeV2_0Test") { configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_2.0", - "googletest:gmock_main", - "googletest:gtest_main", "hdf_core:libhdf_utils", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } diff --git a/test/unittest/components/nn_backend/nn_backend_test.cpp b/test/unittest/components/nn_backend/nn_backend_test.cpp index 71822d9..4b2ea39 100644 --- a/test/unittest/components/nn_backend/nn_backend_test.cpp +++ b/test/unittest/components/nn_backend/nn_backend_test.cpp @@ -18,7 +18,7 @@ #include "nnbackend.h" #include "device.h" -#include "neural_network_runtime/neural_network_runtime_type.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" #include "backend_manager.h" using namespace testing; diff --git a/test/unittest/components/nn_compiled_cache/nn_compiled_cache_test.cpp b/test/unittest/components/nn_compiled_cache/nn_compiled_cache_test.cpp index e43bca5..690be40 100644 --- a/test/unittest/components/nn_compiled_cache/nn_compiled_cache_test.cpp +++ b/test/unittest/components/nn_compiled_cache/nn_compiled_cache_test.cpp @@ -20,8 +20,8 @@ #include "device.h" #include "nnbackend.h" #include "backend_manager.h" -#include "neural_network_runtime/neural_network_runtime_type.h" -#include "utils.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" +#include "common/utils.h" using namespace testing; using namespace testing::ext; diff --git a/test/unittest/components/nn_compiler/nn_compiler_test.cpp b/test/unittest/components/nn_compiler/nn_compiler_test.cpp index 37d938f..bec6830 100644 --- a/test/unittest/components/nn_compiler/nn_compiler_test.cpp +++ b/test/unittest/components/nn_compiler/nn_compiler_test.cpp @@ -19,8 +19,8 @@ #include "nnbackend.h" #include "nncompiler.h" #include "device.h" -#include "neural_network_runtime/neural_network_runtime_type.h" -#include "utils.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" +#include "common/utils.h" #include "inner_model.h" using namespace testing; diff --git a/test/unittest/components/nn_executor/nn_executor_test.cpp b/test/unittest/components/nn_executor/nn_executor_test.cpp index c57486d..a6178eb 100644 --- a/test/unittest/components/nn_executor/nn_executor_test.cpp +++ b/test/unittest/components/nn_executor/nn_executor_test.cpp @@ -21,9 +21,9 @@ #include "nnbackend.h" #include "device.h" #include "prepared_model.h" -#include "neural_network_runtime/neural_network_runtime_type.h" -#include "utils.h" -#include "log.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" +#include "common/utils.h" +#include "common/log.h" using namespace testing; using namespace testing::ext; diff --git a/test/unittest/components/nn_tensor/nn_tensor_test.cpp b/test/unittest/components/nn_tensor/nn_tensor_test.cpp index 9a5a9d9..b651ac2 100644 --- a/test/unittest/components/nn_tensor/nn_tensor_test.cpp +++ b/test/unittest/components/nn_tensor/nn_tensor_test.cpp @@ -23,9 +23,9 @@ #include "backend_manager.h" #include "device.h" #include "prepared_model.h" -#include "neural_network_runtime/neural_network_runtime_type.h" -#include "utils.h" -#include "log.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" +#include "common/utils.h" +#include "common/log.h" #include "hdi_device_v1_0.h" using namespace testing; diff --git a/test/unittest/components/v1_0/device_manager/device_manager_test.cpp b/test/unittest/components/v1_0/device_manager/device_manager_test.cpp index ac2e5d5..441fb5c 100644 --- a/test/unittest/components/v1_0/device_manager/device_manager_test.cpp +++ b/test/unittest/components/v1_0/device_manager/device_manager_test.cpp @@ -17,13 +17,13 @@ #include #include -#include "log.h" +#include "common/log.h" #include "hdi_device_v1_0.h" #include "test/unittest/common/v1_0/mock_idevice.h" #include "lite_graph_to_hdi_model_v1_0.h" #include "device.h" -#include "neural_network_runtime/neural_network_runtime_type.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" #include "nnbackend.h" #include "ops_registry.h" #include "transform.h" diff --git a/test/unittest/components/v1_0/device_registrar/device_registrar_test.cpp b/test/unittest/components/v1_0/device_registrar/device_registrar_test.cpp index a5ba8f2..f8c67cd 100644 --- a/test/unittest/components/v1_0/device_registrar/device_registrar_test.cpp +++ b/test/unittest/components/v1_0/device_registrar/device_registrar_test.cpp @@ -19,7 +19,7 @@ #include -#include "log.h" +#include "common/log.h" #include "hdi_device_v1_0.h" #include "test/unittest/common/v1_0/mock_idevice.h" diff --git a/test/unittest/components/v1_0/executor/executor_test.cpp b/test/unittest/components/v1_0/executor/executor_test.cpp index 5cfee36..4156954 100644 --- a/test/unittest/components/v1_0/executor/executor_test.cpp +++ b/test/unittest/components/v1_0/executor/executor_test.cpp @@ -15,7 +15,7 @@ #include "executor_test.h" -#include "scoped_trace.h" +#include "common/scoped_trace.h" #include "compilation.h" #include "inner_model.h" #include "test/unittest/common/v1_0/mock_idevice.h" diff --git a/test/unittest/components/v1_0/hdi_prepared_model/hdi_prepared_model_test.cpp b/test/unittest/components/v1_0/hdi_prepared_model/hdi_prepared_model_test.cpp index c78654a..b013e43 100644 --- a/test/unittest/components/v1_0/hdi_prepared_model/hdi_prepared_model_test.cpp +++ b/test/unittest/components/v1_0/hdi_prepared_model/hdi_prepared_model_test.cpp @@ -20,7 +20,7 @@ #include #include -#include "log.h" +#include "common/log.h" #include "hdi_prepared_model_v1_0.h" #include "memory_manager.h" #include "transform.h" diff --git a/test/unittest/components/v1_0/inner_model/inner_model_test.cpp b/test/unittest/components/v1_0/inner_model/inner_model_test.cpp index 4bb42d0..15d7c8f 100644 --- a/test/unittest/components/v1_0/inner_model/inner_model_test.cpp +++ b/test/unittest/components/v1_0/inner_model/inner_model_test.cpp @@ -16,8 +16,8 @@ #include #include -#include "utils.h" -#include "log.h" +#include "common/utils.h" +#include "common/log.h" #include "nn_tensor.h" #include "inner_model.h" @@ -25,7 +25,7 @@ #include "lite_graph_to_hdi_model_v2_1.h" #include "device.h" -#include "neural_network_runtime/neural_network_runtime_type.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" #include "nnbackend.h" #include "ops_registry.h" #include "transform.h" diff --git a/test/unittest/components/v1_0/neural_network_core_test/neural_network_core_test.cpp b/test/unittest/components/v1_0/neural_network_core_test/neural_network_core_test.cpp index aa4b6c3..b997e3a 100644 --- a/test/unittest/components/v1_0/neural_network_core_test/neural_network_core_test.cpp +++ b/test/unittest/components/v1_0/neural_network_core_test/neural_network_core_test.cpp @@ -17,7 +17,7 @@ #include #include "nnbackend.h" -#include "utils.h" +#include "common/utils.h" #include "neural_network_core_test.h" #include "compilation.h" #include "tensor.h" @@ -25,8 +25,8 @@ #include "backend.h" #include "backend_manager.h" #include "backend_registrar.h" -#include "log.h" -#include "neural_network_runtime/neural_network_core.h" +#include "common/log.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_core.h" namespace OHOS { namespace NeuralNetworkRuntime { diff --git a/test/unittest/components/v1_0/neural_network_core_test/neural_network_core_test.h b/test/unittest/components/v1_0/neural_network_core_test/neural_network_core_test.h index fd05496..4c8d864 100644 --- a/test/unittest/components/v1_0/neural_network_core_test/neural_network_core_test.h +++ b/test/unittest/components/v1_0/neural_network_core_test/neural_network_core_test.h @@ -18,7 +18,7 @@ #include -#include "neural_network_runtime/neural_network_runtime.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime.h" #include "inner_model.h" #include "executor.h" diff --git a/test/unittest/components/v1_0/neural_network_runtime_test/neural_network_runtime_test.cpp b/test/unittest/components/v1_0/neural_network_runtime_test/neural_network_runtime_test.cpp index 457908d..65d52a9 100644 --- a/test/unittest/components/v1_0/neural_network_runtime_test/neural_network_runtime_test.cpp +++ b/test/unittest/components/v1_0/neural_network_runtime_test/neural_network_runtime_test.cpp @@ -17,7 +17,7 @@ #include "mindir.h" -#include "utils.h" +#include "common/utils.h" #include "compilation.h" #include "hdi_device_v1_0.h" #include "test/unittest/common/v1_0/mock_idevice.h" @@ -1052,6 +1052,23 @@ HWTEST_F(NeuralNetworkRuntimeTest, compilation_build_001, testing::ext::TestSize EXPECT_EQ(OH_NN_INVALID_PARAMETER, ret); } +/* + * @tc.name: compilation_build_002 + * @tc.desc: Verify the success of the OH_NNCompilation_Build function. + * @tc.type: FUNC + */ +HWTEST_F(NeuralNetworkRuntimeTest, compilation_build_002, testing::ext::TestSize.Level0) +{ + InnerModel innerModel; + EXPECT_EQ(OH_NN_SUCCESS, BuildModel(innerModel)); + + OH_NNModel* model = reinterpret_cast(&innerModel); + OH_NNCompilation* nnCompilation = OH_NNCompilation_Construct(model); + + OH_NN_ReturnCode ret = OH_NNCompilation_Build(nnCompilation); + EXPECT_EQ(OH_NN_SUCCESS, ret); +} + /* * @tc.name: compilation_destroy_001 * @tc.desc: Verify the OH_NNCompilation is nullptr of the OH_NNCompilation_Destroy function. diff --git a/test/unittest/components/v1_0/neural_network_runtime_test/neural_network_runtime_test.h b/test/unittest/components/v1_0/neural_network_runtime_test/neural_network_runtime_test.h index 5782ccc..7bee0f4 100644 --- a/test/unittest/components/v1_0/neural_network_runtime_test/neural_network_runtime_test.h +++ b/test/unittest/components/v1_0/neural_network_runtime_test/neural_network_runtime_test.h @@ -18,7 +18,7 @@ #include -#include "neural_network_runtime/neural_network_runtime.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime.h" #include "inner_model.h" #include "executor.h" diff --git a/test/unittest/components/v2_0/device_manager/device_manager_test.cpp b/test/unittest/components/v2_0/device_manager/device_manager_test.cpp index 3fc16c2..6d2dfff 100644 --- a/test/unittest/components/v2_0/device_manager/device_manager_test.cpp +++ b/test/unittest/components/v2_0/device_manager/device_manager_test.cpp @@ -16,7 +16,7 @@ #include #include -#include "log.h" +#include "common/log.h" #include "device_manager.h" #include "hdi_device_v2_0.h" #include "test/unittest/common/v2_0/mock_idevice.h" diff --git a/test/unittest/components/v2_0/device_registrar/device_registrar_test.cpp b/test/unittest/components/v2_0/device_registrar/device_registrar_test.cpp index c31c7e0..753e140 100644 --- a/test/unittest/components/v2_0/device_registrar/device_registrar_test.cpp +++ b/test/unittest/components/v2_0/device_registrar/device_registrar_test.cpp @@ -19,7 +19,7 @@ #include #include -#include "log.h" +#include "common/log.h" #include "hdi_device_v2_0.h" #include "test/unittest/common/v2_0/mock_idevice.h" diff --git a/test/unittest/components/v2_0/executor/executor_test.cpp b/test/unittest/components/v2_0/executor/executor_test.cpp index 0c9f7bb..5d6c44d 100644 --- a/test/unittest/components/v2_0/executor/executor_test.cpp +++ b/test/unittest/components/v2_0/executor/executor_test.cpp @@ -15,7 +15,7 @@ #include "executor_test.h" -#include "scoped_trace.h" +#include "common/scoped_trace.h" #include "compilation.h" #include "inner_model.h" #include "test/unittest/common/v2_0/mock_idevice.h" diff --git a/test/unittest/components/v2_0/hdi_device/hdi_device_test.cpp b/test/unittest/components/v2_0/hdi_device/hdi_device_test.cpp index b36c802..c9fa6ff 100644 --- a/test/unittest/components/v2_0/hdi_device/hdi_device_test.cpp +++ b/test/unittest/components/v2_0/hdi_device/hdi_device_test.cpp @@ -34,8 +34,8 @@ #include "lite_graph_to_hdi_model_v2_0.h" #include "lite_graph_to_hdi_model_v2_1.h" #include "device.h" -#include "neural_network_runtime/neural_network_runtime_type.h" -#include "log.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" +#include "common/log.h" #include "nnbackend.h" #include "ops_registry.h" #include "transform.h" diff --git a/test/unittest/components/v2_0/hdi_prepared_model/hdi_prepared_model_test.cpp b/test/unittest/components/v2_0/hdi_prepared_model/hdi_prepared_model_test.cpp index e18c71d..343ea31 100644 --- a/test/unittest/components/v2_0/hdi_prepared_model/hdi_prepared_model_test.cpp +++ b/test/unittest/components/v2_0/hdi_prepared_model/hdi_prepared_model_test.cpp @@ -20,7 +20,7 @@ #include #include -#include "log.h" +#include "common/log.h" #include "hdi_prepared_model_v2_0.h" #include "memory_manager.h" #include "transform.h" diff --git a/test/unittest/components/v2_0/inner_model/inner_model_test.cpp b/test/unittest/components/v2_0/inner_model/inner_model_test.cpp index fcfe45d..497c2d3 100644 --- a/test/unittest/components/v2_0/inner_model/inner_model_test.cpp +++ b/test/unittest/components/v2_0/inner_model/inner_model_test.cpp @@ -16,8 +16,8 @@ #include #include -#include "utils.h" -#include "log.h" +#include "common/utils.h" +#include "common/log.h" #include "nn_tensor.h" #include "inner_model.h" @@ -25,7 +25,7 @@ #include "lite_graph_to_hdi_model_v2_0.h" #include "device.h" -#include "neural_network_runtime/neural_network_runtime_type.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime_type.h" #include "nnbackend.h" #include "ops_registry.h" #include "transform.h" diff --git a/test/unittest/components/v2_0/neural_network_runtime_test/neural_network_runtime_test.cpp b/test/unittest/components/v2_0/neural_network_runtime_test/neural_network_runtime_test.cpp index 018c3af..a7d2de9 100644 --- a/test/unittest/components/v2_0/neural_network_runtime_test/neural_network_runtime_test.cpp +++ b/test/unittest/components/v2_0/neural_network_runtime_test/neural_network_runtime_test.cpp @@ -17,7 +17,7 @@ #include "mindir.h" -#include "utils.h" +#include "common/utils.h" #include "compilation.h" #include "hdi_device_v2_0.h" #include "test/unittest/common/v2_0/mock_idevice.h" @@ -998,6 +998,23 @@ HWTEST_F(NeuralNetworkRuntimeTest, compilation_build_001, testing::ext::TestSize EXPECT_EQ(OH_NN_INVALID_PARAMETER, ret); } +/* + * @tc.name: compilation_build_002 + * @tc.desc: Verify the success of the OH_NNCompilation_Build function. + * @tc.type: FUNC + */ +HWTEST_F(NeuralNetworkRuntimeTest, compilation_build_002, testing::ext::TestSize.Level0) +{ + InnerModel innerModel; + EXPECT_EQ(OH_NN_SUCCESS, BuildModel(innerModel)); + + OH_NNModel* model = reinterpret_cast(&innerModel); + OH_NNCompilation* nnCompilation = OH_NNCompilation_Construct(model); + + OH_NN_ReturnCode ret = OH_NNCompilation_Build(nnCompilation); + EXPECT_EQ(OH_NN_SUCCESS, ret); +} + /* * @tc.name: compilation_destroy_001 * @tc.desc: Verify the OH_NNCompilation is nullptr of the OH_NNCompilation_Destroy function. diff --git a/test/unittest/components/v2_0/neural_network_runtime_test/neural_network_runtime_test.h b/test/unittest/components/v2_0/neural_network_runtime_test/neural_network_runtime_test.h index 5782ccc..7bee0f4 100644 --- a/test/unittest/components/v2_0/neural_network_runtime_test/neural_network_runtime_test.h +++ b/test/unittest/components/v2_0/neural_network_runtime_test/neural_network_runtime_test.h @@ -18,7 +18,7 @@ #include -#include "neural_network_runtime/neural_network_runtime.h" +#include "interfaces/kits/c/neural_network_runtime/neural_network_runtime.h" #include "inner_model.h" #include "executor.h" diff --git a/test/unittest/components/v2_1/hdi_prepared_model/hdi_prepared_model_test.cpp b/test/unittest/components/v2_1/hdi_prepared_model/hdi_prepared_model_test.cpp index 1d2983c..d60f38f 100644 --- a/test/unittest/components/v2_1/hdi_prepared_model/hdi_prepared_model_test.cpp +++ b/test/unittest/components/v2_1/hdi_prepared_model/hdi_prepared_model_test.cpp @@ -20,7 +20,7 @@ #include #include -#include "log.h" +#include "common/log.h" #include "hdi_prepared_model_v2_1.h" #include "memory_manager.h" #include "transform.h" diff --git a/test/unittest/inner_kits/BUILD.gn b/test/unittest/inner_kits/BUILD.gn index 4dcd1dd..9f90993 100644 --- a/test/unittest/inner_kits/BUILD.gn +++ b/test/unittest/inner_kits/BUILD.gn @@ -18,6 +18,15 @@ module_output_path = "neural_network_runtime/" config("module_private_config") { visibility = [ ":*" ] + include_dirs = [ + "//third_party/googletest/googlemock/include", + "../../..", + "../../../frameworks/native/neural_network_runtime", + "../../../frameworks/native/neural_network_core", + "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", + "//third_party/mindspore/mindspore-src/source/mindspore/lite/mindir/include", + ] + cflags = [ "-Wall", "-Wextra", @@ -34,16 +43,19 @@ ohos_unittest("NeuralNetworkRuntimeInnerTest") { configs = [ ":module_private_config" ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "c_utils:utils", "drivers_interface_nnrt:libnnrt_proxy_1.0", - "googletest:gtest_main", "hdf_core:libhdf_utils", "hilog:libhilog", "hitrace:libhitracechain", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } diff --git a/test/unittest/inner_kits/neural_network_runtime_inner_test.h b/test/unittest/inner_kits/neural_network_runtime_inner_test.h index c481ec0..03d7d92 100644 --- a/test/unittest/inner_kits/neural_network_runtime_inner_test.h +++ b/test/unittest/inner_kits/neural_network_runtime_inner_test.h @@ -16,7 +16,7 @@ #ifndef NEURAL_NETWORK_RUNTIME_INNER_UNITTEST_H #define NEURAL_NETWORK_RUNTIME_INNER_UNITTEST_H -#include "neural_network_runtime_inner.h" +#include "interfaces/innerkits/c/neural_network_runtime_inner.h" #include namespace OHOS { diff --git a/test/unittest/ops/BUILD.gn b/test/unittest/ops/BUILD.gn index de5a980..e11bc3b 100644 --- a/test/unittest/ops/BUILD.gn +++ b/test/unittest/ops/BUILD.gn @@ -18,7 +18,15 @@ module_output_path = "neural_network_runtime/" config("module_private_config") { visibility = [ ":*" ] - include_dirs = [ "../../.." ] + include_dirs = [ + "//third_party/googletest/googlemock/include", + "../../..", + "../../../frameworks/native", + "../../../frameworks/native/neural_network_runtime", + "../../../frameworks/native/neural_network_core", + "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", + "//third_party/mindspore/mindspore-src/source/mindspore/lite/mindir/include", + ] } ohos_unittest("OpsUnittest") { @@ -147,15 +155,18 @@ ohos_unittest("OpsUnittest") { ":module_private_config", ] + deps = [ + "../../../frameworks/native/neural_network_core:libneural_network_core", + "../../../frameworks/native/neural_network_runtime:libneural_network_runtime", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + ] + external_deps = [ "drivers_interface_nnrt:libnnrt_proxy_2.1", - "googletest:gmock_main", - "googletest:gtest_main", "hilog:libhilog", "hitrace:hitrace_meter", - "mindspore:mindir_lib", - "neural_network_runtime:libneural_network_core", - "neural_network_runtime:libneural_network_runtime", + "mindspore:mindir", ] } -- Gitee