Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
cec36ea6
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
cec36ea6
编写于
9月 07, 2021
作者:
A
Aurelius84
提交者:
GitHub
9月 07, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add DPADDLE_WITH_CUDA for GCC (#35448)
* Add DPADDLE_WITH_CUDA for GCC * polish code
上级
f57a2404
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
0 deletion
+10
-0
python/paddle/utils/cpp_extension/cpp_extension.py
python/paddle/utils/cpp_extension/cpp_extension.py
+10
-0
未找到文件。
python/paddle/utils/cpp_extension/cpp_extension.py
浏览文件 @
cec36ea6
...
@@ -355,6 +355,8 @@ class BuildExtension(build_ext, object):
...
@@ -355,6 +355,8 @@ class BuildExtension(build_ext, object):
super
(
BuildExtension
,
self
).
__init__
(
*
args
,
**
kwargs
)
super
(
BuildExtension
,
self
).
__init__
(
*
args
,
**
kwargs
)
self
.
no_python_abi_suffix
=
kwargs
.
get
(
"no_python_abi_suffix"
,
True
)
self
.
no_python_abi_suffix
=
kwargs
.
get
(
"no_python_abi_suffix"
,
True
)
self
.
output_dir
=
kwargs
.
get
(
"output_dir"
,
None
)
self
.
output_dir
=
kwargs
.
get
(
"output_dir"
,
None
)
# whether containing cuda source file in Extensions
self
.
contain_cuda_file
=
False
def
initialize_options
(
self
):
def
initialize_options
(
self
):
super
(
BuildExtension
,
self
).
initialize_options
()
super
(
BuildExtension
,
self
).
initialize_options
()
...
@@ -432,6 +434,9 @@ class BuildExtension(build_ext, object):
...
@@ -432,6 +434,9 @@ class BuildExtension(build_ext, object):
# shared library have same ABI suffix with core_(no)avx.so.
# shared library have same ABI suffix with core_(no)avx.so.
# See https://stackoverflow.com/questions/34571583/understanding-gcc-5s-glibcxx-use-cxx11-abi-or-the-new-abi
# See https://stackoverflow.com/questions/34571583/understanding-gcc-5s-glibcxx-use-cxx11-abi-or-the-new-abi
add_compile_flag
([
'-D_GLIBCXX_USE_CXX11_ABI=1'
],
cflags
)
add_compile_flag
([
'-D_GLIBCXX_USE_CXX11_ABI=1'
],
cflags
)
# Append this macor only when jointly compiling .cc with .cu
if
not
is_cuda_file
(
src
)
and
self
.
contain_cuda_file
:
cflags
.
append
(
'-DPADDLE_WITH_CUDA'
)
add_std_without_repeat
(
add_std_without_repeat
(
cflags
,
self
.
compiler
.
compiler_type
,
use_std14
=
True
)
cflags
,
self
.
compiler
.
compiler_type
,
use_std14
=
True
)
...
@@ -506,6 +511,9 @@ class BuildExtension(build_ext, object):
...
@@ -506,6 +511,9 @@ class BuildExtension(build_ext, object):
elif
isinstance
(
self
.
cflags
,
list
):
elif
isinstance
(
self
.
cflags
,
list
):
cflags
=
MSVC_COMPILE_FLAGS
+
self
.
cflags
cflags
=
MSVC_COMPILE_FLAGS
+
self
.
cflags
cmd
+=
cflags
cmd
+=
cflags
# Append this macor only when jointly compiling .cc with .cu
if
not
is_cuda_file
(
src
)
and
self
.
contain_cuda_file
:
cmd
.
append
(
'-DPADDLE_WITH_CUDA'
)
return
original_spawn
(
cmd
)
return
original_spawn
(
cmd
)
...
@@ -633,6 +641,8 @@ class BuildExtension(build_ext, object):
...
@@ -633,6 +641,8 @@ class BuildExtension(build_ext, object):
for
i
,
extension
in
enumerate
(
self
.
extensions
):
for
i
,
extension
in
enumerate
(
self
.
extensions
):
sources
=
[
os
.
path
.
abspath
(
s
)
for
s
in
extension
.
sources
]
sources
=
[
os
.
path
.
abspath
(
s
)
for
s
in
extension
.
sources
]
if
not
self
.
contain_cuda_file
:
self
.
contain_cuda_file
=
any
([
is_cuda_file
(
s
)
for
s
in
sources
])
op_names
=
parse_op_name_from
(
sources
)
op_names
=
parse_op_name_from
(
sources
)
for
op_name
in
op_names
:
for
op_name
in
op_names
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录