1# Copyright 2022 Huawei Technologies Co., Ltd 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14# ============================================================================ 15 16import("//build/ohos.gni") 17 18ohos_executable("benchmark_bin") { 19 sources = [ 20 "../../../ccsrc/backend/kernel_compiler/cpu/nnacl/nnacl_common.c", 21 "../../src/common/file_utils.cc", 22 "../../src/common/utils.cc", 23 "../common/flag_parser.cc", 24 "../common/string_util.cc", 25 "benchmark.cc", 26 "benchmark_base.cc", 27 "benchmark_c_api.cc", 28 "benchmark_unified_api.cc", 29 "main.cc", 30 "run_benchmark.cc", 31 ] 32 33 include_dirs = [ 34 "//base/hiviewdfx/hilog/interfaces/native/innerkits/include", 35 "//third_party/flatbuffers/include", 36 "../../", 37 "../../../core/", 38 "../../../../", 39 "../../../../third_party/", 40 "../../../ccsrc/backend/kernel_compiler/cpu/", 41 ] 42 43 defines = [ 44 "BENCHMARK_CLIP_JSON", 45 "MS_COMPILE_OHOS", 46 ] 47 48 if (target_cpu == "arm") { 49 defines += [ 50 "ENABLE_ARM", 51 "ENABLE_ARM32", 52 ] 53 } else if (target_cpu == "arm64") { 54 defines += [ 55 "ENABLE_ARM", 56 "ENABLE_ARM64", 57 ] 58 } 59 disable_android = true 60 if (disable_android) { 61 cflags = [ 62 "-UANDROID", 63 "-U__ANDROID__", 64 "-U__ANDROID_API__", 65 ] 66 cflags_cc = [ 67 "-UANDROID", 68 "-U__ANDROID__", 69 "-U__ANDROID_API__", 70 ] 71 } 72 remove_configs = [ "//build/config/compiler:no_rtti" ] 73 74 deps = [ "../../:mindspore_lib" ] 75 76 output_name = "benchmark_bin" 77 install_enable = true 78 part_name = "mindspore" 79} 80