• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/test.gni")
15
16module_output_path = "neural_network_runtime/"
17
18config("module_private_config") {
19  visibility = [ ":*" ]
20
21  include_dirs = [
22    "//third_party/googletest/googlemock/include",
23    "//foundation/ai/neural_network_runtime",
24    "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include",
25    "//third_party/mindspore/mindspore-src/source/mindspore/lite/mindir/include",
26  ]
27}
28
29ohos_unittest("OpsUnittest") {
30  module_out_path = module_output_path
31
32  sources = [ "./add_test.cpp" ]
33  sources += [ "./argmax_test.cpp" ]
34  sources += [ "./avgpool_pad_test.cpp" ]
35  sources += [ "./avgpool_padmod_test.cpp" ]
36  sources += [ "./batch_to_space_nd_test.cpp" ]
37  sources += [ "./batchnorm_builder_test.cpp" ]
38  sources += [ "./biasadd_test.cpp" ]
39  sources += [ "./cast_test.cpp" ]
40  sources += [ "./concat_three_inputs_test.cpp" ]
41  sources += [ "./concat_two_inputs_test.cpp" ]
42  sources += [ "./conv2d_pad_test.cpp" ]
43  sources += [ "./conv2d_padmode_test.cpp" ]
44  sources += [ "./conv2d_tranpose_padmode_test.cpp" ]
45  sources += [ "./conv2d_transpose_pad_test.cpp" ]
46  sources += [ "./depthwise_conv2d_native_pad_test.cpp" ]
47  sources += [ "./depthwise_conv2d_native_padmode_test.cpp" ]
48  sources += [ "./div_test.cpp" ]
49  sources += [ "./eltwise_test.cpp" ]
50  sources += [ "./expandims_test.cpp" ]
51  sources += [ "./fullconnection_test.cpp" ]
52  sources += [ "./fullconnection_with_axis_test.cpp" ]
53  sources += [ "./fill_builder_test.cpp" ]
54  sources += [ "./gather_builder_test.cpp" ]
55  sources += [ "./gelu_builder_test.cpp" ]
56  sources += [ "./hswish_builder_test.cpp" ]
57  sources += [ "./layernorm_builder_test.cpp" ]
58  sources += [ "./lessequal_builder_test.cpp" ]
59  sources += [ "./maximum_builder_test.cpp" ]
60  sources += [ "./maxpool_pad_test.cpp" ]
61  sources += [ "./maxpool_padmode_test.cpp" ]
62  sources += [ "./matmul_builder_test.cpp" ]
63  sources += [ "./mul_builder_test.cpp" ]
64  sources += [ "./onehot_builder_test.cpp" ]
65  sources += [ "./pad_builder_test.cpp" ]
66  sources += [ "./pow_builder_test.cpp" ]
67  sources += [ "./prelu_builder_test.cpp" ]
68  sources += [ "./quant_dtype_cast_builder_test.cpp" ]
69  sources += [ "./reduce_all_builder_test.cpp" ]
70  sources += [ "./reduce_mean_builder_test.cpp" ]
71  sources += [ "./reduce_prod_builder_test.cpp" ]
72  sources += [ "./relu_builder_test.cpp" ]
73  sources += [ "./relu6_builder_test.cpp" ]
74  sources += [ "./reshape_builder_test.cpp" ]
75  sources += [ "./resize_bilinear_builder_test.cpp" ]
76  sources += [ "./rsqrt_builder_test.cpp" ]
77  sources += [ "./scale_builder_test.cpp" ]
78  sources += [ "./shape_builder_test.cpp" ]
79  sources += [ "./sigmoid_builder_test.cpp" ]
80  sources += [ "./slice_builder_test.cpp" ]
81  sources += [ "./softmax_builder_test.cpp" ]
82  sources += [ "./spacetobatchnd_builder_test.cpp" ]
83  sources += [ "./split_builder_test.cpp" ]
84  sources += [ "./sqrt_builder_test.cpp" ]
85  sources += [ "./squared_difference_builder_test.cpp" ]
86  sources += [ "./squeeze_builder_test.cpp" ]
87  sources += [ "./stack_builder_test.cpp" ]
88  sources += [ "./strided_slice_builder_test.cpp" ]
89  sources += [ "./sub_builder_test.cpp" ]
90  sources += [ "./tanh_builder_test.cpp" ]
91  sources += [ "./tile_builder_test.cpp" ]
92  sources += [ "./topk_builder_test.cpp" ]
93  sources += [ "./transpose_builder_test.cpp" ]
94  sources += [ "./unsqueeze_builder_test.cpp" ]
95  sources += [ "./ops_test.cpp" ]
96  sources += [ "../common/base_test.cpp" ]
97
98  configs = [ ":module_private_config" ]
99
100  deps = [
101    "//foundation/ai/neural_network_runtime/frameworks:libneural_network_runtime",
102    "//third_party/googletest:gmock_main",
103    "//third_party/googletest:gtest_main",
104  ]
105
106  external_deps = [
107    "drivers_interface_nnrt:libnnrt_proxy_1.0",
108    "hilog:libhilog",
109    "hitrace:hitrace_meter",
110    "mindspore:mindir",
111  ]
112}
113
114group("ops_unittest") {
115  testonly = true
116  deps = [ ":OpsUnittest" ]
117}
118