Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
d1047d0a
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
d1047d0a
编写于
5月 28, 2020
作者:
Z
Zhou Wei
提交者:
GitHub
5月 28, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add WITH_GPU for cudaerror download (#24056)
上级
9388a638
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
28 addition
and
18 deletion
+28
-18
cmake/inference_lib.cmake
cmake/inference_lib.cmake
+7
-4
cmake/third_party.cmake
cmake/third_party.cmake
+8
-10
paddle/fluid/platform/CMakeLists.txt
paddle/fluid/platform/CMakeLists.txt
+8
-2
paddle/fluid/platform/enforce.h
paddle/fluid/platform/enforce.h
+1
-1
python/setup.py.in
python/setup.py.in
+4
-1
未找到文件。
cmake/inference_lib.cmake
浏览文件 @
d1047d0a
...
...
@@ -135,10 +135,13 @@ copy(inference_lib_dist
SRCS
${
THREADPOOL_INCLUDE_DIR
}
/ThreadPool.h
DSTS
${
dst_dir
}
)
set
(
dst_dir
"
${
FLUID_INFERENCE_INSTALL_DIR
}
/third_party/cudaerror/data"
)
copy
(
inference_lib_dist
SRCS
${
cudaerror_INCLUDE_DIR
}
DSTS
${
dst_dir
}
)
# Only GPU need cudaErrorMessage.pb
IF
(
WITH_GPU
)
set
(
dst_dir
"
${
FLUID_INFERENCE_INSTALL_DIR
}
/third_party/cudaerror/data"
)
copy
(
inference_lib_dist
SRCS
${
cudaerror_INCLUDE_DIR
}
DSTS
${
dst_dir
}
)
ENDIF
()
# CMakeCache Info
copy
(
inference_lib_dist
...
...
cmake/third_party.cmake
浏览文件 @
d1047d0a
...
...
@@ -107,12 +107,11 @@ ENDMACRO()
# 1. URL: The download url of 3rd dependencies
# 2. NAME: The name of file, that determin the dirname
#
MACRO
(
file_download_and_uncompress URL NAME
)
FUNCTION
(
file_download_and_uncompress URL NAME
)
MESSAGE
(
STATUS
"Download dependence[
${
NAME
}
] from
${
URL
}
"
)
SET
(
EXTERNAL_PROJECT_NAME
"extern_download_
${
NAME
}
"
)
SET
(
${
NAME
}
_INCLUDE_DIR
${
THIRD_PARTY_PATH
}
/
${
NAME
}
/data
)
SET
(
${
NAME
}
_INCLUDE_DIR
${
THIRD_PARTY_PATH
}
/
${
NAME
}
/data PARENT_SCOPE
)
ExternalProject_Add
(
${
EXTERNAL_PROJECT_
NAME
}
extern_download_
${
NAME
}
${
EXTERNAL_PROJECT_LOG_ARGS
}
PREFIX
${
THIRD_PARTY_PATH
}
/
${
NAME
}
URL
${
URL
}
...
...
@@ -124,8 +123,8 @@ MACRO(file_download_and_uncompress URL NAME)
UPDATE_COMMAND
""
INSTALL_COMMAND
""
)
list
(
APPEND third_party_deps
${
EXTERNAL_PROJECT_NAME
}
)
END
MACRO
()
set
(
third_party_deps
${
third_party_deps
}
extern_download_
${
NAME
}
PARENT_SCOPE
)
END
FUNCTION
()
# Correction of flags on different Platform(WIN/MAC) and Print Warning Message
...
...
@@ -209,10 +208,6 @@ include(external/warpctc) # download, build, install warpctc
list
(
APPEND third_party_deps extern_eigen3 extern_gflags extern_glog extern_boost extern_xxhash
)
list
(
APPEND third_party_deps extern_zlib extern_dlpack extern_warpctc extern_threadpool
)
# download file
set
(
CUDAERROR_URL
"http://paddlepaddledeps.bj.bcebos.com/cudaErrorMessage.tar.gz"
CACHE STRING
""
FORCE
)
file_download_and_uncompress
(
${
CUDAERROR_URL
}
"cudaerror"
)
if
(
WITH_AMD_GPU
)
include
(
external/rocprim
)
# download, build, install rocprim
list
(
APPEND third_party_deps extern_rocprim
)
...
...
@@ -250,6 +245,9 @@ ENDIF()
if
(
WITH_GPU
)
include
(
external/cub
)
# download cub
list
(
APPEND third_party_deps extern_cub
)
set
(
CUDAERROR_URL
"http://paddlepaddledeps.bj.bcebos.com/cudaErrorMessage.tar.gz"
CACHE STRING
""
FORCE
)
file_download_and_uncompress
(
${
CUDAERROR_URL
}
"cudaerror"
)
# download file cudaErrorMessage
endif
(
WITH_GPU
)
if
(
WITH_PSLIB
)
...
...
paddle/fluid/platform/CMakeLists.txt
浏览文件 @
d1047d0a
proto_library
(
profiler_proto SRCS profiler.proto DEPS framework_proto simple_threadpool
)
proto_library
(
error_codes_proto SRCS error_codes.proto
)
proto_library
(
cuda_error_proto SRCS cuda_error.proto
)
if
(
WITH_GPU
)
proto_library
(
cuda_error_proto SRCS cuda_error.proto
)
endif
(
WITH_GPU
)
if
(
WITH_PYTHON
)
py_proto_compile
(
profiler_py_proto SRCS profiler.proto
)
...
...
@@ -28,7 +30,11 @@ cc_library(flags SRCS flags.cc DEPS gflags)
cc_library
(
errors SRCS errors.cc DEPS error_codes_proto
)
cc_test
(
errors_test SRCS errors_test.cc DEPS errors enforce
)
cc_library
(
enforce INTERFACE SRCS enforce.cc DEPS flags errors cuda_error_proto boost
)
set
(
enforce_deps flags errors boost
)
if
(
WITH_GPU
)
set
(
enforce_deps
${
enforce_deps
}
cuda_error_proto
)
endif
()
cc_library
(
enforce INTERFACE SRCS enforce.cc DEPS
${
enforce_deps
}
)
cc_test
(
enforce_test SRCS enforce_test.cc DEPS stringpiece enforce
)
set
(
CPU_INFO_DEPS gflags glog enforce
)
...
...
paddle/fluid/platform/enforce.h
浏览文件 @
d1047d0a
...
...
@@ -31,6 +31,7 @@ limitations under the License. */
#include <curand.h>
#include <thrust/system/cuda/error.h>
#include <thrust/system_error.h>
#include "paddle/fluid/platform/cuda_error.pb.h"
#endif // PADDLE_WITH_CUDA
#include <fstream>
...
...
@@ -45,7 +46,6 @@ limitations under the License. */
#define GLOG_NO_ABBREVIATED_SEVERITIES // msvc conflict logging with windows.h
#include "glog/logging.h"
#include "paddle/fluid/platform/cuda_error.pb.h"
#include "paddle/fluid/platform/errors.h"
#include "paddle/fluid/platform/macros.h"
#include "paddle/fluid/platform/port.h"
...
...
python/setup.py.in
浏览文件 @
d1047d0a
...
...
@@ -357,6 +357,8 @@ headers = (
if '${WITH_MKLDNN}' == 'ON':
headers += list(find_files('*', '${MKLDNN_INSTALL_DIR}/include')) # mkldnn
if '${WITH_GPU}' == 'ON':
headers += list(find_files('*.pb', '${cudaerror_INCLUDE_DIR}')) # errorMessage.pb for errormessage
class InstallCommand(InstallCommandBase):
def finalize_options(self):
...
...
@@ -416,7 +418,8 @@ class InstallHeaders(Command):
def run(self):
# only copy third_party/cudaErrorMessage.pb for cudaErrorMessage on mac or windows
if os.name == 'nt' or sys.platform == 'darwin':
self.mkdir_and_copy_file('${cudaerror_INCLUDE_DIR}/cudaErrorMessage.pb')
if '${WITH_GPU}' == 'ON':
self.mkdir_and_copy_file('${cudaerror_INCLUDE_DIR}/cudaErrorMessage.pb')
return
hdrs = self.distribution.headers
if not hdrs:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录