1 Star 0 Fork 144

魏丹丹/acl

forked from CANN/acl 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CMakeLists.txt 58.34 KB
一键复制 编辑 原始数据 按行查看 历史
yuhaitao 提交于 2024-09-05 19:07 . dump for watcher mode
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505
# 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.14)
project (ascend)
set(INSTALL_BASE_DIR "")
set(INSTALL_LIBRARY_DIR lib)
set(INSTALL_RUNTIME_DIR bin)
set(INSTALL_INCLUDE_DIR include)
set(INSTALL_CONFIG_DIR cmake)
include(CMakePackageConfigHelpers)
set(BASE_DIR ${CMAKE_CURRENT_LIST_DIR})
option(ENABLE_OPEN_SRC "Enable acl compile in opensource." FALSE)
if(ENABLE_OPEN_SRC)
set(CANN_GE_DIR ${CMAKE_CURRENT_LIST_DIR}/third_party/cann-graph-engine)
set(METADEF_DIR ${CMAKE_CURRENT_LIST_DIR}/third_party/metadef)
else()
set(CANN_GE_DIR ${CMAKE_CURRENT_LIST_DIR}/../../../air)
set(METADEF_DIR ${CMAKE_CURRENT_LIST_DIR}/../../../metadef)
endif()
if(ENABLE_OPEN_SRC)
set(CMAKE_MODULE_PATH
${CMAKE_CURRENT_LIST_DIR}/cmake/modules
${CANN_GE_DIR}/cmake/modules
${METADEF_DIR}/cmake/modules
${ASCEND_3RD_LIB_PATH}/cmake/modules
)
set(CMAKE_PREFIX_PATH
${ASCEND_3RD_LIB_PATH}/jpeg
${ASCEND_3RD_LIB_PATH}/json
${ASCEND_3RD_LIB_PATH}/openssl
${ASCEND_3RD_LIB_PATH}/protoc
${ASCEND_3RD_LIB_PATH}/protoc_grpc
${ASCEND_3RD_LIB_PATH}/grpc
${ASCEND_3RD_LIB_PATH}/protobuf_static
${ASCEND_3RD_LIB_PATH}/ascend_protobuf
${ASCEND_3RD_LIB_PATH}/ascend_protobuf_static
${ASCEND_3RD_LIB_PATH}/gtest_shared/lib64/cmake/GTest
${ASCEND_3RD_LIB_PATH}/benchmark
${ASCEND_3RD_LIB_PATH}/pybind11
${ASCEND_3RD_LIB_PATH}/symengine/lib/cmake/symengine
${ASCEND_3RD_LIB_PATH}/boost/lib/cmake/Boost-1.82.0
${ASCEND_INSTALL_PATH}
${CMAKE_CURRENT_LIST_DIR}/third_party/inc
${CANN_GE_DIR}/inc/framework/executor_c
)
include(${BASE_DIR}/cmake/intf_pub_linux.cmake)
include(cmake/function.cmake)
include(CMakePrintHelpers)
message(STATUS "Variables in acl project:")
cmake_print_variables(ENABLE_OPEN_SRC)
cmake_print_variables(ASCENDCL_C)
cmake_print_variables(ENABLE_GE_COMPILE)
cmake_print_variables(ENABLE_ENGINES_COMPILE)
cmake_print_variables(ENABLE_EXECUTOR_C_COMPILE)
cmake_print_variables(ENABLE_ACL_UT)
cmake_print_variables(ENABLE_ACL_COV)
cmake_print_variables(ENABLE_C_UT)
cmake_print_variables(ENABLE_C_COV)
cmake_print_variables(PLATFORM)
cmake_print_variables(PRODUCT)
cmake_print_variables(ASCEND_INSTALL_PATH)
cmake_print_variables(ASCEND_3RD_LIB_PATH)
cmake_print_variables(CMAKE_BUILD_TYPE)
cmake_print_variables(CMAKE_INSTALL_PREFIX)
cmake_print_variables(CMAKE_PREFIX_PATH)
cmake_print_variables(CMAKE_MODULE_PATH)
cmake_print_variables(CMAKE_SYSTEM_PROCESSOR)
set(TARGET_SYSTEM_NAME "Linux")
set(HI_PYTHON python3)
# 开源软件包
find_package(Threads REQUIRED)
find_package(json MODULE REQUIRED)
find_package(protoc MODULE REQUIRED)
find_package(protoc_grpc MODULE REQUIRED)
find_package(protobuf_grpc MODULE REQUIRED)
find_package(protobuf_static MODULE REQUIRED)
find_package(ascend_protobuf_static MODULE REQUIRED)
find_package(openssl MODULE REQUIRED)
find_package(zlib MODULE REQUIRED)
find_package(ascend_protobuf_shared MODULE REQUIRED)
find_package(gRPC CONFIG)
find_package(securec MODULE REQUIRED)
find_package(jpeg MODULE REQUIRED)
find_package(GTest CONFIG REQUIRED)
if(ENABLE_ACL_COV OR ENABLE_ACL_UT)
add_subdirectory(tests)
else()
find_package(slog MODULE REQUIRED)
find_package(mmpa MODULE REQUIRED)
find_package(opcompiler MODULE REQUIRED)
find_package(platform MODULE REQUIRED)
find_package(ascend_hal MODULE REQUIRED)
find_package(runtime MODULE REQUIRED)
find_package(adump MODULE REQUIRED)
find_package(msprof MODULE REQUIRED)
find_package(tdt MODULE REQUIRED)
find_package(acldvpp MODULE REQUIRED)
find_package(awatchdog MODULE REQUIRED)
add_subdirectory(third_party/cann-graph-engine EXCLUDE_FROM_ALL)
add_subdirectory(third_party/metadef EXCLUDE_FROM_ALL)
if(PLATFORM STREQUAL "train")
if(PRODUCT STREQUAL "flr3")
message(FATAL_ERROR "This platform is not supported in train mode, build terminated")
endif()
endif()
endif()
if (PRODUCT STREQUAL "nano")
if(ENABLE_C_COV OR ENABLE_C_UT)
add_subdirectory(tests/ut/acl/testcase_c)
else()
find_package(c_mmpa MODULE REQUIRED)
find_package(c_base MODULE REQUIRED)
find_package(runtime_static MODULE REQUIRED)
add_subdirectory(c)
endif()
endif()
endif()
if(NOT ENABLE_OPEN_SRC)
add_subdirectory(c)
endif()
###################################################################################################
add_library(ascendcl_headers INTERFACE)
target_include_directories(ascendcl_headers INTERFACE
$<BUILD_INTERFACE:${BASE_DIR}/inc>
$<BUILD_INTERFACE:${BASE_DIR}/inc/external>
$<BUILD_INTERFACE:${BASE_DIR}/inc/external/acl>
$<BUILD_INTERFACE:${BASE_DIR}/inc/external/acl/error_codes>
$<BUILD_INTERFACE:${BASE_DIR}/inc/external/acl/ops>
$<INSTALL_INTERFACE:include>
$<INSTALL_INTERFACE:include/ascendcl>
$<INSTALL_INTERFACE:include/ascendcl/external>
$<INSTALL_INTERFACE:include/ascendcl/external/acl>
$<INSTALL_INTERFACE:include/ascendcl/external/acl/error_codes>
$<INSTALL_INTERFACE:include/ascendcl/external/acl/ops>
)
set(SRC_LIST
runtime/device.cpp
runtime/event.cpp
runtime/stream.cpp
runtime/memory.cpp
runtime/context.cpp
runtime/callback.cpp
runtime/group.cpp
runtime/allocator.cpp
runtime/kernel.cpp
model/model.cpp
model/acl_aipp.cpp
model/aipp_param_check.cpp
model/model_config.cpp
model/acl_resource_manager.cpp
common/acl.cpp
common/log_inner.cpp
common/log.cpp
common/json_parser.cpp
common/error_codes_api.cpp
single_op/compile/op_compiler.cpp
single_op/compile/op_compile_service.cpp
single_op/builtin/cast_op.cpp
single_op/op.cpp
single_op/op_executor.cpp
single_op/op_model_cache.cpp
single_op/op_model_parser.cpp
single_op/ge_tensor_cache.cpp
single_op/shape_range_utils.cpp
types/acl_op.cpp
types/fp16.cpp
types/fp16_impl.cpp
types/op_attr.cpp
types/op_model.cpp
types/tensor_desc_internal.cpp
utils/array_utils.cpp
utils/attr_utils.cpp
utils/file_utils.cpp
utils/string_utils.cpp
utils/math_utils.cpp
utils/hash_utils.cpp
utils/cann_info_utils.cpp
toolchain/dump.cpp
toolchain/profiling.cpp
toolchain/profiling_manager.cpp
toolchain/resource_statistics.cpp
single_op/compile/op_kernel_selector.cpp
single_op/compile/op_kernel_registry.cpp
single_op/executor/op_task.cpp
single_op/executor/resource_manager.cpp
single_op/executor/stream_executor.cpp
)
############ libascendcl.so ############
if(${TARGET_SYSTEM_NAME} STREQUAL "Windows")
add_library(ascendcl SHARED ${SRC_LIST} $<TARGET_OBJECTS:profapi_stub>)
else()
add_library(ascendcl SHARED ${SRC_LIST})
endif()
if(ENABLE_OPEN_SRC)
add_library(msprofiler_object OBJECT IMPORTED GLOBAL)
if (msprofiler_ext_LIBRARY_DIR)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/msprofiler_object)
execute_process(
COMMAND ar x ${msprofiler_ext_LIBRARY_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/msprofiler_object
)
file(GLOB MSPROFILER_OBJECT_LIST ${CMAKE_CURRENT_BINARY_DIR}/msprofiler_object/*.o)
set_property(TARGET msprofiler_object PROPERTY IMPORTED_OBJECTS ${MSPROFILER_OBJECT_LIST})
endif()
endif()
target_include_directories(ascendcl PRIVATE
####yellow zone####
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/inc>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/metadef/inc>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/graphengine/inc>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/graphengine/inc/framework>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/metadef/inc/external>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/graphengine/inc/external>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/abl/adump/external>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/abl/adump/inc/adump>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/inc/driver>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/ace/dvpp/inc/external/dvpp>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/ace/dvpp/inc/dvpp>
####blue zone####
$<$<BOOL:${ENABLE_OPEN_SRC}>:${BASE_DIR}/third_party/inc/>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/runtime>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/datagw>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/ascend_hal>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/msprof>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/slog>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${METADEF_DIR}/inc>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${CANN_GE_DIR}/inc>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${CANN_GE_DIR}/inc/framework>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${METADEF_DIR}/inc/external>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${CANN_GE_DIR}/inc/external>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/adump/external>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/ascend_hal/driver>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${BASE_DIR}/third_party/inc/dvpp/inc/dvpp>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/acl/dvpp>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/awatchdog>
${BASE_DIR}/inc/external/acl
${BASE_DIR}/inc/external
${BASE_DIR}/inc
${BASE_DIR}
${BASE_DIR}/common
${BASE_DIR}/toolchain
)
target_compile_options(ascendcl PRIVATE
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Linux>:-fvisibility=hidden -O2 -fno-common>
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>:/utf-8 /Od>
$<$<AND:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,$<STREQUAL:${CMAKE_CONFIGURATION_TYPES},Debug>>:/MTd>
$<$<AND:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,$<STREQUAL:${CMAKE_CONFIGURATION_TYPES},Release>>:/MT>
)
target_compile_definitions(ascendcl PRIVATE
$<IF:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,OS_TYPE=WIN,OS_TYPE=0>
LOG_CPP
FUNC_VISIBILITY
google=ascend_private
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>:SECUREC_USING_STD_SECURE_LIB=0 NOMINMAX>
$<$<STREQUAL:${ENABLE_OPEN_SRC},True>:ONLY_COMPILE_OPEN_SRC>
$<$<STREQUAL:${ENABLE_ACL_UT},ON>:ONLY_ENABLE_ACL_UT>
)
target_link_options(ascendcl PRIVATE
-rdynamic
-Wl,-Bsymbolic
-Wl,--exclude-libs,ALL
)
target_link_directories(ascendcl PRIVATE
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Android>:${TOP_DIR}/prebuilts/clang/linux-x86/aarch64/android-ndk-r21/sysroot/usr/lib/aarch64-linux-android/29>
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Android>:${TOP_DIR}/build/prebuilts/clang/linux-x86/aarch64/android-ndk-r21/sysroot/usr/lib/aarch64-linux-android/29>
)
set(linklibs ascend_hal_stub)
if (NOT ENABLE_OPEN_SRC)
if (PRODUCT)
if (PRODUCT STREQUAL "npuf10")
set(linklibs )
if (${TARGET_SYSTEM_NAME} STREQUAL "Android")
target_link_directories(ascendcl PRIVATE
${TOP_DIR}/vendor/sdk/hi3796/drv_android
)
elseif(${TARGET_LINUX_DISTRIBUTOR_RELEASE} STREQUAL 100)
target_link_directories(ascendcl PRIVATE
${TOP_DIR}/vendor/sdk/hi3796/drv
)
elseif(${TARGET_LINUX_DISTRIBUTOR_RELEASE} STREQUAL 200)
target_link_directories(ascendcl PRIVATE
${TOP_DIR}/vendor/sdk/hi3559dv100/drv
)
endif()
list(APPEND linklibs -ldrvdevdrv -ldrv_dfx)
else ()
list(APPEND linklibs ascend_hal_stub)
endif()
endif()
else ()
if(PRODUCT STREQUAL "flr2")
set(linklibs )
endif()
if(PRODUCT STREQUAL "flr3")
set(linklibs )
if (${TARGET_SYSTEM_NAME} STREQUAL "Android")
list(APPEND linklibs ${ASCEND_INSTALL_PATH}/drv_android)
else()
list(APPEND linklibs ${ASCEND_INSTALL_PATH}/drv)
endif()
list(APPEND linklibs -ldrvdevdrv -ldrv_dfx)
endif()
endif()
if(${TARGET_SYSTEM_NAME} STREQUAL "Windows")
set(linklibs ascend_hal)
endif()
if(${TARGET_SYSTEM_NAME} STREQUAL "Windows")
target_link_libraries(ascendcl
PRIVATE
$<BUILD_INTERFACE:intf_pub>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:slog_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:msprof_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:mmpa_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:runtime_headers>>
-Wl,--whole-archive
ge_executor
-Wl,--no-whole-archive
ge_common_static
graph_static
ascend_protobuf_static
register_static
error_manager_static
ascend_dump
static_mmpa
gert_static
exe_graph_static
-Wl,--no-as-needed
c_sec
runtime
alog
${linklibs}
-Wl,--as-needed
$<$<NOT:$<STREQUAL:${TARGET_SYSTEM_NAME},Android>>:-lrt>
-ldl
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Android>:-llog>
json
PUBLIC
ascendcl_headers
)
else()
target_link_libraries(ascendcl
PRIVATE
$<BUILD_INTERFACE:intf_pub>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:slog_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:msprof_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:mmpa_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:runtime_headers>>
-Wl,--whole-archive
-Wl,--no-whole-archive
ascend_dump
awatchdog_share
$<$<BOOL:${ENABLE_OPEN_SRC}>:adcore>
static_mmpa
-Wl,--no-as-needed
msprofiler_fwk_share
profapi_share
ge_common
graph
exe_graph
ascend_protobuf
error_manager
ge_executor_shared
gert
c_sec
runtime
alog
${linklibs}
-Wl,--as-needed
$<$<NOT:$<STREQUAL:${TARGET_SYSTEM_NAME},Android>>:-lrt>
-ldl
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Android>:-llog>
json
PUBLIC
ascendcl_headers
)
endif()
if(${TARGET_SYSTEM_NAME} STREQUAL "Windows")
set_target_properties(ascendcl PROPERTIES
LINK_FLAGS "/WHOLEARCHIVE:ge_executor"
WINDOWS_EXPORT_ALL_SYMBOLS TRUE
OUTPUT_NAME libascendcl
)
endif()
if (NOT ENABLE_OPEN_SRC)
############ libascendcl.a ############
add_library(ascendcl_static STATIC ${SRC_LIST})
target_include_directories(ascendcl_static PRIVATE
${TOP_DIR}/inc
${TOP_DIR}/metadef/inc
${TOP_DIR}/graphengine/inc
${TOP_DIR}/graphengine/inc/framework
${BASE_DIR}/inc/external/acl
${BASE_DIR}/inc/external
${TOP_DIR}/metadef/inc/external
${TOP_DIR}/graphengine/inc/external
${TOP_DIR}/toolchain/ide/ide-daemon/external
${TOP_DIR}/abl/msprof/inc
${TOP_DIR}/abl/adump/external
${TOP_DIR}/abl/adump/inc/adump
${TOP_DIR}/inc/driver
${BASE_DIR}/inc
${BASE_DIR}
${BASE_DIR}/common
${BASE_DIR}/toolchain
${TOP_DIR}/ace/dvpp/inc/external/dvpp
${TOP_DIR}/ace/dvpp/inc/dvpp
)
target_compile_options(ascendcl_static PRIVATE
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Linux>:-fvisibility=hidden -O2 -fno-common>
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>:/utf-8 /Od>
$<$<AND:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,$<STREQUAL:${CMAKE_CONFIGURATION_TYPES},Debug>>:/MTd>
$<$<AND:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,$<STREQUAL:${CMAKE_CONFIGURATION_TYPES},Release>>:/MT>
)
target_compile_definitions(ascendcl_static PRIVATE
$<IF:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,OS_TYPE=WIN,OS_TYPE=0>
FUNC_VISIBILITY
LOG_CPP
google=ascend_private
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>:SECUREC_USING_STD_SECURE_LIB=0 NOMINMAX>
$<$<STREQUAL:${ENABLE_OPEN_SRC},True>:ONLY_COMPILE_OPEN_SRC>
$<$<STREQUAL:${ENABLE_ACL_UT},ON>:ONLY_ENABLE_ACL_UT>
)
target_link_options(ascendcl_static PRIVATE
-rdynamic
-Wl,-Bsymbolic
-Wl,--exclude-libs,ALL
)
target_link_directories(ascendcl_static PRIVATE
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Android>:${TOP_DIR}/prebuilts/clang/linux-x86/aarch64/android-ndk-r21/sysroot/usr/lib/aarch64-linux-android/29>
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Android>:${TOP_DIR}/build/prebuilts/clang/linux-x86/aarch64/android-ndk-r21/sysroot/usr/lib/aarch64-linux-android/29>
)
target_link_libraries(ascendcl_static PRIVATE
$<BUILD_INTERFACE:intf_pub>
$<BUILD_INTERFACE:mmpa_headers>
$<BUILD_INTERFACE:msprof_headers>
$<BUILD_INTERFACE:slog_headers>
$<BUILD_INTERFACE:runtime_headers>
$<BUILD_INTERFACE:awatchdog_headers>
c_sec
json
ascend_protobuf
$<$<NOT:$<STREQUAL:${TARGET_SYSTEM_NAME},Android>>:-lrt>
-ldl
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Android>:-llog>
)
set_target_properties(ascendcl_static PROPERTIES
OUTPUT_NAME $<IF:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,libascendcl,ascendcl>
)
endif()
if(NOT (ENABLE_OPEN_SRC AND ((PRODUCT STREQUAL "flr2") OR (PRODUCT STREQUAL "flr3"))))
############ fwk/libascendcl.so ############
add_library(fwk_ascendcl SHARED
${SRC_LIST}
)
if (ENABLE_OPEN_SRC)
add_library(msprofiler_fwkacl_object OBJECT IMPORTED GLOBAL)
if (msprofiler_fwkacl_ext_LIBRARY_DIR)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/msprofiler_fwkacl_object)
execute_process(
COMMAND ar x ${msprofiler_fwkacl_ext_LIBRARY_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/msprofiler_fwkacl_object
)
file(GLOB MSPROFILER_FWKACL_OBJECT_LIST ${CMAKE_CURRENT_BINARY_DIR}/msprofiler_fwkacl_object/*.o)
set_property(TARGET msprofiler_fwkacl_object PROPERTY IMPORTED_OBJECTS ${MSPROFILER_FWKACL_OBJECT_LIST})
endif()
endif()
target_include_directories(fwk_ascendcl PRIVATE
####yellow zone####
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/inc>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/inc/tdt>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/metadef/inc>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/graphengine/inc>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/graphengine/inc/framework>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/metadef/inc/external>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/graphengine/inc/external>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/toolchain/ide/ide-daemon/external>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/abl/adump/external>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/abl/adump/inc/adump>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/inc/driver>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/abl/msprof/inc>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/ace/dvpp/inc/external/dvpp>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/ace/dvpp/inc/dvpp>
####blue zone####
$<$<BOOL:${ENABLE_OPEN_SRC}>:${BASE_DIR}/third_party/inc>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/runtime>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/datagw>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/ascend_hal>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/msprof>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/slog>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${BASE_DIR}/third_party/inc/tdt>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${METADEF_DIR}/inc>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${CANN_GE_DIR}/inc>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${CANN_GE_DIR}/inc/framework>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${METADEF_DIR}/inc/external>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${CANN_GE_DIR}/inc/external>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/adump/external>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/ascend_hal/driver>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${BASE_DIR}/third_party/inc/dvpp/inc/dvpp>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/acl/dvpp>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/awatchdog>
${BASE_DIR}/inc/external/acl
${BASE_DIR}/inc/external
${BASE_DIR}/inc
${BASE_DIR}
${BASE_DIR}/common
${BASE_DIR}/toolchain
)
target_compile_options(fwk_ascendcl PRIVATE
-O2
-fvisibility=hidden
-fno-common
)
target_compile_definitions(fwk_ascendcl PRIVATE
OS_TYPE=0
FUNC_VISIBILITY
google=ascend_private
$<$<STREQUAL:${ENABLE_OPEN_SRC}, True>:ONLY_COMPILE_OPEN_SRC>
$<$<STREQUAL:${ENABLE_ACL_UT},ON>:ONLY_ENABLE_ACL_UT>
)
target_link_options(fwk_ascendcl PRIVATE
-rdynamic
-Wl,-Bsymbolic
-Wl,--exclude-libs,ALL
)
target_link_directories(fwk_ascendcl PRIVATE
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Android>:${TOP_DIR}/prebuilts/clang/linux-x86/aarch64/android-ndk-r21/sysroot/usr/lib/aarch64-linux-android/29>
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Android>:${TOP_DIR}/build/prebuilts/clang/linux-x86/aarch64/android-ndk-r21/sysroot/usr/lib/aarch64-linux-android/29>
)
target_link_libraries(fwk_ascendcl PRIVATE
$<BUILD_INTERFACE:intf_pub>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:slog_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:msprof_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:mmpa_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:runtime_headers>>
ascend_dump
awatchdog_share
$<$<BOOL:${ENABLE_OPEN_SRC}>:adcore>
static_mmpa
-Wl,--no-as-needed
c_sec
msprofiler_fwk_share
profapi_share
runtime
slog
ge_common
graph
ascend_protobuf
register
error_manager
ge_runner
datatransfer
ascend_hal_stub
-Wl,--as-needed
json
-ldl
-lrt
)
set_target_properties(fwk_ascendcl PROPERTIES
OUTPUT_NAME ascendcl
LIBRARY_OUTPUT_DIRECTORY fwkacl
)
endif()
##################################################################################################################
add_custom_target(
stub_src ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/acl_stub.cpp
${CMAKE_CURRENT_BINARY_DIR}/dvpp_stub.cpp
${CMAKE_CURRENT_BINARY_DIR}/cblas_stub.cpp
${CMAKE_CURRENT_BINARY_DIR}/op_compiler_stub.cpp
${CMAKE_CURRENT_BINARY_DIR}/retr_stub.cpp
${CMAKE_CURRENT_BINARY_DIR}/tdt_channel_stub.cpp
${CMAKE_CURRENT_BINARY_DIR}/tdt_queue_stub.cpp
)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/acl_stub.cpp
${CMAKE_CURRENT_BINARY_DIR}/dvpp_stub.cpp
${CMAKE_CURRENT_BINARY_DIR}/cblas_stub.cpp
${CMAKE_CURRENT_BINARY_DIR}/op_compiler_stub.cpp
${CMAKE_CURRENT_BINARY_DIR}/retr_stub.cpp
${CMAKE_CURRENT_BINARY_DIR}/tdt_channel_stub.cpp
${CMAKE_CURRENT_BINARY_DIR}/tdt_queue_stub.cpp
COMMAND echo "Generating stub files:acl_stub.cpp, dvpp_stub.cpp, cblas_stub.cpp, op_compiler_stub.cpp, retr_stub.cpp, tdt_channel_stub.cpp, tdt_queue_stub.cpp."
&& ${HI_PYTHON} ${BASE_DIR}/stub/gen_stubapi.py ${BASE_DIR}/inc/external/acl
${CMAKE_CURRENT_BINARY_DIR}/acl_stub.cpp
${CMAKE_CURRENT_BINARY_DIR}/dvpp_stub.cpp
${CMAKE_CURRENT_BINARY_DIR}/cblas_stub.cpp
${CMAKE_CURRENT_BINARY_DIR}/op_compiler_stub.cpp
${CMAKE_CURRENT_BINARY_DIR}/retr_stub.cpp
${CMAKE_CURRENT_BINARY_DIR}/tdt_channel_stub.cpp
${CMAKE_CURRENT_BINARY_DIR}/tdt_queue_stub.cpp
&& echo "Generating stub files end."
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS stub/gen_stubapi.py ${BASE_DIR}/inc/external/acl
)
#----------------------------------------------------------------------------------------------------------------#
############ stub/libascendcl.so ############
add_library(stub_ascendcl SHARED
${CMAKE_CURRENT_BINARY_DIR}/acl_stub.cpp
)
target_compile_definitions(stub_ascendcl PRIVATE
_FORTIFY_SOURCE=2
)
set_target_properties(stub_ascendcl
PROPERTIES
OUTPUT_NAME ascendcl
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/stub
)
target_include_directories(stub_ascendcl PRIVATE
${BASE_DIR}/inc/external
${BASE_DIR}/inc
${BASE_DIR}
${BASE_DIR}/common
)
target_link_libraries(stub_ascendcl
PRIVATE
$<BUILD_INTERFACE:intf_pub>
PUBLIC
ascendcl_headers
)
#----------------------------------------------------------------------------------------------------------------#
############ stub/libacl_dvpp.so ############
add_library(stub_acl_dvpp SHARED
${CMAKE_CURRENT_BINARY_DIR}/dvpp_stub.cpp
)
set_target_properties(stub_acl_dvpp
PROPERTIES
OUTPUT_NAME acl_dvpp
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/stub
)
target_include_directories(stub_acl_dvpp PRIVATE
${BASE_DIR}/inc/external
${BASE_DIR}
${BASE_DIR}/common
)
target_compile_definitions(stub_acl_dvpp PRIVATE
ENABLE_DVPP_INTERFACE
_FORTIFY_SOURCE=2
$<$<STREQUAL:${ENABLE_OPEN_SRC},True>:ONLY_COMPILE_OPEN_SRC>
$<$<STREQUAL:${ENABLE_ACL_UT},ON>:ONLY_ENABLE_ACL_UT>
)
target_link_libraries(stub_acl_dvpp PRIVATE
$<BUILD_INTERFACE:intf_pub>
)
#----------------------------------------------------------------------------------------------------------------#
############ stub/libacl_cblas.so ############
add_library(stub_acl_cblas SHARED
${CMAKE_CURRENT_BINARY_DIR}/cblas_stub.cpp
)
target_include_directories(stub_acl_cblas PRIVATE
${BASE_DIR}/inc/external
${BASE_DIR}/inc
${BASE_DIR}
${BASE_DIR}/common
)
target_compile_definitions(stub_acl_cblas PRIVATE
_FORTIFY_SOURCE=2
)
set_target_properties(stub_acl_cblas
PROPERTIES
OUTPUT_NAME acl_cblas
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/stub
)
target_link_libraries(stub_acl_cblas PRIVATE
$<BUILD_INTERFACE:intf_pub>
$<$<NOT:$<STREQUAL:${TARGET_SYSTEM_NAME},Android>>:-lrt>
-ldl
)
#----------------------------------------------------------------------------------------------------------------#
############ stub/libacl_retr.so ############
add_library(stub_acl_retr SHARED
${CMAKE_CURRENT_BINARY_DIR}/retr_stub.cpp
)
target_include_directories(stub_acl_retr PRIVATE
${BASE_DIR}/inc/external
${BASE_DIR}/inc
${BASE_DIR}
${BASE_DIR}/common
)
target_compile_definitions(stub_acl_retr PRIVATE
_FORTIFY_SOURCE=2
)
set_target_properties(stub_acl_retr
PROPERTIES
OUTPUT_NAME acl_retr
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/stub
)
target_link_libraries(stub_acl_retr PRIVATE
$<BUILD_INTERFACE:intf_pub>
$<$<NOT:$<STREQUAL:${TARGET_SYSTEM_NAME},Android>>:-lrt>
-ldl
)
#----------------------------------------------------------------------------------------------------------------#
############ stub/libacl_op_compiler.so ############
add_library(stub_acl_op_compiler SHARED
${CMAKE_CURRENT_BINARY_DIR}/op_compiler_stub.cpp
)
target_include_directories(stub_acl_op_compiler PRIVATE
${BASE_DIR}/inc/external
${BASE_DIR}/inc
${BASE_DIR}
${TOP_DIR}/graphengine/inc/framework
${BASE_DIR}/common
)
target_compile_definitions(stub_acl_op_compiler PRIVATE
_FORTIFY_SOURCE=2
)
set_target_properties(stub_acl_op_compiler
PROPERTIES
OUTPUT_NAME acl_op_compiler
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/stub
)
target_link_libraries(stub_acl_op_compiler PRIVATE
$<BUILD_INTERFACE:intf_pub>
$<$<NOT:$<STREQUAL:${TARGET_SYSTEM_NAME},Android>>:-lrt>
-ldl
)
##################################################################################################################
############ stub/libacl_tdt_channel.so ############
add_library(stub_acl_tdt_channel SHARED
${CMAKE_CURRENT_BINARY_DIR}/tdt_channel_stub.cpp
)
target_include_directories(stub_acl_tdt_channel PRIVATE
${BASE_DIR}/inc/external
${BASE_DIR}/inc
${BASE_DIR}
)
target_compile_definitions(stub_acl_tdt_channel PRIVATE
_FORTIFY_SOURCE=2
)
set_target_properties(stub_acl_tdt_channel
PROPERTIES
OUTPUT_NAME acl_tdt_channel
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/stub
)
target_link_libraries(stub_acl_tdt_channel PRIVATE
$<BUILD_INTERFACE:intf_pub>
$<$<NOT:$<STREQUAL:${TARGET_SYSTEM_NAME},Android>>:-lrt>
-ldl
)
##################################################################################################################
############ stub/libacl_tdt_queue.so ############
add_library(stub_acl_tdt_queue SHARED
${CMAKE_CURRENT_BINARY_DIR}/tdt_queue_stub.cpp
)
target_include_directories(stub_acl_tdt_queue PRIVATE
${BASE_DIR}/inc/external
${BASE_DIR}/inc
${BASE_DIR}
)
target_compile_definitions(stub_acl_tdt_queue PRIVATE
_FORTIFY_SOURCE=2
)
set_target_properties(stub_acl_tdt_queue
PROPERTIES
OUTPUT_NAME acl_tdt_queue
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/stub
)
target_link_libraries(stub_acl_tdt_queue PRIVATE
$<BUILD_INTERFACE:intf_pub>
$<$<NOT:$<STREQUAL:${TARGET_SYSTEM_NAME},Android>>:-lrt>
-ldl
)
##################################################################################################################
############ libacl_dvpp.so ############
add_library(acl_dvpp SHARED
single_op/dvpp/channel.cpp
single_op/dvpp/vpc.cpp
single_op/dvpp/jpeg.cpp
single_op/dvpp/vdec.cpp
single_op/dvpp/venc.cpp
single_op/dvpp/png.cpp
single_op/dvpp/base/image_processor.cpp
single_op/dvpp/base/video_processor.cpp
single_op/dvpp/mgr/dvpp_manager.cpp
single_op/dvpp/v100/image_processor_v100.cpp
single_op/dvpp/v200/image_processor_v200.cpp
$<$<NOT:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>>:single_op/dvpp/v300/image_processor_v300.cpp>
single_op/dvpp/v100/video_processor_v100.cpp
single_op/dvpp/v200/video_processor_v200.cpp
single_op/dvpp/common/dvpp_util.cpp
types/dvpp.cpp
$<$<STREQUAL:${PRODUCT},npuf10>:stub/libjpeg_lhisi_stub.cpp>
)
if(${TARGET_SYSTEM_NAME} STREQUAL "Windows")
set(JPEG_INCCLUDE_PATH )
else()
set(JPEG_INCCLUDE_PATH ${TOP_DIR}/open_source/libjpeg-turbo/include)
endif()
target_include_directories(acl_dvpp PRIVATE
####yellow zone####
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/inc>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/inc/mmpa>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/metadef/inc>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/metadef/inc/external>
####blue zone####
$<$<BOOL:${ENABLE_OPEN_SRC}>:${BASE_DIR}/third_party/inc/>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/runtime>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/datagw>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/ascend_hal>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/msprof>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/slog>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/mmpa>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${METADEF_DIR}/inc>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${METADEF_DIR}/inc/external>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${BASE_DIR}/third_party/inc/dvpp/inc/dvpp>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/acl/dvpp>
${BASE_DIR}/inc/external
${BASE_DIR}/inc
${BASE_DIR}
${BASE_DIR}/common
${BASE_DIR}/toolchain
${JPEG_INCCLUDE_PATH}
)
target_compile_options(acl_dvpp PRIVATE
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Linux>:-fvisibility=hidden -O2 -fno-common>
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>:/utf-8>
)
target_compile_definitions(acl_dvpp PRIVATE
$<IF:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,OS_TYPE=WIN,OS_TYPE=0>
FUNC_VISIBILITY
ENABLE_DVPP_INTERFACE
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>:SECUREC_USING_STD_SECURE_LIB=0 NOMINMAX>
$<$<STREQUAL:${ENABLE_OPEN_SRC},True>:ONLY_COMPILE_OPEN_SRC>
$<$<STREQUAL:${ENABLE_ACL_UT},ON>:ONLY_ENABLE_ACL_UT>
)
target_link_options(acl_dvpp PRIVATE
-rdynamic
-Wl,-Bsymbolic
-Wl,--exclude-libs,ALL
-s
)
target_link_libraries(acl_dvpp PRIVATE
$<BUILD_INTERFACE:intf_pub>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:slog_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:msprof_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:mmpa_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:runtime_headers>>
$<$<AND:$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>,$<NOT:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>>>:$<BUILD_INTERFACE:dvpp_headers>>
$<$<NOT:$<STREQUAL:${PRODUCT},npuf10>>:static_turbojpeg>
static_mmpa
-Wl,--no-as-needed
runtime
alog
c_sec
ascendcl
# windows mpi is not supported
$<$<NOT:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>>:acl_dvpp_mpi>
-Wl,--as-needed
$<$<NOT:$<STREQUAL:${TARGET_SYSTEM_NAME},Android>>:-lrt>
-ldl
)
if(${TARGET_SYSTEM_NAME} STREQUAL "Windows")
set_target_properties(acl_dvpp PROPERTIES
WINDOWS_EXPORT_ALL_SYMBOLS TRUE
OUTPUT_NAME libacl_dvpp
)
endif()
############ libacl_cblas.so ############
add_library(acl_cblas SHARED
single_op/blas/gemm_ops.cpp
single_op/blas/gemv_ops.cpp
)
target_include_directories(acl_cblas PRIVATE
${BASE_DIR}
${BASE_DIR}/inc/ops
${BASE_DIR}/common
${BASE_DIR}/type
${BASE_DIR}/inc
${BASE_DIR}/inc/external
####yellow zone####
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/inc>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/metadef/inc>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/graphengine/inc/framework>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/metadef/inc/external>
####blue zone####
$<$<BOOL:${ENABLE_OPEN_SRC}>:${BASE_DIR}/third_party/inc/>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/runtime>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/datagw>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/ascend_hal>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/msprof>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/slog>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${METADEF_DIR}/inc>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${CANN_GE_DIR}/inc/framework>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${METADEF_DIR}/inc/external>
)
target_compile_options(acl_cblas PRIVATE
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Linux>:-fvisibility=hidden -O2 -fno-common>
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>:/utf-8>
$<$<AND:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,$<STREQUAL:${CMAKE_CONFIGURATION_TYPES},Debug>>:/MTd>
$<$<AND:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,$<STREQUAL:${CMAKE_CONFIGURATION_TYPES},Release>>:/MT>
)
target_compile_definitions(acl_cblas PRIVATE
$<IF:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,OS_TYPE=WIN,OS_TYPE=0>
FUNC_VISIBILITY
$<$<STREQUAL:${ENABLE_OPEN_SRC},True>:ONLY_COMPILE_OPEN_SRC>
$<$<STREQUAL:${ENABLE_ACL_UT},ON>:ONLY_ENABLE_ACL_UT>
)
target_link_options(acl_cblas PRIVATE
-rdynamic
-Wl,-Bsymbolic
-Wl,--exclude-libs,ALL
)
target_link_libraries(acl_cblas PRIVATE
$<BUILD_INTERFACE:intf_pub>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:slog_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:msprof_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:mmpa_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:runtime_headers>>
-Wl,--no-as-needed
c_sec
ascendcl
alog
-Wl,--as-needed
$<$<NOT:$<STREQUAL:${TARGET_SYSTEM_NAME},Android>>:-lrt>
-ldl
)
if(${TARGET_SYSTEM_NAME} STREQUAL "Windows")
set_target_properties(acl_cblas PROPERTIES
WINDOWS_EXPORT_ALL_SYMBOLS TRUE
OUTPUT_NAME libacl_cblas
)
endif()
############ libacl_retr.so ############
add_library(acl_retr SHARED
single_op/retr/retr_ops.cpp
types/retr.cpp
single_op/retr/retr_internal.cpp
single_op/retr/retr_init.cpp
single_op/retr/retr_release.cpp
single_op/retr/retr_repo.cpp
single_op/retr/retr_accurate.cpp
single_op/retr/retr_search.cpp
)
target_include_directories(acl_retr PRIVATE
${BASE_DIR}
${BASE_DIR}/inc/external
####yellow zone####
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/inc>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/metadef/inc>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/metadef/inc/external>
####blue zone####
$<$<BOOL:${ENABLE_OPEN_SRC}>:${BASE_DIR}/third_party/inc/>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/runtime>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/datagw>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/ascend_hal>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/msprof>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/slog>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${METADEF_DIR}/inc>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${METADEF_DIR}/inc/external>
)
target_compile_options(acl_retr PRIVATE
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Linux>:-fvisibility=hidden -O2 -Werror -fno-common>
-ftrapv
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>:/utf-8>
$<$<AND:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,$<STREQUAL:${CMAKE_CONFIGURATION_TYPES},Debug>>:/MTd>
$<$<AND:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,$<STREQUAL:${CMAKE_CONFIGURATION_TYPES},Release>>:/MT>
)
target_compile_definitions(acl_retr PRIVATE
_FORTIFY_SOURCE=2
OS_TYPE=0
FUNC_VISIBILITY
$<$<STREQUAL:${ENABLE_OPEN_SRC},True>:ONLY_COMPILE_OPEN_SRC>
$<$<STREQUAL:${ENABLE_ACL_UT},ON>:ONLY_ENABLE_ACL_UT>
)
target_link_options(acl_retr PRIVATE
-rdynamic
-Wl,-Bsymbolic
-Wl,--exclude-libs,ALL
)
target_link_libraries(acl_retr PRIVATE
$<BUILD_INTERFACE:intf_pub>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:slog_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:msprof_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:mmpa_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:runtime_headers>>
-Wl,--no-as-needed
ascendcl
alog
runtime
c_sec
-Wl,--as-needed
-ldl
)
if(${TARGET_SYSTEM_NAME} STREQUAL "Windows")
set_target_properties(acl_retr PROPERTIES
WINDOWS_EXPORT_ALL_SYMBOLS TRUE
OUTPUT_NAME libacl_retr
)
endif()
############ libacl_tdt_queue.so ############
add_library(acl_tdt_queue SHARED
tensor_data_transfer/queue.cpp
tensor_data_transfer/queue_manager.cpp
tensor_data_transfer/queue_process.cpp
tensor_data_transfer/queue_process_host.cpp
tensor_data_transfer/queue_process_mdc.cpp
tensor_data_transfer/queue_process_ccpu.cpp
)
target_include_directories(acl_tdt_queue PRIVATE
####yellow zone####
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/inc>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/inc/driver>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/ace/npuruntime/inc>
####blue zone####
$<$<BOOL:${ENABLE_OPEN_SRC}>:${BASE_DIR}/third_party/inc/>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/runtime>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/datagw>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/ascend_hal>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/msprof>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/slog>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/ascend_hal/driver>
${BASE_DIR}/inc/external
${BASE_DIR}/inc
${BASE_DIR}
${BASE_DIR}/common
)
target_compile_options(acl_tdt_queue PRIVATE
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Linux>:-fvisibility=hidden -O2 -Werror -fno-common>
-ftrapv
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>:/utf-8>
$<$<AND:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,$<STREQUAL:${CMAKE_CONFIGURATION_TYPES},Debug>>:/MTd>
$<$<AND:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,$<STREQUAL:${CMAKE_CONFIGURATION_TYPES},Release>>:/MT>
)
target_compile_definitions(acl_tdt_queue PRIVATE
_FORTIFY_SOURCE=2
OS_TYPE=0
FUNC_VISIBILITY
$<$<STREQUAL:${ENABLE_OPEN_SRC},True>:ONLY_COMPILE_OPEN_SRC>
$<$<STREQUAL:${ENABLE_ACL_UT},ON>:ONLY_ENABLE_ACL_UT>
)
target_link_options(acl_tdt_queue PRIVATE
-rdynamic
-Wl,-Bsymbolic
-Wl,--exclude-libs,ALL
)
target_link_libraries(acl_tdt_queue PRIVATE
$<BUILD_INTERFACE:intf_pub>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:slog_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:msprof_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:mmpa_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:runtime_headers>>
-Wl,--no-as-needed
ascendcl
static_mmpa
alog
runtime
c_sec
-Wl,--as-needed
-ldl
)
if(${TARGET_SYSTEM_NAME} STREQUAL "Windows")
set_target_properties(acl_tdt_queue PROPERTIES
WINDOWS_EXPORT_ALL_SYMBOLS TRUE
OUTPUT_NAME libacl_tdt_queue
)
endif()
if(NOT (ENABLE_OPEN_SRC AND ((PRODUCT STREQUAL "flr2") OR (PRODUCT STREQUAL "flr3"))))
############ libacl_op_compiler.so ############
add_library(acl_op_compiler SHARED
single_op/op_compiler.cpp
single_op/compile/local_compiler.cpp
single_op/compile/op_compile_processor.cpp
)
target_include_directories(acl_op_compiler PRIVATE
${BASE_DIR}
${BASE_DIR}/common
${BASE_DIR}/inc/external
####yellow zone####
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/inc>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/metadef/inc>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/graphengine/inc>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/graphengine/inc/framework>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/metadef/inc/external>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/graphengine/inc/external>
####blue zone####
$<$<BOOL:${ENABLE_OPEN_SRC}>:${BASE_DIR}/third_party/inc/>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/runtime>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/datagw>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/ascend_hal>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/msprof>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/slog>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${METADEF_DIR}/inc>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${CANN_GE_DIR}/inc>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${CANN_GE_DIR}/inc/framework>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${METADEF_DIR}/inc/external>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${CANN_GE_DIR}/inc/external>
)
target_compile_options(acl_op_compiler PRIVATE
-ftrapv
-O2
-Werror
-Wno-deprecated-declarations
-fvisibility=hidden
-fno-common
)
target_compile_definitions(acl_op_compiler PRIVATE
_FORTIFY_SOURCE=2
OS_TYPE=0
FUNC_VISIBILITY
google=ascend_private
$<$<STREQUAL:${ENABLE_OPEN_SRC},True>:ONLY_COMPILE_OPEN_SRC>
$<$<STREQUAL:${ENABLE_ACL_UT},ON>:ONLY_ENABLE_ACL_UT>
)
target_link_options(acl_op_compiler PRIVATE
-rdynamic
-Wl,-Bsymbolic
-Wl,--exclude-libs,ALL
)
target_link_libraries(acl_op_compiler PRIVATE
$<BUILD_INTERFACE:intf_pub>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:slog_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:msprof_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:mmpa_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:runtime_headers>>
static_mmpa
-Wl,--no-as-needed
ascendcl
slog
runtime
c_sec
ge_runner
ascend_protobuf
json
-Wl,--as-needed
-ldl
$<$<NOT:$<STREQUAL:${TARGET_SYSTEM_NAME},Android>>:-lrt>
)
endif()
if(NOT (ENABLE_OPEN_SRC AND ((PRODUCT STREQUAL "flr2") OR (PRODUCT STREQUAL "flr3"))))
############ libacl_tdt_channel.so ############
add_library(acl_tdt_channel SHARED
tensor_data_transfer/tensor_data_transfer.cpp
)
target_include_directories(acl_tdt_channel PRIVATE
####yellow zone####
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/inc>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/ace/npuruntime/inc/tdt>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/metadef/inc>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/graphengine/inc>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/graphengine/inc/framework>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/metadef/inc/external>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/graphengine/inc/external>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/abl/adump/external>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${TOP_DIR}/inc/driver>
####blue zone####
$<$<BOOL:${ENABLE_OPEN_SRC}>:${BASE_DIR}/third_party/inc/>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/runtime>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/datagw>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/ascend_hal>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/msprof>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/slog>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${BASE_DIR}/third_party/inc/tdt>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${METADEF_DIR}/inc>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${CANN_GE_DIR}/inc>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${CANN_GE_DIR}/inc/framework>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${METADEF_DIR}/inc/external>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${CANN_GE_DIR}/inc/external>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/adump/external>
$<$<BOOL:${ENABLE_OPEN_SRC}>:${ASCEND_INSTALL_PATH}/include/experiment/ascend_hal/driver>
${BASE_DIR}/inc/external
${BASE_DIR}/inc
${BASE_DIR}
${BASE_DIR}/common
)
target_compile_options(acl_tdt_channel PRIVATE
-ftrapv
-O2
-Werror
-Wno-deprecated-declarations
-fvisibility=hidden
-fno-common
)
target_compile_definitions(acl_tdt_channel PRIVATE
_FORTIFY_SOURCE=2
OS_TYPE=0
FUNC_VISIBILITY
$<$<STREQUAL:${ENABLE_OPEN_SRC}, True>:ONLY_COMPILE_OPEN_SRC>
$<$<STREQUAL:${ENABLE_ACL_UT},ON>:ONLY_ENABLE_ACL_UT>
)
target_link_options(acl_tdt_channel PRIVATE
-rdynamic
-Wl,-Bsymbolic
-Wl,--exclude-libs,ALL
)
target_link_libraries(acl_tdt_channel PRIVATE
$<BUILD_INTERFACE:intf_pub>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:slog_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:msprof_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:mmpa_headers>>
$<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:runtime_headers>>
static_mmpa
-Wl,--no-as-needed
ascendcl
acl_tdt_queue
runtime
c_sec
slog
datatransfer
-Wl,--as-needed
-ldl
$<$<NOT:$<STREQUAL:${TARGET_SYSTEM_NAME},Android>>:-lrt>
)
endif()
############ install #############
install(TARGETS ascendcl ascendcl_headers
EXPORT ascendcl-targets
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR} OPTIONAL COMPONENT opensdk
ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR} OPTIONAL COMPONENT opensdk
RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR} OPTIONAL COMPONENT opensdk
)
install(TARGETS stub_ascendcl
EXPORT ascendcl-targets
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}/stub OPTIONAL COMPONENT opensdk
ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR} OPTIONAL COMPONENT opensdk
RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR} OPTIONAL COMPONENT opensdk
)
install(FILES ${BASE_DIR}/inc/external/acl/acl.h
${BASE_DIR}/inc/external/acl/acl_base.h
${BASE_DIR}/inc/external/acl/acl_mdl.h
${BASE_DIR}/inc/external/acl/acl_op.h
${BASE_DIR}/inc/external/acl/acl_op_compiler.h
${BASE_DIR}/inc/external/acl/acl_rt.h
${BASE_DIR}/inc/external/acl/acl_rt_allocator.h
${BASE_DIR}/inc/external/acl/acl_tdt.h
${BASE_DIR}/inc/external/acl/acl_tdt_queue.h
${TOP_DIR}/abl/msprof/inc/external/acl/acl_prof.h
DESTINATION ${INSTALL_INCLUDE_DIR}/ascendcl/external/acl COMPONENT opensdk EXCLUDE_FROM_ALL
)
install(FILES ${CANN_GE_DIR}/inc/external/ge/ge_error_codes.h
${TOP_DIR}/ace/npuruntime/inc/external/runtime/rt_error_codes.h
DESTINATION ${INSTALL_INCLUDE_DIR}/ascendcl/external/acl/error_codes COMPONENT opensdk EXCLUDE_FROM_ALL
)
install(FILES ${BASE_DIR}/inc/external/acl/ops/acl_cblas.h
${BASE_DIR}/inc/external/acl/ops/acl_dvpp.h
${BASE_DIR}/inc/external/acl/ops/acl_fv.h
DESTINATION ${INSTALL_INCLUDE_DIR}/ascendcl/external/acl/ops COMPONENT opensdk EXCLUDE_FROM_ALL
)
if (PACKAGE STREQUAL "opensdk")
install(EXPORT ascendcl-targets DESTINATION ${INSTALL_CONFIG_DIR}
FILE ascendcl-targets.cmake COMPONENT opensdk EXCLUDE_FROM_ALL
)
set(PKG_NAME ascendcl)
configure_package_config_file(${TOP_DIR}/cmake/config/pkg_config_template.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/ascendcl-config.cmake
INSTALL_DESTINATION ${INSTALL_CONFIG_DIR}
PATH_VARS INSTALL_BASE_DIR INSTALL_INCLUDE_DIR INSTALL_LIBRARY_DIR INSTALL_RUNTIME_DIR INSTALL_CONFIG_DIR
INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}
)
unset(PKG_NAME)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ascendcl-config.cmake
DESTINATION ${INSTALL_CONFIG_DIR} COMPONENT opensdk EXCLUDE_FROM_ALL
)
endif()
if(${TARGET_SYSTEM_NAME} STREQUAL "Windows")
install(TARGETS acl_dvpp acl_cblas acl_retr acl_op_compiler acl_tdt_channel acl_tdt_queue ascendcl_static OPTIONAL
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
)
install(FILES $<TARGET_PDB_FILE:ascendcl acl_dvpp acl_cblas acl_retr> DESTINATION ${INSTALL_LIBRARY_DIR} OPTIONAL)
elseif(NOT ENABLE_OPEN_SRC)
install(TARGETS acl_dvpp acl_cblas acl_retr acl_op_compiler acl_tdt_channel acl_tdt_queue ascendcl_static OPTIONAL
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR}
)
else()
install(TARGETS acl_dvpp acl_cblas acl_retr acl_tdt_queue OPTIONAL
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR}
)
if(NOT (ENABLE_OPEN_SRC AND ((PRODUCT STREQUAL "flr2") OR (PRODUCT STREQUAL "flr3"))))
install(TARGETS acl_op_compiler acl_tdt_channel OPTIONAL
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR}
)
endif()
endif()
install(TARGETS stub_acl_dvpp stub_acl_cblas stub_acl_retr stub_acl_op_compiler stub_acl_tdt_channel stub_acl_tdt_queue OPTIONAL
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}/stub
)
install(TARGETS stub_acl_dvpp stub_acl_cblas stub_acl_retr stub_acl_tdt_queue stub_ascendcl OPTIONAL
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}/${CMAKE_SYSTEM_PROCESSOR}/stub
)
if(NOT (ENABLE_OPEN_SRC AND ((PRODUCT STREQUAL "flr2") OR (PRODUCT STREQUAL "flr3"))))
install(TARGETS fwk_ascendcl OPTIONAL
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}/fwkacl
)
endif()
add_dependencies(stub_ascendcl stub_src)
add_dependencies(stub_acl_op_compiler stub_src)
add_dependencies(stub_acl_tdt_channel stub_src)
add_dependencies(stub_acl_tdt_queue stub_src)
add_dependencies(stub_acl_retr stub_src)
add_dependencies(stub_acl_cblas stub_src)
add_dependencies(stub_acl_dvpp stub_src)
if (ENABLE_OPEN_SRC
AND NOT (ENABLE_ACL_UT OR ENABLE_ACL_COV OR ENABLE_C_UT OR ENABLE_C_COV)
AND NOT ASCENDCL_C)
set(ARCH_LINX_PATH "${CMAKE_SYSTEM_PROCESSOR}-linux")
install(TARGETS acl_cblas
acl_dvpp
acl_retr
acl_tdt_queue
ascendcl
LIBRARY DESTINATION ${ARCH_LINX_PATH}/lib64 OPTIONAL COMPONENT packages EXCLUDE_FROM_ALL
ARCHIVE DESTINATION ${ARCH_LINX_PATH}/lib64 OPTIONAL COMPONENT packages EXCLUDE_FROM_ALL
)
install(TARGETS stub_acl_cblas
stub_acl_dvpp
stub_acl_retr
stub_acl_op_compiler
stub_acl_tdt_channel
stub_acl_tdt_queue
stub_ascendcl
LIBRARY DESTINATION ${ARCH_LINX_PATH}/lib64/stub OPTIONAL COMPONENT packages EXCLUDE_FROM_ALL
ARCHIVE DESTINATION ${ARCH_LINX_PATH}/lib64/stub OPTIONAL COMPONENT packages EXCLUDE_FROM_ALL
)
if (NOT ((PRODUCT STREQUAL "flr2") OR (PRODUCT STREQUAL "flr3")))
install(TARGETS acl_op_compiler
acl_tdt_channel
LIBRARY DESTINATION ${ARCH_LINX_PATH}/lib64 OPTIONAL COMPONENT packages EXCLUDE_FROM_ALL
ARCHIVE DESTINATION ${ARCH_LINX_PATH}/lib64 OPTIONAL COMPONENT packages EXCLUDE_FROM_ALL
)
endif ()
install(FILES ${CMAKE_CURRENT_LIST_DIR}/inc/external/acl/acl.h
${CMAKE_CURRENT_LIST_DIR}/inc/external/acl/acl_base.h
${CMAKE_CURRENT_LIST_DIR}/inc/external/acl/acl_mdl.h
${CMAKE_CURRENT_LIST_DIR}/inc/external/acl/acl_op.h
${CMAKE_CURRENT_LIST_DIR}/inc/external/acl/acl_op_compiler.h
${CMAKE_CURRENT_LIST_DIR}/third_party/inc/toolchain/external/acl/acl_prof.h
${CMAKE_CURRENT_LIST_DIR}/inc/external/acl/acl_rt.h
${CMAKE_CURRENT_LIST_DIR}/inc/external/acl/acl_tdt.h
DESTINATION ${ARCH_LINX_PATH}/include/acl OPTIONAL COMPONENT packages EXCLUDE_FROM_ALL
)
install(FILES ${CMAKE_CURRENT_LIST_DIR}/third_party/inc/graphengine/inc/external/ge/ge_error_codes.h
${CMAKE_CURRENT_LIST_DIR}/third_party/inc/runtime/external/rt_error_codes.h
DESTINATION ${ARCH_LINX_PATH}/include/acl/error_codes OPTIONAL COMPONENT packages EXCLUDE_FROM_ALL
)
install(FILES ${CMAKE_CURRENT_LIST_DIR}/inc/external/acl/ops/acl_cblas.h
${CMAKE_CURRENT_LIST_DIR}/inc/external/acl/ops/acl_dvpp.h
${CMAKE_CURRENT_LIST_DIR}/inc/external/acl/ops/acl_fv.h
DESTINATION ${ARCH_LINX_PATH}/include/acl/ops OPTIONAL COMPONENT packages EXCLUDE_FROM_ALL
)
set(version_info "${ASCEND_INSTALL_PATH}/runtime/version.info")
set(install_script_dir "${CMAKE_CURRENT_BINARY_DIR}/install_scripts/")
add_custom_target(generate_install_script_acl ALL
COMMAND rm -rf ${install_script_dir}
COMMAND cp -rf ${ASCEND_INSTALL_PATH}/toolkit/tools/ascend_project/open_install_scripts ${install_script_dir}
COMMAND chmod -R u+w ${install_script_dir}
COMMAND echo "base_package=runtime\;compiler" > ${install_script_dir}/version.info
COMMAND echo "backup_dir=acl" >> ${install_script_dir}/version.info
COMMAND grep -iE "'^(version|version_dir)='" ${version_info} >> ${install_script_dir}/version.info
)
install(DIRECTORY ${install_script_dir}
DESTINATION . OPTIONAL
FILE_PERMISSIONS OWNER_EXECUTE OWNER_READ GROUP_READ
COMPONENT . EXCLUDE_FROM_ALL
)
set(CPACK_COMPONENTS_ALL ".;packages")
set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
set(CPACK_PACKAGE_VERSION ${CMAKE_PROJECT_VERSION})
set(CPACK_PACKAGE_DESCRIPTION "CPack acl project")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CPack acl project")
set(CPACK_PACKAGE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/package)
set(CPACK_PACKAGE_FILE_NAME "CANN-acl-linux.${CMAKE_SYSTEM_PROCESSOR}.run")
set(CPACK_GENERATOR External)
set(CPACK_CMAKE_GENERATOR "Unix Makefiles")
set(CPACK_EXTERNAL_ENABLE_STAGING TRUE)
set(CPACK_EXTERNAL_PACKAGE_SCRIPT ${ASCEND_INSTALL_PATH}/toolkit/tools/op_project_templates/ascendc/customize/cmake/makeself.cmake)
set(CPACK_EXTERNAL_BUILT_PACKAGES ${CPACK_PACKAGE_DIRECTORY}/_CPack_Packages/Linux/External/${CPACK_PACKAGE_FILE_NAME}/${CPACK_PACKAGE_FILE_NAME})
include(CPack)
endif()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/dannyer_2020/acl.git
git@gitee.com:dannyer_2020/acl.git
dannyer_2020
acl
acl
master

搜索帮助