# ----------------------------------------------------------------------------
# This program is free software, you can redistribute it and/or modify it.
# Copyright (c) 2026 Huawei Technologies Co., Ltd.
# This file is a part of the CANN Open Software.
# Licensed under CANN Open Software License Agreement Version 2.0 (the "License").
# Please refer to the License for details. You may not use this file except in compliance with the License.
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
# See LICENSE in the root of the software repository for the full text of the License.
# ----------------------------------------------------------------------------

# RegBase / Vector Function 是 Ascend 950 特性,仅在 dav-3510 下编译,dav-2201 配置会自动跳过本样例。
cann_sample_check_arch(dav-3510)

add_executable(vector_function_add main.asc)

target_compile_options(vector_function_add PRIVATE
    "$<$<COMPILE_LANGUAGE:ASC>:--npu-arch=${NPU_ARCH}>"
    "$<$<COMPILE_LANGUAGE:ASC>:-O3>"
    "$<$<COMPILE_LANGUAGE:ASC>:--cce-simd-vf-fusion=true>"
)

target_link_libraries(vector_function_add
    PRIVATE
    m
    dl
    platform
    tiling_api
)

install(TARGETS vector_function_add
    RUNTIME DESTINATION 0_Introduction/vector_function_add
)