1# Copyright (c) 2021-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 14add_custom_target(benchmark_coverage DEPENDS benchmark_coverage_arm64 benchmark_coverage_x86_64 benchmark_coverage_arm) 15 16# arm64 targets: 17add_custom_target(benchmark_coverage_arm64 DEPENDS benchmark_coverage_arm64_aot benchmark_coverage_arm64_jit benchmark_coverage_arm64_osr) 18add_custom_target(benchmark_coverage_arm64_aot DEPENDS benchmark_coverage_arm64_aot pandasm paoc) 19add_custom_target(benchmark_coverage_arm64_jit DEPENDS benchmark_coverage_arm64_jit pandasm paoc) 20add_custom_target(benchmark_coverage_arm64_osr DEPENDS benchmark_coverage_arm64_osr pandasm paoc) 21 22# x86_64 targets: 23add_custom_target(benchmark_coverage_x86_64 DEPENDS benchmark_coverage_x86_64_aot benchmark_coverage_x86_64_jit) 24add_custom_target(benchmark_coverage_x86_64_aot DEPENDS benchmark_coverage_x86_64_aot pandasm paoc) 25add_custom_target(benchmark_coverage_x86_64_jit DEPENDS benchmark_coverage_x86_64_jit pandasm paoc) 26 27# arm32 targets: 28add_custom_target(benchmark_coverage_arm DEPENDS benchmark_coverage_arm_jit) 29add_custom_target(benchmark_coverage_arm_jit DEPENDS benchmark_coverage_arm_jit pandasm paoc) 30 31# Build rules: 32add_custom_command(TARGET benchmark_coverage_arm64_aot POST_BUILD 33 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 34 COMMAND bash ${PANDA_ROOT}/compiler/tools/benchmark_coverage.sh --binary-dir=${PANDA_BINARY_ROOT} --root-dir=${PANDA_ROOT} --target-arch=arm64 --paoc-mode=aot 2>/dev/null 35) 36 37add_custom_command(TARGET benchmark_coverage_arm64_jit POST_BUILD 38 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 39 COMMAND bash ${PANDA_ROOT}/compiler/tools/benchmark_coverage.sh --binary-dir=${PANDA_BINARY_ROOT} --root-dir=${PANDA_ROOT} --target-arch=arm64 --paoc-mode=jit 2>/dev/null 40) 41 42add_custom_command(TARGET benchmark_coverage_arm64_osr POST_BUILD 43 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 44 COMMAND bash ${PANDA_ROOT}/compiler/tools/benchmark_coverage.sh --binary-dir=${PANDA_BINARY_ROOT} --root-dir=${PANDA_ROOT} --target-arch=arm64 --paoc-mode=osr 2>/dev/null 45) 46 47add_custom_command(TARGET benchmark_coverage_x86_64_jit POST_BUILD 48 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 49 COMMAND bash ${PANDA_ROOT}/compiler/tools/benchmark_coverage.sh --binary-dir=${PANDA_BINARY_ROOT} --root-dir=${PANDA_ROOT} --target-arch=x86_64 --paoc-mode=jit 2>/dev/null 50) 51 52add_custom_command(TARGET benchmark_coverage_x86_64_aot POST_BUILD 53 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 54 COMMAND bash ${PANDA_ROOT}/compiler/tools/benchmark_coverage.sh --binary-dir=${PANDA_BINARY_ROOT} --root-dir=${PANDA_ROOT} --target-arch=x86_64 --paoc-mode=aot 2>/dev/null 55) 56 57# TODO (asidorov): enable after AOT support on arm32 58#add_custom_command(TARGET benchmark_coverage_arm_jit POST_BUILD 59# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 60# COMMAND bash ${PANDA_ROOT}/compiler/tools/benchmark_coverage.sh --binary-dir=${PANDA_BINARY_ROOT} --root-dir=${PANDA_ROOT} --target-arch=arm --paoc-mode=jit 61#) 62