Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
edf69ae0
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
edf69ae0
编写于
6月 13, 2022
作者:
R
Ruibiao Chen
提交者:
GitHub
6月 13, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix cmakelint errors for some files (#43428)
上级
97af8516
变更
30
隐藏空白更改
内联
并排
Showing
30 changed file
with
100 addition
and
141 deletion
+100
-141
.pre-commit-config.yaml
.pre-commit-config.yaml
+1
-46
cmake/ccache.cmake
cmake/ccache.cmake
+2
-2
cmake/coverallsGcovJsons.cmake
cmake/coverallsGcovJsons.cmake
+7
-7
cmake/cudnn.cmake
cmake/cudnn.cmake
+5
-5
cmake/external/cryptopp.cmake
cmake/external/cryptopp.cmake
+2
-2
cmake/external/gflags.cmake
cmake/external/gflags.cmake
+4
-4
cmake/external/gtest.cmake
cmake/external/gtest.cmake
+2
-2
cmake/external/mkldnn.cmake
cmake/external/mkldnn.cmake
+3
-3
cmake/external/utf8proc.cmake
cmake/external/utf8proc.cmake
+2
-2
cmake/external/warpctc.cmake
cmake/external/warpctc.cmake
+2
-2
cmake/external/zlib.cmake
cmake/external/zlib.cmake
+2
-2
cmake/generic.cmake
cmake/generic.cmake
+8
-4
cmake/system.cmake
cmake/system.cmake
+7
-7
cmake/third_party.cmake
cmake/third_party.cmake
+12
-12
cmake/unity_build.cmake
cmake/unity_build.cmake
+3
-3
paddle/fluid/distributed/CMakeLists.txt
paddle/fluid/distributed/CMakeLists.txt
+2
-2
paddle/fluid/eager/auto_code_generator/CMakeLists.txt
paddle/fluid/eager/auto_code_generator/CMakeLists.txt
+1
-1
paddle/fluid/framework/CMakeLists.txt
paddle/fluid/framework/CMakeLists.txt
+7
-7
paddle/fluid/framework/io/CMakeLists.txt
paddle/fluid/framework/io/CMakeLists.txt
+1
-1
paddle/fluid/framework/ir/CMakeLists.txt
paddle/fluid/framework/ir/CMakeLists.txt
+1
-1
paddle/fluid/imperative/CMakeLists.txt
paddle/fluid/imperative/CMakeLists.txt
+1
-1
paddle/fluid/imperative/tests/CMakeLists.txt
paddle/fluid/imperative/tests/CMakeLists.txt
+1
-1
paddle/fluid/operators/ipu/CMakeLists.txt
paddle/fluid/operators/ipu/CMakeLists.txt
+1
-1
paddle/fluid/platform/CMakeLists.txt
paddle/fluid/platform/CMakeLists.txt
+3
-3
paddle/fluid/platform/dynload/CMakeLists.txt
paddle/fluid/platform/dynload/CMakeLists.txt
+1
-1
paddle/fluid/pybind/CMakeLists.txt
paddle/fluid/pybind/CMakeLists.txt
+12
-12
paddle/phi/backends/dynload/CMakeLists.txt
paddle/phi/backends/dynload/CMakeLists.txt
+1
-1
paddle/phi/tests/core/CMakeLists.txt
paddle/phi/tests/core/CMakeLists.txt
+1
-1
python/CMakeLists.txt
python/CMakeLists.txt
+1
-1
python/paddle/fluid/tests/unittests/mlu/CMakeLists.txt
python/paddle/fluid/tests/unittests/mlu/CMakeLists.txt
+4
-4
未找到文件。
.pre-commit-config.yaml
浏览文件 @
edf69ae0
...
...
@@ -84,63 +84,33 @@ repos:
exclude
:
|
(?x)^(
CMakeLists.txt|
paddle/fluid/pybind/CMakeLists.txt|
python/paddle/fluid/tests/unittests/CMakeLists.txt|
paddle/fluid/eager/auto_code_generator/CMakeLists.txt|
paddle/fluid/framework/CMakeLists.txt|
paddle/fluid/eager/auto_code_generator/final_state_generator/CMakeLists.txt|
cmake/third_party.cmake|
python/paddle/fluid/tests/unittests/CMakeLists.txt|
paddle/fluid/inference/tests/infer_ut/CMakeLists.txt|
cmake/configure.cmake|
paddle/fluid/inference/api/demo_ci/CMakeLists.txt|
cmake/flags.cmake|
cmake/inference_lib.cmake|
cmake/external/protobuf.cmake|
cmake/system.cmake|
cmake/cudnn.cmake|
cmake/external/mkldnn.cmake|
cmake/unity_build.cmake|
paddle/fluid/framework/fleet/CMakeLists.txt|
paddle/fluid/inference/CMakeLists.txt|
paddle/fluid/inference/tests/api/CMakeLists.txt|
paddle/fluid/operators/CMakeLists.txt|
paddle/phi/api/lib/CMakeLists.txt|
cmake/external/gflags.cmake|
cmake/external/lite.cmake|
cmake/external/poplar.cmake|
cmake/python_module.cmake|
python/paddle/fluid/tests/unittests/asp/CMakeLists.txt|
cmake/cuda.cmake|
cmake/FindNumPy.cmake|
cmake/phi.cmake|
paddle/fluid/framework/ir/CMakeLists.txt|
paddle/fluid/platform/CMakeLists.txt|
python/paddle/fluid/tests/unittests/mlu/CMakeLists.txt|
python/paddle/tests/CMakeLists.txt|
cmake/ccache.cmake|
cmake/coveralls.cmake|
cmake/external/glog.cmake|
cmake/external/onnxruntime.cmake|
cmake/external/openblas.cmake|
cmake/external/xpu.cmake|
cmake/hip.cmake|
paddle/fluid/distributed/CMakeLists.txt|
paddle/fluid/framework/details/CMakeLists.txt|
paddle/fluid/imperative/CMakeLists.txt|
paddle/fluid/inference/analysis/ir_passes/CMakeLists.txt|
paddle/fluid/inference/api/CMakeLists.txt|
paddle/fluid/operators/controlflow/CMakeLists.txt|
python/paddle/fluid/tests/unittests/distributed_passes/CMakeLists.txt|
cmake/cblas.cmake|
cmake/coverallsGcovJsons.cmake|
cmake/external/brpc.cmake|
cmake/external/cryptopp.cmake|
cmake/external/gtest.cmake|
cmake/external/llvm.cmake|
cmake/external/utf8proc.cmake|
cmake/external/warpctc.cmake|
cmake/external/zlib.cmake|
cmake/FindGperftools.cmake|
cmake/operators.cmake|
cmake/tensorrt.cmake|
paddle/fluid/inference/api/details/CMakeLists.txt|
...
...
@@ -153,28 +123,13 @@ repos:
cmake/miopen.cmake|
cmake/nccl.cmake|
cmake/simd.cmake|
paddle/fluid/distributed/fleet_executor/CMakeLists.txt|
paddle/fluid/eager/api/generated/fluid_generated/forwards/CMakeLists.txt|
paddle/fluid/framework/io/CMakeLists.txt|
paddle/fluid/imperative/tests/CMakeLists.txt|
paddle/fluid/inference/analysis/CMakeLists.txt|
paddle/fluid/inference/tests/infer_ut/external-cmake/gtest-cpp.cmake|
paddle/fluid/memory/allocation/CMakeLists.txt|
paddle/fluid/memory/CMakeLists.txt|
paddle/fluid/operators/cinn/CMakeLists.txt|
paddle/fluid/operators/collective/CMakeLists.txt|
paddle/fluid/operators/ipu/CMakeLists.txt|
paddle/fluid/operators/jit/CMakeLists.txt|
paddle/fluid/operators/pscore/CMakeLists.txt|
paddle/fluid/platform/device/ipu/CMakeLists.txt|
paddle/fluid/platform/dynload/CMakeLists.txt|
paddle/infrt/external_kernels/CMakeLists.txt|
paddle/infrt/kernel/phi/CMakeLists.txt|
paddle/phi/backends/dynload/CMakeLists.txt|
paddle/phi/CMakeLists.txt|
paddle/phi/kernels/CMakeLists.txt|
paddle/phi/tests/core/CMakeLists.txt|
python/CMakeLists.txt|
python/paddle/fluid/contrib/slim/tests/CMakeLists.txt|
python/paddle/fluid/tests/unittests/autograd/CMakeLists.txt|
python/paddle/fluid/tests/unittests/distribution/CMakeLists.txt|
...
...
cmake/ccache.cmake
浏览文件 @
edf69ae0
...
...
@@ -13,7 +13,7 @@ if(NOT WIN32)
${
cache_directory
}
)
set_property
(
GLOBAL PROPERTY RULE_LAUNCH_COMPILE
${
CCACHE_PATH
}
)
set_property
(
GLOBAL PROPERTY RULE_LAUNCH_LINK
${
CCACHE_PATH
}
)
endif
(
CCACHE_PATH
)
endif
()
elseif
(
"
${
CMAKE_GENERATOR
}
"
STREQUAL
"Ninja"
)
# (Note:zhouwei25) Only Ninja Generator can support sccache now
find_program
(
SCCACHE_PATH sccache
)
...
...
@@ -30,5 +30,5 @@ elseif("${CMAKE_GENERATOR}" STREQUAL "Ninja")
# (Note:zhouwei25) sccache for cuda compiler has bug so that it can't be hit
# refer to https://github.com/mozilla/sccache/issues/1017, so we fix it
set
(
CMAKE_CUDA_COMPILER_LAUNCHER
${
SCCACHE_PATH
}
)
endif
(
SCCACHE_PATH
)
endif
()
endif
()
cmake/coverallsGcovJsons.cmake
浏览文件 @
edf69ae0
...
...
@@ -141,9 +141,9 @@ file(GLOB_RECURSE ALL_GCOV_FILES "${COV_PATH}" "*.gcov")
# Get only the filenames to use for filtering.
#set(COVERAGE_SRCS_NAMES "")
#foreach (COVSRC ${COVERAGE_SRCS})
#
get_filename_component(COVSRC_NAME ${COVSRC} NAME)
#
message("${COVSRC} -> ${COVSRC_NAME}")
#
list(APPEND COVERAGE_SRCS_NAMES "${COVSRC_NAME}")
#
get_filename_component(COVSRC_NAME ${COVSRC} NAME)
#
message("${COVSRC} -> ${COVSRC_NAME}")
#
list(APPEND COVERAGE_SRCS_NAMES "${COVSRC_NAME}")
#endforeach()
#
...
...
@@ -155,15 +155,15 @@ file(GLOB_RECURSE ALL_GCOV_FILES "${COV_PATH}" "*.gcov")
#
# Example:
# COVERAGE_SRCS =
#
/path/to/project/root/subdir/the_file.c
#
/path/to/project/root/subdir/the_file.c
#
# ALL_GCOV_FILES =
#
/path/to/project/root/build/#path#to#project#root#subdir#the_file.c.gcov
#
/path/to/project/root/build/#path#to#project#root#subdir#other_file.c.gcov
#
/path/to/project/root/build/#path#to#project#root#subdir#the_file.c.gcov
#
/path/to/project/root/build/#path#to#project#root#subdir#other_file.c.gcov
#
# Result should be:
# GCOV_FILES =
#
/path/to/project/root/build/#path#to#project#root#subdir#the_file.c.gcov
#
/path/to/project/root/build/#path#to#project#root#subdir#the_file.c.gcov
#
set
(
GCOV_FILES
""
)
#message("Look in coverage sources: ${COVERAGE_SRCS}")
...
...
cmake/cudnn.cmake
浏览文件 @
edf69ae0
...
...
@@ -4,11 +4,11 @@ endif()
if
(
WIN32
)
set
(
CUDNN_ROOT
${
CUDA_TOOLKIT_ROOT_DIR
}
)
else
(
WIN32
)
else
()
set
(
CUDNN_ROOT
"/usr"
CACHE PATH
"CUDNN ROOT"
)
endif
(
WIN32
)
endif
()
find_path
(
CUDNN_INCLUDE_DIR cudnn.h
...
...
@@ -41,16 +41,16 @@ set(CUDNN_LIB_NAME "")
if
(
LINUX
)
set
(
CUDNN_LIB_NAME
"libcudnn.so"
)
endif
(
LINUX
)
endif
()
if
(
WIN32
)
# only support cudnn7
set
(
CUDNN_LIB_NAME
"cudnn.lib"
"cudnn64_7.dll"
)
endif
(
WIN32
)
endif
()
if
(
APPLE
)
set
(
CUDNN_LIB_NAME
"libcudnn.dylib"
"libcudnn.so"
)
endif
(
APPLE
)
endif
()
find_library
(
CUDNN_LIBRARY
...
...
cmake/external/cryptopp.cmake
浏览文件 @
edf69ae0
...
...
@@ -35,11 +35,11 @@ if(WIN32)
${
CMAKE_COMMAND
}
-E copy_if_different
"
${
PADDLE_SOURCE_DIR
}
/patches/cryptopp/CMakeLists.txt"
"<SOURCE_DIR>/"
)
endif
()
else
(
WIN32
)
else
()
set
(
CRYPTOPP_LIBRARIES
"
${
CRYPTOPP_INSTALL_DIR
}
/lib/libcryptopp.a"
CACHE FILEPATH
"cryptopp library."
FORCE
)
endif
(
WIN32
)
endif
()
if
(
APPLE AND WITH_ARM
)
set
(
CMAKE_CXX_FLAGS
"-DCRYPTOPP_ARM_CRC32_AVAILABLE=0"
)
...
...
cmake/external/gflags.cmake
浏览文件 @
edf69ae0
...
...
@@ -25,13 +25,13 @@ if(WIN32)
set
(
GFLAGS_LIBRARIES
"
${
GFLAGS_INSTALL_DIR
}
/lib/gflags_static.lib"
CACHE FILEPATH
"GFLAGS_LIBRARIES"
FORCE
)
else
(
WIN32
)
else
()
set
(
GFLAGS_LIBRARIES
"
${
GFLAGS_INSTALL_DIR
}
/lib/libgflags.a"
CACHE FILEPATH
"GFLAGS_LIBRARIES"
FORCE
)
set
(
BUILD_COMMAND $
(
MAKE
)
--silent
)
set
(
INSTALL_COMMAND $
(
MAKE
)
install
)
endif
(
WIN32
)
endif
()
include_directories
(
${
GFLAGS_INCLUDE_DIR
}
)
...
...
@@ -101,5 +101,5 @@ if(WIN32)
check_include_file_cxx
(
"shlwapi.h"
HAVE_SHLWAPI
)
if
(
HAVE_SHLWAPI
)
set_property
(
GLOBAL PROPERTY OS_DEPENDENCY_MODULES shlwapi.lib
)
endif
(
HAVE_SHLWAPI
)
endif
(
WIN32
)
endif
()
endif
()
cmake/external/gtest.cmake
浏览文件 @
edf69ae0
...
...
@@ -42,7 +42,7 @@ if(WIN32)
string
(
REPLACE
"/w "
""
GTEST_CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
"
)
string
(
REPLACE
"/W0 "
""
GTEST_CMAKE_C_FLAGS
"
${
GTEST_CMAKE_C_FLAGS
}
"
)
string
(
REPLACE
"/W0 "
""
GTEST_CMAKE_CXX_FLAGS
"
${
GTEST_CMAKE_CXX_FLAGS
}
"
)
else
(
WIN32
)
else
()
set
(
GTEST_LIBRARIES
"
${
GTEST_INSTALL_DIR
}
/
${
CMAKE_INSTALL_LIBDIR
}
/libgtest.a"
CACHE FILEPATH
"gtest libraries."
FORCE
)
...
...
@@ -51,7 +51,7 @@ else(WIN32)
CACHE FILEPATH
"gtest main libraries."
FORCE
)
set
(
GTEST_CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
"
)
set
(
GTEST_CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
"
)
endif
(
WIN32
)
endif
()
if
(
WITH_MKLML
)
# wait for mklml downloading completed
...
...
cmake/external/mkldnn.cmake
浏览文件 @
edf69ae0
...
...
@@ -59,7 +59,7 @@ else()
set
(
MKLDNN_LIB
"
${
MKLDNN_INSTALL_DIR
}
/bin/mkldnn.lib"
CACHE FILEPATH
"mkldnn library."
FORCE
)
endif
(
NOT WIN32
)
endif
()
ExternalProject_Add
(
${
MKLDNN_PROJECT
}
...
...
@@ -121,7 +121,7 @@ if(WIN32)
DEPENDS
${
MKLDNN_PROJECT
}
VERBATIM
)
add_custom_target
(
mkldnn_cmd ALL DEPENDS
${
MKLDNN_LIB
}
)
else
(
WIN32
)
else
()
set
(
MKLDNN_SHARED_LIB
${
MKLDNN_INSTALL_DIR
}
/libmkldnn.so.0
)
set
(
MKLDNN_SHARED_LIB_1
${
MKLDNN_INSTALL_DIR
}
/libdnnl.so.1
)
set
(
MKLDNN_SHARED_LIB_2
${
MKLDNN_INSTALL_DIR
}
/libdnnl.so.2
)
...
...
@@ -132,7 +132,7 @@ else(WIN32)
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
MKLDNN_LIB
}
${
MKLDNN_SHARED_LIB_2
}
DEPENDS
${
MKLDNN_PROJECT
}
)
add_custom_target
(
mkldnn_cmd ALL DEPENDS
${
MKLDNN_SHARED_LIB_2
}
)
endif
(
WIN32
)
endif
()
# generate a static dummy target to track mkldnn dependencies
# for cc_library(xxx SRCS xxx.c DEPS mkldnn)
...
...
cmake/external/utf8proc.cmake
浏览文件 @
edf69ae0
...
...
@@ -23,9 +23,9 @@ set(UTF8PROC_TAG v2.6.1)
if
(
WIN32
)
set
(
UTF8PROC_LIBRARIES
"
${
UTF8PROC_INSTALL_DIR
}
/lib/utf8proc_static.lib"
)
add_definitions
(
-DUTF8PROC_STATIC
)
else
(
WIN32
)
else
()
set
(
UTF8PROC_LIBRARIES
"
${
UTF8PROC_INSTALL_DIR
}
/lib/libutf8proc.a"
)
endif
(
WIN32
)
endif
()
include_directories
(
${
UTF8PROC_INSTALL_DIR
}
/include
)
...
...
cmake/external/warpctc.cmake
浏览文件 @
edf69ae0
...
...
@@ -37,11 +37,11 @@ if(WIN32)
set
(
WARPCTC_LIBRARIES
"
${
WARPCTC_INSTALL_DIR
}
/bin/warpctc
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
"
CACHE FILEPATH
"Warp-ctc Library"
FORCE
)
else
(
WIN32
)
else
()
set
(
WARPCTC_LIBRARIES
"
${
WARPCTC_INSTALL_DIR
}
/lib/libwarpctc
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
"
CACHE FILEPATH
"Warp-ctc Library"
FORCE
)
endif
(
WIN32
)
endif
()
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"Clang"
OR CMAKE_CXX_COMPILER_ID STREQUAL
"AppleClang"
...
...
cmake/external/zlib.cmake
浏览文件 @
edf69ae0
...
...
@@ -34,11 +34,11 @@ if(WIN32)
set
(
ZLIB_LIBRARIES
"
${
ZLIB_INSTALL_DIR
}
/lib/zlibstatic.lib"
CACHE FILEPATH
"zlib library."
FORCE
)
else
(
WIN32
)
else
()
set
(
ZLIB_LIBRARIES
"
${
ZLIB_INSTALL_DIR
}
/lib/libz.a"
CACHE FILEPATH
"zlib library."
FORCE
)
endif
(
WIN32
)
endif
()
ExternalProject_Add
(
extern_zlib
...
...
cmake/generic.cmake
浏览文件 @
edf69ae0
...
...
@@ -305,8 +305,8 @@ endfunction()
function
(
check_coverage_opt TARGET_NAME SRCS
)
if
(
WITH_COVERAGE AND WITH_INCREMENTAL_COVERAGE
)
# if pybind.cc add '-g -O0 -fprofile-arcs -ftest-coverage' only, some testcase will fail.
if
(
(
NOT
(
"$ENV{PADDLE_GIT_DIFF_CC_FILE}"
MATCHES
"pybind.cc"
))
AND
"$ENV{PADDLE_GIT_DIFF_H_FILE}"
STREQUAL
""
)
if
(
"$ENV{PADDLE_GIT_DIFF_H_FILE}"
STREQUAL
""
AND
(
NOT
(
"$ENV{PADDLE_GIT_DIFF_CC_FILE}"
MATCHES
"pybind.cc"
))
)
if
(
NOT
(
"$ENV{PADDLE_GIT_DIFF_CC_FILE}"
STREQUAL
""
))
string
(
REPLACE
","
";"
CC_FILE_LIST $ENV{PADDLE_GIT_DIFF_CC_FILE}
)
set
(
use_coverage_opt FALSE
)
...
...
@@ -779,8 +779,12 @@ function(hip_test TARGET_NAME)
FLAGS_init_allocated_mem=true
)
set_property
(
TEST
${
TARGET_NAME
}
PROPERTY ENVIRONMENT
FLAGS_cudnn_deterministic=true
)
set_property
(
TEST
${
TARGET_NAME
}
PROPERTY ENVIRONMENT
"LD_LIBRARY_PATH=\
${
CMAKE_BINARY_DIR
}
/python/paddle/libs:$LD_LIBRARY_PATH"
)
set_property
(
TEST
${
TARGET_NAME
}
PROPERTY
ENVIRONMENT
"LD_LIBRARY_PATH=
${
CMAKE_BINARY_DIR
}
/python/paddle/libs:$LD_LIBRARY_PATH"
)
endif
()
endfunction
()
...
...
cmake/system.cmake
浏览文件 @
edf69ae0
...
...
@@ -23,11 +23,11 @@
if
(
UNIX AND NOT APPLE
)
# except apple from nix*Os family
set
(
LINUX TRUE
)
endif
(
UNIX AND NOT APPLE
)
endif
()
if
(
WIN32
)
set
(
HOST_SYSTEM
"win32"
)
else
(
WIN32
)
else
()
if
(
APPLE
)
set
(
HOST_SYSTEM
"macosx"
)
exec_program
(
...
...
@@ -45,7 +45,7 @@ else(WIN32)
)
endif
()
set
(
CMAKE_EXE_LINKER_FLAGS
"-framework CoreFoundation -framework Security"
)
else
(
APPLE
)
else
()
if
(
EXISTS
"/etc/issue"
)
file
(
READ
"/etc/issue"
LINUX_ISSUE
)
...
...
@@ -63,21 +63,21 @@ else(WIN32)
string
(
REGEX MATCH
"(([0-9]+)
\\
.)+([0-9]+)"
HOST_SYSTEM_VERSION
"
${
LINUX_ISSUE
}
"
)
endif
(
EXISTS
"/etc/issue"
)
endif
()
if
(
EXISTS
"/etc/redhat-release"
)
file
(
READ
"/etc/redhat-release"
LINUX_ISSUE
)
if
(
LINUX_ISSUE MATCHES
"CentOS"
)
set
(
HOST_SYSTEM
"centos"
)
endif
()
endif
(
EXISTS
"/etc/redhat-release"
)
endif
()
if
(
NOT HOST_SYSTEM
)
set
(
HOST_SYSTEM
${
CMAKE_SYSTEM_NAME
}
)
endif
()
endif
(
APPLE
)
endif
(
WIN32
)
endif
()
endif
()
# query number of logical cores
cmake_host_system_information
(
RESULT CPU_CORES QUERY NUMBER_OF_LOGICAL_CORES
)
...
...
cmake/third_party.cmake
浏览文件 @
edf69ae0
...
...
@@ -356,17 +356,17 @@ if(WITH_GPU)
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
SRC_DIR
}
${
DST_DIR2
}
COMMENT
"copy_directory from
${
SRC_DIR
}
to
${
DST_DIR
}
"
)
endif
()
endif
(
WITH_GPU
)
endif
()
if
(
WITH_XPU
)
include
(
external/xpu
)
# download, build, install xpu
list
(
APPEND third_party_deps extern_xpu
)
endif
(
WITH_XPU
)
endif
()
if
(
WITH_MLU
)
include
(
external/concurrentqueue
)
# download, build, install concurrentqueue
list
(
APPEND third_party_deps extern_concurrentqueue
)
endif
(
WITH_MLU
)
endif
()
if
(
WITH_PSLIB
)
include
(
external/pslib
)
# download, build, install pslib
...
...
@@ -389,7 +389,7 @@ if(WITH_PSLIB)
list
(
APPEND third_party_deps extern_brpc
)
endif
()
endif
()
endif
(
WITH_PSLIB
)
endif
()
if
(
NOT WIN32 AND NOT APPLE
)
include
(
external/gloo
)
...
...
@@ -399,7 +399,7 @@ endif()
if
(
WITH_BOX_PS
)
include
(
external/box_ps
)
list
(
APPEND third_party_deps extern_box_ps
)
endif
(
WITH_BOX_PS
)
endif
()
if
(
WITH_ASCEND OR WITH_ASCEND_CL
)
include
(
external/ascend
)
...
...
@@ -453,7 +453,7 @@ endif()
if
(
WITH_LITE
)
message
(
STATUS
"Compile Paddle with Lite Engine."
)
include
(
external/lite
)
endif
(
WITH_LITE
)
endif
()
if
(
WITH_CINN
)
message
(
STATUS
"Compile Paddle with CINN."
)
...
...
@@ -462,29 +462,29 @@ if(WITH_CINN)
if
(
WITH_GPU
)
add_definitions
(
-DCINN_WITH_CUDA
)
add_definitions
(
-DCINN_WITH_CUDNN
)
endif
(
WITH_GPU
)
endif
()
if
(
WITH_MKL
)
add_definitions
(
-DCINN_WITH_MKL_CBLAS
)
add_definitions
(
-DCINN_WITH_MKLDNN
)
endif
(
WITH_MKL
)
endif
(
WITH_CINN
)
endif
()
endif
()
if
(
WITH_CRYPTO
)
include
(
external/cryptopp
)
# download, build, install cryptopp
list
(
APPEND third_party_deps extern_cryptopp
)
add_definitions
(
-DPADDLE_WITH_CRYPTO
)
endif
(
WITH_CRYPTO
)
endif
()
if
(
WITH_POCKETFFT
)
include
(
external/pocketfft
)
list
(
APPEND third_party_deps extern_pocketfft
)
add_definitions
(
-DPADDLE_WITH_POCKETFFT
)
endif
(
WITH_POCKETFFT
)
endif
()
if
(
WIN32
)
include
(
external/dirent
)
list
(
APPEND third_party_deps extern_dirent
)
endif
(
WIN32
)
endif
()
if
(
WITH_INFRT
)
include
(
external/llvm
)
...
...
cmake/unity_build.cmake
浏览文件 @
edf69ae0
...
...
@@ -67,7 +67,7 @@ function(register_unity_group TYPE)
math
(
EXPR unity_group_index
"
${
unity_group_index
}
+ 1"
)
set_property
(
GLOBAL PROPERTY
${
UNITY_TARGET
}
_
${
TYPE
}
_group_index
${
unity_group_index
}
)
endfunction
(
register_unity_group
)
endfunction
()
# Combine the original source files used by `TARGET`, then use
# `unity_target_${TYPE}_sources` to get the combined source files.
...
...
@@ -145,7 +145,7 @@ function(compose_unity_target_sources TARGET TYPE)
set
(
unity_target_
${
TYPE
}
_sources
${
unity_target_sources
}
PARENT_SCOPE
)
endfunction
(
compose_unity_target_sources
)
endfunction
()
# Write the unity files used by `UNITY_TARGET`.
# Write dependent on whether the contents of the unity file have changed, which
...
...
@@ -179,4 +179,4 @@ function(finish_unity_target TYPE)
endif
()
endforeach
()
endif
()
endfunction
(
finish_unity_target
)
endfunction
()
paddle/fluid/distributed/CMakeLists.txt
浏览文件 @
edf69ae0
...
...
@@ -13,7 +13,7 @@ if(WITH_PYTHON)
POST_BUILD
COMMAND mv the_one_ps_pb2.py
${
PADDLE_BINARY_DIR
}
/python/paddle/distributed/fleet/proto/
)
else
(
NOT WIN32
)
else
()
string
(
REPLACE
"/"
"
\\
"
fleet_proto_dstpath
"
${
PADDLE_BINARY_DIR
}
/python/paddle/distributed/fleet/proto/"
)
...
...
@@ -24,7 +24,7 @@ if(WITH_PYTHON)
COMMENT
"Copy generated python the_one_ps_pb2 into directory
${
fleet_proto_dstpath
}
."
)
endif
(
NOT WIN32
)
endif
()
endif
()
if
(
NOT WITH_PSCORE
)
...
...
paddle/fluid/eager/auto_code_generator/CMakeLists.txt
浏览文件 @
edf69ae0
...
...
@@ -73,7 +73,7 @@ if(WIN32)
${
eager_generator_path
}
DEPENDS mklml
)
list
(
APPEND EAGER_CODEGEN_DEPS
${
eager_generator_path
}
/libiomp5md.dll
)
else
(
${
CBLAS_PROVIDER
}
STREQUAL EXTERN_OPENBLAS
)
else
()
message
(
"Copied openblas.dll for Eager AutoCodeGen"
)
add_custom_command
(
OUTPUT
${
eager_generator_path
}
/openblas.dll
...
...
paddle/fluid/framework/CMakeLists.txt
浏览文件 @
edf69ae0
...
...
@@ -57,7 +57,7 @@ foreach(OP_DEF_FILE ${OP_DEF_FILES})
get_filename_component
(
OP_NAME
${
OP_DEF_FILE
}
NAME_WE
)
file
(
APPEND
${
CMAKE_CURRENT_BINARY_DIR
}
/op_def.pbtxt
"{
\"
${
OP_NAME
}
\"
,R
\"
(
${
OP_DEF_CONTENT
}
)
\"
},
\n
"
)
endforeach
(
OP_DEF_FILE
)
endforeach
()
file
(
APPEND
${
CMAKE_CURRENT_BINARY_DIR
}
/op_def.pbtxt
"{
\"\"
,
\"\"
}};
\n
}"
)
proto_library
(
heter_service_proto SRCS heter_service.proto
)
...
...
@@ -91,7 +91,7 @@ if(WITH_GPU)
tensor
SRCS tensor.cc tensor_util.cu
DEPS place memory data_type device_context profiler dense_tensor
)
endif
(
WIN32
)
endif
()
elseif
(
WITH_ROCM
)
hip_library
(
tensor
...
...
@@ -284,7 +284,7 @@ if(WITH_GPU)
data_type_transform
SRCS data_type_transform.cu
DEPS tensor
)
endif
(
WIN32
)
endif
()
nv_test
(
data_type_transform_test
SRCS data_type_transform_test.cc data_type_transform_test.cu
...
...
@@ -575,7 +575,7 @@ if(WITH_PYTHON)
COMMENT
"Copy generated python proto into directory paddle/distributed/fleet/proto."
)
else
(
NOT WIN32
)
else
()
string
(
REPLACE
"/"
"
\\
"
proto_dstpath
"
${
PADDLE_BINARY_DIR
}
/python/paddle/fluid/proto/"
)
string
(
...
...
@@ -592,7 +592,7 @@ if(WITH_PYTHON)
COMMENT
"Copy generated python proto into directory paddle/distributed/fleet/proto."
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
endif
(
NOT WIN32
)
endif
()
endif
()
if
(
WITH_PSCORE
)
...
...
@@ -606,7 +606,7 @@ if(WITH_PSCORE)
COMMENT
"Copy generated python proto into directory paddle/distributed/fleet/proto."
)
endif
(
WITH_PSCORE
)
endif
()
cc_library
(
lod_rank_table
...
...
@@ -651,7 +651,7 @@ else()
feed_fetch_method
graph_to_program_pass
variable_helper
)
endif
(
TENSORRT_FOUND
)
endif
()
cc_library
(
executor_gc_helper
...
...
paddle/fluid/framework/io/CMakeLists.txt
浏览文件 @
edf69ae0
...
...
@@ -13,4 +13,4 @@ cc_test(
DEPS fs shell
)
if
(
WITH_CRYPTO
)
add_subdirectory
(
crypto
)
endif
(
WITH_CRYPTO
)
endif
()
paddle/fluid/framework/ir/CMakeLists.txt
浏览文件 @
edf69ae0
...
...
@@ -84,7 +84,7 @@ cc_library(
set
(
GRAPH_PATTERN_DETECTOR_DEPS graph graph_helper graph_traits
)
if
(
WITH_TESTING
)
set
(
GRAPH_PATTERN_DETECTOR_DEPS
${
GRAPH_PATTERN_DETECTOR_DEPS
}
gtest
)
endif
(
WITH_TESTING
)
endif
()
cc_library
(
graph_pattern_detector
SRCS graph_pattern_detector.cc
...
...
paddle/fluid/imperative/CMakeLists.txt
浏览文件 @
edf69ae0
...
...
@@ -156,7 +156,7 @@ if(NOT WIN32)
data_loader
SRCS data_loader.cc
DEPS enforce
)
endif
(
NOT WIN32
)
endif
()
if
(
WITH_GLOO
)
cc_library
(
imperative_gloo_context
...
...
paddle/fluid/imperative/tests/CMakeLists.txt
浏览文件 @
edf69ae0
...
...
@@ -34,7 +34,7 @@ else()
SRCS cncl_context_test.cc
DEPS cncl_context
)
endif
()
endif
(
WIN32
)
endif
()
cc_test
(
test_gradient_accmulator
...
...
paddle/fluid/operators/ipu/CMakeLists.txt
浏览文件 @
edf69ae0
if
(
WITH_IPU
)
op_library
(
ipu_runtime_op DEPS ipu_backend
)
endif
(
WITH_IPU
)
endif
()
paddle/fluid/platform/CMakeLists.txt
浏览文件 @
edf69ae0
...
...
@@ -2,7 +2,7 @@ proto_library(profiler_proto SRCS profiler.proto DEPS framework_proto
simple_threadpool
)
if
(
WITH_GPU
)
proto_library
(
external_error_proto SRCS external_error.proto
)
endif
(
WITH_GPU
)
endif
()
if
(
WITH_PYTHON
)
py_proto_compile
(
profiler_py_proto SRCS profiler.proto
)
add_custom_target
(
profiler_py_proto_init ALL COMMAND
${
CMAKE_COMMAND
}
-E
...
...
@@ -19,7 +19,7 @@ if(WITH_PYTHON)
COMMENT
"Copy generated python proto into directory paddle/fluid/proto/profiler."
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
else
(
NOT WIN32
)
else
()
string
(
REPLACE
"/"
"
\\
"
proto_dstpath
"
${
PADDLE_BINARY_DIR
}
/python/paddle/fluid/proto/profiler/"
)
add_custom_command
(
...
...
@@ -31,7 +31,7 @@ if(WITH_PYTHON)
COMMENT
"Copy generated python proto into directory paddle/fluid/proto/profiler."
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
endif
(
NOT WIN32
)
endif
()
endif
()
cc_library
(
...
...
paddle/fluid/platform/dynload/CMakeLists.txt
浏览文件 @
edf69ae0
...
...
@@ -49,7 +49,7 @@ endif()
configure_file
(
cupti_lib_path.h.in
${
CMAKE_CURRENT_BINARY_DIR
}
/cupti_lib_path.h
)
if
(
CUPTI_FOUND
)
list
(
APPEND CUDA_SRCS cupti.cc
)
endif
(
CUPTI_FOUND
)
endif
()
if
(
WITH_ROCM
)
hip_library
(
dynload_cuda
...
...
paddle/fluid/pybind/CMakeLists.txt
浏览文件 @
edf69ae0
...
...
@@ -91,7 +91,7 @@ if(NOT WIN32)
set
(
PYBIND_DEPS
${
PYBIND_DEPS
}
nccl_context
)
set
(
PYBIND_DEPS
${
PYBIND_DEPS
}
heter_ccl_context
)
endif
()
endif
(
NOT WIN32
)
endif
()
if
(
WITH_PYTHON
)
list
(
APPEND PYBIND_DEPS py_func_op
)
...
...
@@ -153,12 +153,12 @@ if(WITH_GLOO)
set
(
PYBIND_SRCS
${
PYBIND_SRCS
}
gloo_context_py.cc
)
set
(
PYBIND_DEPS
${
PYBIND_DEPS
}
imperative_gloo_context
)
set
(
PYBIND_DEPS
${
PYBIND_DEPS
}
reducer
)
endif
(
WITH_GLOO
)
endif
()
if
(
WITH_CRYPTO
)
set
(
PYBIND_DEPS
${
PYBIND_DEPS
}
paddle_crypto
)
set
(
PYBIND_SRCS
${
PYBIND_SRCS
}
crypto.cc
)
endif
(
WITH_CRYPTO
)
endif
()
if
(
WITH_PSLIB
)
set
(
DISTRIBUTE_COMPILE_FLAGS
...
...
@@ -169,7 +169,7 @@ if(WITH_PSLIB)
endif
()
set_source_files_properties
(
heter_wrapper_py.cc PROPERTIES COMPILE_FLAGS
${
DISTRIBUTE_COMPILE_FLAGS
}
)
endif
(
WITH_PSLIB
)
endif
()
if
(
WITH_PSCORE
)
if
(
WITH_ARM_BRPC
)
set
(
DISTRIBUTE_COMPILE_FLAGS
...
...
@@ -223,15 +223,15 @@ if(WITH_PYTHON)
if
(
WITH_XPU_BKCL
)
list
(
APPEND OP_FUNCTION_GENERETOR_DEPS bkcl_context
)
endif
(
WITH_XPU_BKCL
)
endif
()
if
(
WITH_ASCEND_CL
)
list
(
APPEND OP_FUNCTION_GENERETOR_DEPS hccl_context
)
endif
(
WITH_ASCEND_CL
)
endif
()
if
(
WITH_CNCL
)
list
(
APPEND OP_FUNCTION_GENERETOR_DEPS cncl_context
)
endif
(
WITH_CNCL
)
endif
()
add_executable
(
op_function_generator op_function_generator.cc
)
target_link_libraries
(
op_function_generator
${
OP_FUNCTION_GENERETOR_DEPS
}
)
...
...
@@ -316,7 +316,7 @@ if(WITH_PYTHON)
DEPENDS mklml
)
list
(
APPEND OP_IMPL_DEPS
${
op_impl_path
}
/libiomp5md.dll
)
list
(
APPEND EAGER_OP_IMPL_DEPS
${
op_impl_path
}
/libiomp5md.dll
)
else
(
${
CBLAS_PROVIDER
}
STREQUAL EXTERN_OPENBLAS
)
else
()
add_custom_command
(
OUTPUT
${
op_impl_path
}
/openblas.dll
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
OPENBLAS_SHARED_LIB
}
${
op_impl_path
}
...
...
@@ -370,7 +370,7 @@ if(WITH_PYTHON)
COMMENT
"copy_if_different
${
tmp_eager_impl_file
}
to
${
eager_impl_file
}
"
DEPENDS
${
EAGER_OP_IMPL_DEPS
}
)
endif
()
else
(
WIN32
)
else
()
# If there are no *.so in /usr/lib or LD_LIBRARY_PATH,
# copy these *.so to current directory and append current directory to
# LD_LIBRARY_PATH. This is different with Windows platformm, which search
...
...
@@ -446,7 +446,7 @@ if(WITH_PYTHON)
DEPENDS
${
EAGER_OP_IMPL_DEPS
}
VERBATIM
)
endif
()
endif
(
WIN32
)
endif
()
add_custom_target
(
op_function_generator_cmd ALL DEPENDS
${
impl_file
}
)
if
(
NOT
((
NOT WITH_PYTHON
)
AND ON_INFER
))
add_custom_target
(
eager_op_function_generator_cmd ALL
...
...
@@ -495,7 +495,7 @@ if(WITH_PYTHON)
if
(
NOT APPLE AND NOT WIN32
)
target_link_libraries
(
paddle_pybind rt
)
endif
(
NOT APPLE AND NOT WIN32
)
endif
()
if
(
WITH_ROCM
)
target_link_libraries
(
paddle_pybind
${
ROCM_HIPRTC_LIB
}
)
...
...
@@ -504,4 +504,4 @@ if(WITH_PYTHON)
get_property
(
os_dependency_modules GLOBAL PROPERTY OS_DEPENDENCY_MODULES
)
target_link_libraries
(
paddle_pybind
${
os_dependency_modules
}
)
add_dependencies
(
paddle_pybind op_function_generator_cmd
)
endif
(
WITH_PYTHON
)
endif
()
paddle/phi/backends/dynload/CMakeLists.txt
浏览文件 @
edf69ae0
...
...
@@ -49,7 +49,7 @@ endif()
configure_file
(
cupti_lib_path.h.in
${
CMAKE_CURRENT_BINARY_DIR
}
/cupti_lib_path.h
)
if
(
CUPTI_FOUND
)
list
(
APPEND CUDA_SRCS cupti.cc
)
endif
(
CUPTI_FOUND
)
endif
()
if
(
WITH_ROCM
)
hip_library
(
phi_dynload_cuda
...
...
paddle/phi/tests/core/CMakeLists.txt
浏览文件 @
edf69ae0
...
...
@@ -58,7 +58,7 @@ if(WITH_TESTING AND TEST selected_rows_test)
endif
()
if
(
NOT WIN32
)
cc_test
(
test_rw_lock SRCS test_rw_lock.cc
)
endif
(
NOT WIN32
)
endif
()
cc_test
(
test_string_tensor
SRCS test_string_tensor.cc
...
...
python/CMakeLists.txt
浏览文件 @
edf69ae0
...
...
@@ -109,7 +109,7 @@ if(WIN32)
COMMENT
"Packing whl packages------>>>"
DEPENDS copy_paddle_pybind
${
FLUID_CORE
}
framework_py_proto
profiler_py_proto pass_desc_py_proto
${
PY_FILES
}
)
else
(
WIN32
)
else
()
add_custom_command
(
OUTPUT
${
PADDLE_PYTHON_BUILD_DIR
}
/.timestamp
COMMAND touch stub.cc
...
...
python/paddle/fluid/tests/unittests/mlu/CMakeLists.txt
浏览文件 @
edf69ae0
...
...
@@ -12,18 +12,18 @@ string(REPLACE ".py" "" TEST_DIST_OPS "${TEST_DIST_OPS}")
if
(
WITH_MLU
)
foreach
(
TEST_OP
${
TEST_DIST_OPS
}
)
list
(
REMOVE_ITEM TEST_OPS
${
TEST_OP
}
)
endforeach
(
TEST_OP
)
endforeach
()
list
(
REMOVE_ITEM TEST_OPS
"test_spawn_mlu"
)
foreach
(
TEST_OP
${
TEST_OPS
}
)
py_test_modules
(
${
TEST_OP
}
MODULES
${
TEST_OP
}
)
endforeach
(
TEST_OP
)
endforeach
()
if
(
WITH_CNCL
)
list
(
APPEND TEST_DIST_OPS
"test_spawn_mlu"
)
foreach
(
TEST_OP
${
TEST_DIST_OPS
}
)
py_test_modules
(
${
TEST_OP
}
MODULES
${
TEST_OP
}
)
endforeach
(
TEST_OP
)
endforeach
()
bash_test_modules
(
test_launch_async_mlu START_BASH test_launch_async_mlu.sh
ENVS PADDLE_BINARY_DIR=
${
PADDLE_BINARY_DIR
}
)
bash_test_modules
(
test_launch_cloud_mlu START_BASH test_launch_cloud_mlu.sh
...
...
@@ -50,5 +50,5 @@ if(WITH_MLU)
set_tests_properties
(
test_collective_allgather_api_mlu PROPERTIES TIMEOUT
120
)
set_tests_properties
(
test_c_comm_init_op_mlu PROPERTIES TIMEOUT 120
)
endif
(
WITH_CNCL
)
endif
()
endif
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录