Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
3fe99ad5
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看板
未验证
提交
3fe99ad5
编写于
6月 01, 2021
作者:
Q
Qi Li
提交者:
GitHub
6月 01, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[ROCM] add is_compiled_with_rocm api, test=develop (#33043) (#33228)
上级
6fb64606
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
2 deletion
+22
-2
python/paddle/__init__.py
python/paddle/__init__.py
+2
-0
python/paddle/device.py
python/paddle/device.py
+2
-0
python/paddle/fluid/framework.py
python/paddle/fluid/framework.py
+16
-0
python/paddle/utils/cpp_extension/cpp_extension.py
python/paddle/utils/cpp_extension/cpp_extension.py
+2
-2
未找到文件。
python/paddle/__init__.py
浏览文件 @
3fe99ad5
...
@@ -258,6 +258,7 @@ from .device import get_cudnn_version # noqa: F401
...
@@ -258,6 +258,7 @@ from .device import get_cudnn_version # noqa: F401
from
.device
import
set_device
# noqa: F401
from
.device
import
set_device
# noqa: F401
from
.device
import
get_device
# noqa: F401
from
.device
import
get_device
# noqa: F401
from
.fluid.framework
import
is_compiled_with_cuda
# noqa: F401
from
.fluid.framework
import
is_compiled_with_cuda
# noqa: F401
from
.fluid.framework
import
is_compiled_with_rocm
# noqa: F401
from
.device
import
is_compiled_with_xpu
# noqa: F401
from
.device
import
is_compiled_with_xpu
# noqa: F401
from
.device
import
is_compiled_with_npu
# noqa: F401
from
.device
import
is_compiled_with_npu
# noqa: F401
from
.device
import
XPUPlace
# noqa: F401
from
.device
import
XPUPlace
# noqa: F401
...
@@ -384,6 +385,7 @@ __all__ = [ #noqa
...
@@ -384,6 +385,7 @@ __all__ = [ #noqa
'less_equal'
,
'less_equal'
,
'triu'
,
'triu'
,
'is_compiled_with_cuda'
,
'is_compiled_with_cuda'
,
'is_compiled_with_rocm'
,
'sin'
,
'sin'
,
'dist'
,
'dist'
,
'unbind'
,
'unbind'
,
...
...
python/paddle/device.py
浏览文件 @
3fe99ad5
...
@@ -19,6 +19,7 @@ from paddle.fluid import core
...
@@ -19,6 +19,7 @@ from paddle.fluid import core
from
paddle.fluid
import
framework
from
paddle.fluid
import
framework
from
paddle.fluid.dygraph.parallel
import
ParallelEnv
from
paddle.fluid.dygraph.parallel
import
ParallelEnv
from
paddle.fluid.framework
import
is_compiled_with_cuda
#DEFINE_ALIAS
from
paddle.fluid.framework
import
is_compiled_with_cuda
#DEFINE_ALIAS
from
paddle.fluid.framework
import
is_compiled_with_rocm
#DEFINE_ALIAS
__all__
=
[
__all__
=
[
'get_cudnn_version'
,
'get_cudnn_version'
,
...
@@ -33,6 +34,7 @@ __all__ = [
...
@@ -33,6 +34,7 @@ __all__ = [
# 'CUDAPinnedPlace',
# 'CUDAPinnedPlace',
# 'CUDAPlace',
# 'CUDAPlace',
'is_compiled_with_cuda'
,
'is_compiled_with_cuda'
,
'is_compiled_with_rocm'
,
'is_compiled_with_npu'
'is_compiled_with_npu'
]
]
...
...
python/paddle/fluid/framework.py
浏览文件 @
3fe99ad5
...
@@ -52,6 +52,7 @@ __all__ = [
...
@@ -52,6 +52,7 @@ __all__ = [
'cuda_pinned_places'
,
'cuda_pinned_places'
,
'in_dygraph_mode'
,
'in_dygraph_mode'
,
'is_compiled_with_cuda'
,
'is_compiled_with_cuda'
,
'is_compiled_with_rocm'
,
'is_compiled_with_xpu'
,
'is_compiled_with_xpu'
,
'Variable'
,
'Variable'
,
'require_version'
,
'require_version'
,
...
@@ -397,6 +398,21 @@ def is_compiled_with_cuda():
...
@@ -397,6 +398,21 @@ def is_compiled_with_cuda():
return
core
.
is_compiled_with_cuda
()
return
core
.
is_compiled_with_cuda
()
def
is_compiled_with_rocm
():
"""
Whether this whl package can be used to run the model on AMD or Hygon GPU(ROCm).
Returns (bool): `True` if ROCm is currently available, otherwise `False`.
Examples:
.. code-block:: python
import paddle
support_gpu = paddle.is_compiled_with_rocm()
"""
return
core
.
is_compiled_with_rocm
()
def
cuda_places
(
device_ids
=
None
):
def
cuda_places
(
device_ids
=
None
):
"""
"""
**Note**:
**Note**:
...
...
python/paddle/utils/cpp_extension/cpp_extension.py
浏览文件 @
3fe99ad5
...
@@ -42,10 +42,10 @@ if IS_WINDOWS and six.PY3:
...
@@ -42,10 +42,10 @@ if IS_WINDOWS and six.PY3:
from
unittest.mock
import
Mock
from
unittest.mock
import
Mock
_du_build_ext
.
get_export_symbols
=
Mock
(
return_value
=
None
)
_du_build_ext
.
get_export_symbols
=
Mock
(
return_value
=
None
)
CUDA_HOME
=
find_cuda_home
()
if
core
.
is_compiled_with_rocm
():
if
core
.
is_compiled_with_rocm
():
ROCM_HOME
=
find_rocm_home
()
ROCM_HOME
=
find_rocm_home
()
else
:
CUDA_HOME
=
ROCM_HOME
CUDA_HOME
=
find_cuda_home
()
def
setup
(
**
attr
):
def
setup
(
**
attr
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录