-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
… develop
- Loading branch information
Showing
486 changed files
with
21,451 additions
and
5,468 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
include(ExternalProject) | ||
|
||
set(CONCURRENTQUEUE_PROJECT "extern_concurrentqueue") | ||
set(CONCURRENTQUEUE_VER "v1.0.3") | ||
SET(CONCURRENTQUEUE_URL_MD5 118e5bb661b567634647312991e10222) | ||
set(CONCURRENTQUEUE_PREFIX_URL "https://github.com/cameron314/concurrentqueue/archive/refs/tags") | ||
set(CONCURRENTQUEUE_URL "${CONCURRENTQUEUE_PREFIX_URL}/${CONCURRENTQUEUE_VER}.tar.gz") | ||
|
||
MESSAGE(STATUS "CONCURRENTQUEUE_VERSION: ${CONCURRENTQUEUE_VER}, CONCURRENTQUEUE_URL: ${CONCURRENTQUEUE_URL}") | ||
|
||
set(CONCURRENTQUEUE_PREFIX_DIR ${THIRD_PARTY_PATH}/concurrentqueue) | ||
set(CONCURRENTQUEUE_SOURCE_DIR ${THIRD_PARTY_PATH}/concurrentqueue/src/) | ||
set(CONCURRENTQUEUE_INCLUDE_DIR "${CONCURRENTQUEUE_SOURCE_DIR}/extern_concurrentqueue") | ||
|
||
ExternalProject_Add( | ||
${CONCURRENTQUEUE_PROJECT} | ||
${EXTERNAL_PROJECT_LOG_ARGS} | ||
URL ${CONCURRENTQUEUE_URL} | ||
URL_MD5 ${CONCURRENTQUEUE_URL_MD5} | ||
PREFIX ${CONCURRENTQUEUE_PREFIX_DIR} | ||
DOWNLOAD_NO_PROGRESS 1 | ||
CONFIGURE_COMMAND "" | ||
BUILD_COMMAND "" | ||
INSTALL_COMMAND "" | ||
UPDATE_COMMAND "" | ||
) | ||
|
||
include_directories(${CONCURRENTQUEUE_INCLUDE_DIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set(PADDLE_INFRT_INSTALL_DIR "${CMAKE_BINARY_DIR}/paddle_infrt_install_dir" CACHE STRING | ||
"A path setting paddle infrt shared and static libraries") | ||
|
||
function(copy TARGET) | ||
set(options "") | ||
set(oneValueArgs "") | ||
set(multiValueArgs SRCS DSTS) | ||
cmake_parse_arguments(copy_lib "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) | ||
|
||
list(LENGTH copy_lib_SRCS copy_lib_SRCS_len) | ||
list(LENGTH copy_lib_DSTS copy_lib_DSTS_len) | ||
if (NOT ${copy_lib_SRCS_len} EQUAL ${copy_lib_DSTS_len}) | ||
message(FATAL_ERROR "${TARGET} source numbers are not equal to destination numbers") | ||
endif () | ||
math(EXPR len "${copy_lib_SRCS_len} - 1") | ||
foreach (index RANGE ${len}) | ||
list(GET copy_lib_SRCS ${index} src) | ||
list(GET copy_lib_DSTS ${index} dst) | ||
add_custom_command(TARGET ${TARGET} POST_BUILD | ||
COMMAND mkdir -p "${dst}" | ||
COMMAND cp -r "${src}" "${dst}" | ||
COMMENT "copying ${src} -> ${dst}") | ||
endforeach () | ||
endfunction() | ||
|
||
function(copy_part_of_thrid_party TARGET DST) | ||
set(dst_dir "${DST}/third_party/install/glog") | ||
copy(${TARGET} | ||
SRCS ${GLOG_INCLUDE_DIR} ${GLOG_LIBRARIES} | ||
DSTS ${dst_dir} ${dst_dir}/lib) | ||
endfunction() | ||
|
||
# inference library for only inference | ||
set(infrt_lib_deps third_party infrt infrt_static) | ||
add_custom_target(infrt_lib_dist DEPENDS ${infrt_lib_deps}) | ||
|
||
|
||
# CMakeCache Info | ||
copy(infrt_lib_dist | ||
SRCS ${CMAKE_BINARY_DIR}/CMakeCache.txt | ||
DSTS ${PADDLE_INFRT_INSTALL_DIR}) | ||
|
||
set(src_dir "${PADDLE_SOURCE_DIR}/paddle/infrt") | ||
set(paddle_infrt_lib ${PADDLE_BINARY_DIR}/paddle/infrt/libinfrt.*) | ||
copy(infrt_lib_dist | ||
SRCS ${src_dir}/api/infrt_api.h ${paddle_infrt_lib} | ||
DSTS ${PADDLE_INFRT_INSTALL_DIR}/infrt/include ${PADDLE_INFRT_INSTALL_DIR}/infrt/lib) | ||
|
||
|
||
copy(infrt_lib_dist | ||
SRCS ${CMAKE_BINARY_DIR}/paddle/infrt/paddle/framework.pb.h | ||
DSTS ${PADDLE_INFRT_INSTALL_DIR}/infrt/include/internal) | ||
|
||
# paddle fluid version | ||
function(version version_file) | ||
execute_process( | ||
COMMAND ${GIT_EXECUTABLE} log --pretty=format:%H -1 | ||
WORKING_DIRECTORY ${PADDLE_SOURCE_DIR} | ||
OUTPUT_VARIABLE PADDLE_GIT_COMMIT) | ||
file(WRITE ${version_file} "GIT COMMIT ID: ${PADDLE_GIT_COMMIT}\n") | ||
file(APPEND ${version_file} "CXX compiler version: ${CMAKE_CXX_COMPILER_VERSION}\n") | ||
endfunction() | ||
version(${PADDLE_INFRT_INSTALL_DIR}/version.txt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
if(NOT WITH_MLU) | ||
return() | ||
endif() | ||
|
||
if(NOT ENV{NEUWARE_HOME}) | ||
set(NEUWARE_HOME "/usr/local/neuware") | ||
else() | ||
set(NEUWARE_HOME $ENV{NEUWARE_HOME}) | ||
endif() | ||
message(STATUS "NEUWARE_HOME: " ${NEUWARE_HOME}) | ||
|
||
set(NEUWARE_INCLUDE_DIR ${NEUWARE_HOME}/include) | ||
set(NEUWARE_LIB_DIR ${NEUWARE_HOME}/lib64) | ||
|
||
INCLUDE_DIRECTORIES(${NEUWARE_INCLUDE_DIR}) | ||
|
||
set(CNNL_LIB ${NEUWARE_LIB_DIR}/libcnnl.so) | ||
set(CNRT_LIB ${NEUWARE_LIB_DIR}/libcnrt.so) | ||
set(CNDRV_LIB ${NEUWARE_LIB_DIR}/libcndrv.so) | ||
|
||
generate_dummy_static_lib(LIB_NAME "neuware_lib" GENERATOR "neuware.cmake") | ||
TARGET_LINK_LIBRARIES(neuware_lib ${CNNL_LIB} ${CNRT_LIB} ${CNDRV_LIB}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.