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 50588bc826826c5b16a4cf96be0f100874a82be9..681e0699d5d53ff8781538de7ce9cf03525dba2f 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 6bcd7f11c9c6ab9a05d3914d723b2583c439382b..e7592a374a503e43b60e4be981afdd0f0cb7339c 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 57530757beeb662d734bf0accc0c92c4dbaabcb8..bb4e82386f78c797246b929fdf7bb99b15d34330 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 1efea84b604006e89b818d5cd9da1c5d4cc9bea4..f97a8831b75f80c9bb69bc6a662c0494107efc5e 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 02ece699b29a14fb92b268d381d60f36318c202c..5d221b4b15404fbece2101ae485651aae0bb1f0e 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 977758a31aef7ace14694545e355a2631667a1aa..1d3b21dd47860c7b443353cb13683eeb282c2455 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 506f0c29dcbfdf99f4f10358ed2668f849336ddc..954fab58a06297198c78e5f5eb0d457805675546 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 54ed758a9e4acbf78fe2326bf1edbe55f926c861..0a9b2a6b68e8a3c68fb3d12f5afcc89d0f85cbb3 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 531773b6f31af25651f513fc8330a821324d315b..c327f7a1714089c6cac5b9eae07bf9328b343661 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 6d62c9abc90c47145b5ffa63eeb4b4975c58016c..7bbed9ea9bbb81a5e6238718133801b7b1667abc 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 3122297a815ec22734cedce52e913f56bb3b1b33..18f2a3f01b2bad56bb711ebe1850b66af0ad6062 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 d63ad3994d3b04d6c75c404b94e2750261136e84..cf05e8c0471775851cbd890318a1166f3bb858c4 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 ee8aa28c99e24401cf8993219d001fc86bba928c..276aa820b98db4c97e6f750999b05ed137da0414 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 4921ac11c69a5be9776956ee7fa78875b0907136..618efe1e5f28f06d642087651618ac9d5cf50fd1 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 2f1a8bf2903aa1eea726591755f705a625067bbe..34c3ce4a5be026f12dbbf8acaf5eaab2bff30702 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 6297f065e3d0650fc20c79a332f1dd43d0cc6ca3..08981a3c9be170b3b514d77dd2bfd0277360c438 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 53334b8b7593983b381343e8a6933bd54a1a6266..2a635fe4fe97c00718eaa4e3c8ede57f75d274f4 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 940033d7e02c58c3c28230ab3b46e56a7278dbc2..ddcd289bd6cb9dec70738ffded3c5a9705f3e1c7 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 31959c7a1963dc2c2b9cee7b2efe8fc6d5efe1be..1d43ecda8d3a612bb76e8795df52ed4d151b494a 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 17017ba740c58376be9f3d4aa2bd67d6ee66d39c..5dd2d678b0cb6824a676cd4e775fe8c13f6db007 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 a8fac98e81a68119b4a6979a8f63cdaf3c0e58e8..c271b72cfe85c1e794e93d8b39794bf6f2178309 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 459f3f0735fa24ecda047c058e7fdd95f380ae42..66561243de16fc4bbadee64120ddf61863111caf 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 2f3135c514bf0e823aa79936ba9e6afa5e8b910a..330fccedfb6ed85b0abe090cc8e30d7bcbcd43a6 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 2213dee5b52c5e05c5c0c8775f992d4db51c35dc..15b7548fc1b69e0a6deb90fd28f51facaf457807 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 b55cf7d40ca7fce25559db209ed0c46247384195..e4c2d6895d7a15ce909a5f33bfdd458f1afb601d 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 5be2fc3b3e92ff9116c23ac76c5fb49848bfc286..c5682391dd7b6fc5fd7b3bfdfd7b616d616fc7f5 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 bd663a18dd3d3d4867b007a4217c43a7c9f16ade..01f4252fb2c93588c5c19cfd644eaf8944bc5f3c 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 d95ba402078d8c7048b7b1c70e3462913242ba66..8c4df908943c293009049ae1031c90ef5368b3ca 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 cfe642339067fada0d942b18759e32543dd31d27..0933e434e029ffac6d97756b97187a322454ef54 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 187d2a5aab53b7831504cc20157d8d4b343f0f35..a041f2673316f1ee5259f8fc8b450430ba45c1c8 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 dca43ff90d2e23f42079b1d9798a3bd1ca8afc26..22a9b707b4b7fa4e00d776195cdd920679838a1b 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 e34b571386a8e90e0fe7092649e51ca1b782793a..772a486b5e9dfb5d89658a2eac13f9eb0792e78e 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 d58b4eaf0ed86b79e5db34a3f57f8e3b48f28756..577223ba83559c06734abbd4073dfd4e5ceb1e91 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 70a89c8aff55a2a6f817ea667de0dfb7d2fe2ecc..217b33b17aeac9e576650a283cc9a41235234c02 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 31582910ebd535bf94421d485739ceab5732875c..d6c96077de0618e98ee9d24ebe26c0564b7e86c1 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 1228e741f526f910a76fba74261d5ffe5eaf8574..111cce2dc477d8d327a080416e0f71e6f76bc960 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 295ae51bdee7cffc6b8cc17c1dc5906de8cb62fb..d1b348a1cd187f38c6584118e6371e3cc2ab081c 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 df42f2fdaf1a781874c109ead9e6b44d5a8b9861..d0b8a54d4c51676cfaae8178e05c88490a8cef40 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 ca3ac71c6f80d8e84542205f702cba651288712d..9eec18d737ef304e4ad25871abd9ef97b8803e5f 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 0647e79c9b47bd8676db20bd977a24f1096ff7d1..dd2cec2c9e2938b8ed84feea7b8908e92739c759 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 5f5ab3c70cdb7b688aa522bee7fef22cd3bd80b7..92a749f448551d9b33f71439b1754745ee64e576 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 f182ac4ea5bc948c9dd80d4eaed89c04aabef9b4..3c59c23c9d6e8c0e4ca1ef37e7db2bcb910c2d4d 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 a55825e9c8e74dee0cb57af03b7191672cb437b9..6d7edd3be6b92801f5284b63efd6f05fe50eb9bc 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 dcf4e9c68714f674eb502e887b9eed7701c5c50e..4332663f3073d588057a364128dbe8aeaae1ef27 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 ab1cae6aab621ff3c1782709956a6fedfc36642a..5c11945cdcfcf41e2190a26afb9328747f1d3bff 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 dea73748fc4d729cf4fddb79fdf6e3a3c793d9e6..93a1bbf8355a9094e8c017b611097b34f72f9213 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 316df27935867d457e9ebdf7d23d9efd8aa9b947..c42604d9311c37aa7469fa3671e628789d4d0327 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 41087e249be49bb0c264af04c493bc820bdf0740..4908483e5c3be5ca002207c55188fa6a9e75367a 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 73c21743ca1333b0b5619cdb14479ad06e0b0778..490c39743516bb15963627fe21e944f77564a650 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 c6de260b5daca239fd688e5c9613a17a35ab0337..ba54c8f20d33037774ea92495ef11646157a9279 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 088e5d45f4a8650d8680136c62824fe0790937e9..9722e1039c7bc90b0ee79464f4fa4df8104d1f8c 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 fd0a7cc2d8420b7b9a84fb21d74372406fe37ede..d76825e333d16f20bcbfd37bbf06b401d56558de 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 d0a36346c67bafea93b50740d5fcdaf5e517fb7b..c8957c2b5a234f92794237b3c85c11cb38ef601e 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 eb90088f467847f49b1015bdf094d8bd157bc219..2f6730d38280ed90bc50610304d88d9de06dea8f 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 5b3289e1b66beb2118b9edebbb6384a9be9110ba..10ee3913b811a633873d446827d19c2dd80815fc 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 2cd50f98e006b5f6f8be7331f0b73c9263f83547..369223c311ea2b0254a3be30574619cff8f17d07 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 22de228e3a587afdfcb14e62cbca656ec6d76a39..67007bf497a2d2d08c03c0c9d23d48d79061e736 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 d2b5123f9f366d0a5e83961ce0cd4dabe9125e41..d13e72e6c92aef3027a7dd6ec32acab919c2734d 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 54acb5e3f8e2d568532100bac91a61cb7ba69c71..d14bd878ed1c00ca70fc0a1b62ce95638eccf1db 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 b2ecda86e79f9894081c628675218fb8ad705a9e..9e2caf59e48c719299bf144a3e844561c7d4a469 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 414278b1ad087031ee5a55fa872b7ec854866651..99a094e1c1d8e86b918894e8f26a40caddd0abac 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 b47be9cbb5eec1d36179fcdba6b6bc0652f246e3..b02ae6e577bb0577aaaf0c3c814aabf0d7b5bdb6 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 745eeda0f44ca45cee427ab313aa124c2d0cab28..1e21b53588b8de5f2f61593b80f53a64a41a2e13 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 6306de50af9d958412b9c3ffa720ec5a127046f2..e73dcd6d2e774bda775ea8ba0d7bf44e0c395184 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 cd3c1a8c36f91ec98d392d7bd837a0937a621b78..a431b2a498608856972c4d09de40aed757c9efa8 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 c24d87474e85ab5ed1e35bf301bc162496102ae2..6e057f6880e177f1a53ec608e509db1dbfa19e64 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 a3c48b288c97c985d84c2706a72a39e04b0ecebd..5694873c99d86999f26955d1cec7ac4fe90f1a42 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 09984654ad696f6b9b6d90c5a6e730bc8b9c47cf..9248993aa9c326b39bd5a161da0d8e59c95c8825 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 d1066c025d30c9fe7473c817a8087813333602a8..ae05663d86d26c9909924c4c1dee17e0ea449ca0 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 2649fd854de34b95d92c71bf0661abe92dc74221..c6cd79f8559a820ae553cfa9b8d241b9026a144e 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 ad47e84ca50c9147ba7a1270cf9a75cb35a081af..2861376ac436da6744d335453be423c0f922b714 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 6d319c3ddb0d5affbb84269f7e25aa0293502c55..a37d1bdb5ccf673c5dd150a961b3dde4a2feeffc 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 20b185c8c2357533a729cb5dcb421df007f74c0f..8e70e0e9898807dd50673f7e3bcaa7242d4185ac 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 909e2f1d6b3ec173016f09618f319be7c034848c..ef6f1a70d193e768be8e3761042d6bbc1e631409 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 f5d7bdc4aeb1d9f7e92a382f6e9f79e763743ca9..ef821b23fe42a7ef5b548d628364650bfa3047a2 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 71822d948009068e7347147725c7f5946f38b421..4b2ea39e4bcc451e1f14409aed104412bfe7e10f 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 e43bca551002d7843ede5634a4e95211fac3fba0..690be40bdcba150535508935e57dcaebe6eb790f 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 37d938fd512f0df4015d45c94bf73cd57b7af265..bec6830a3bebe2d23121b37c9ef4f2a377fa4170 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 c57486dfa88ec871e7654756b4ded95de7866ad7..a6178eb3a6787c3d826e2c031ba7967767107d30 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 9a5a9d9b0dd8653c12571ab8869144bebb28dc96..b651ac2f804ad8e0995738689a18cfa28f753c5f 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 ac2e5d52490584a36fd0fff013f28b483ebb4d86..441fb5c24d9f78ec04381092c6e46af1ac5b3f03 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 a5ba8f282d4f607175d8ba080ed56dbc8a11caa4..f8c67cd596d37c416855c7f445537834ecb49fb3 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 5cfee36401c1c312499cad7e9e20d0aaf2e794a1..4156954aa5fdddfd35fd0a8a21280646546c8715 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 c78654af3913cf34f5a9030f2fc2a0b51fa5ad5a..b013e43642f95229ae5996a507753da7368e8982 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 4bb42d0c94afa91ee571932ac51e714f854ed9a3..15d7c8f15880c0ac274e0de990b14150bf0ffdfc 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 aa4b6c38fac60d02dc369e783ee630601f12c01a..b997e3a934eb8b33ed76c2312f91fbbacd3d0f1e 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 fd05496b28d2b2a4b9c3bf1c6062ee5cfa9d8e97..4c8d864acd616d98ab82b502fff550fec95b3af6 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 457908d768132b1b2a79b60d481c0dbe811eeb5e..65d52a904e3abf8299d23a7662e6be4093f1f65a 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 5782ccc8b9920302566c220524e6dadc81ea16e2..7bee0f44c7f01701d202879a7730a4ebedb2921b 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 3fc16c2ea8cafe4720122aff79dfc725f26d584d..6d2dfffc4090ac6a73ae3d2fa9a749a6f23dd5bb 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 c31c7e0014a482ca35030a72314867d9e836db0a..753e1406380a278841469690119d40037cdee58d 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 0c9f7bbbba74cb7c688bffa81d7728cb12592402..5d6c44da35fd2e5d03d899d76215cad7bfffff89 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 b36c8028fe1e0489e229a95150333181de2d753b..c9fa6ff112ded85f76e1eb735e4a9291375c948d 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 e18c71de6e07014a6c4ee5de1eace58ebd952e1a..343ea3137962140bc2bbea6eb982c190655f0002 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 fcfe45d0a94e91e243c2ef74cb747509942b7322..497c2d34987e5be09626984b6795c67ed160ba56 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 018c3af6c0e8951f1235dec0685ab5ad57a20d1e..a7d2de9c18f7cce2552327433e2f668d0487ef21 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 5782ccc8b9920302566c220524e6dadc81ea16e2..7bee0f44c7f01701d202879a7730a4ebedb2921b 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 1d2983ca2706c1977515c7f049873dc10ffbf961..d60f38f9130b5d535279171d216f0ef195041d23 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 4dcd1dd51843b698c65e6a7f503abcef4d8cd22c..9f9099394467a6e3b258cebcaf2d1d087b022c7d 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 c481ec018c1c39157f6dbbed074348056bebb494..03d7d923dc9e2910551d95606c4228731f935551 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 de5a9806580b1ec6840ec96fba2a22f3816fb192..e11bc3b480e404fc03a3483ef07f2696acc180ac 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", ] }