1 Star 0 Fork 64

liyihan123/ascendc-api-adv

forked from Ascend/ascendc-api-adv 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CMakeLists.txt 3.04 KB
一键复制 编辑 原始数据 按行查看 历史
zhaoyingdong 提交于 2024-09-18 08:35 . !81 support soft links
# Copyright (c) 2024 Huawei Technologies Co., Ltd.
# This file is a part of the CANN Open Software.
# Licensed under CANN Open Software License Agreement Version 1.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.
# ======================================================================================================================
cmake_minimum_required(VERSION 3.16.0)
project(ascendc-api-adv)
option(BUILD_OPEN_PROJECT "Build open ascendc lib project." ON)
set(ASCENDC_API_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(ASCENDC_SCRIPTS_DIR ${ASCENDC_API_DIR}/cmake/scripts)
if(BUILD_OPEN_PROJECT)
include(cmake/config.cmake)
set(INSTALL_LIBRARY_DIR packages/${CMAKE_SYSTEM_PROCESSOR}-linux)
else()
set(INSTALL_LIBRARY_DIR lib)
endif()
set(GEN_KERENL_TILING_DATA_SCRIPT ${ASCENDC_SCRIPTS_DIR}/gen_kernel_tiling_data_def.py)
set(TILING_DATA_DEF_DIR ${ASCENDC_API_DIR}/lib)
set(KERNEL_TILING_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(KERNEL_TILING_HAED ${KERNEL_TILING_DIR}/kernel_tiling/kernel_tiling.h)
set(PKG_KERNEL_TILING_DIR ${ASCEND_CANN_PACKAGE_PATH}/${CMAKE_SYSTEM_PROCESSOR}-linux/ascendc/include/highlevel_api/lib)
add_custom_command(OUTPUT ${KERNEL_TILING_HAED}
COMMAND ${HI_PYTHON} ${GEN_KERENL_TILING_DATA_SCRIPT} ${TILING_DATA_DEF_DIR} ${PKG_KERNEL_TILING_DIR} ${KERNEL_TILING_HAED}
DEPENDS ${GEN_KERENL_TILING_DATA_SCRIPT})
add_custom_target(gen_kernel_tiling ALL
DEPENDS ${KERNEL_TILING_HAED})
add_library(kernel_tiling_headers INTERFACE)
target_include_directories(kernel_tiling_headers INTERFACE
$<INSTALL_INTERFACE:include>
$<INSTALL_INTERFACE:include/tikcpp>
$<INSTALL_INTERFACE:include/tikcpp/tikcfw>
$<INSTALL_INTERFACE:include/tikcpp/tikcfw/kernel_tiling>
)
add_subdirectory(impl)
if(ENABLE_TEST)
add_subdirectory(tests)
endif()
install(FILES
${KERNEL_TILING_HAED}
DESTINATION ${INSTALL_LIBRARY_DIR}/ascendc/include/highlevel_api/kernel_tiling/ OPTIONAL
)
install(DIRECTORY lib
DESTINATION ${INSTALL_LIBRARY_DIR}/ascendc/include/highlevel_api OPTIONAL
)
install(DIRECTORY impl
DESTINATION ${INSTALL_LIBRARY_DIR}/ascendc/include/highlevel_api OPTIONAL
FILES_MATCHING
PATTERN "*.h"
PATTERN "CMakeLists.txt" EXCLUDE
)
configure_file(
${ASCENDC_API_DIR}/cmake/kernel_headers.cmake
${CMAKE_CURRENT_BINARY_DIR}/kernel_headers.cmake
@ONLY
)
install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/kernel_headers.cmake)
if(NOT BUILD_OPEN_PROJECT)
install_package(
PACKAGE kernel_tiling
TARGETS kernel_tiling_headers
FILES ${KERNEL_TILING_HAED}
DESTINATION ${INSTALL_INCLUDE_DIR}/ascendc/include/highlevel_api/kernel_tiling
)
install(SCRIPT ${ASCENDC_API_DIR}/cmake/kernel_directory.cmake)
endif()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liyihan123/ascendc-api-adv.git
git@gitee.com:liyihan123/ascendc-api-adv.git
liyihan123
ascendc-api-adv
ascendc-api-adv
master

搜索帮助