Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
3cd78f6e
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看板
未验证
提交
3cd78f6e
编写于
6月 28, 2019
作者:
C
chengduo
提交者:
GitHub
6月 28, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add cuda_is_available (#18357)
* add cuda_is_available test=release/1.5
上级
2240f7fd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
3 deletion
+20
-3
paddle/fluid/API.spec
paddle/fluid/API.spec
+2
-1
python/paddle/fluid/framework.py
python/paddle/fluid/framework.py
+18
-2
未找到文件。
paddle/fluid/API.spec
浏览文件 @
3cd78f6e
...
@@ -11,9 +11,10 @@ paddle.fluid.default_main_program (ArgSpec(args=[], varargs=None, keywords=None,
...
@@ -11,9 +11,10 @@ paddle.fluid.default_main_program (ArgSpec(args=[], varargs=None, keywords=None,
paddle.fluid.program_guard (ArgSpec(args=['main_program', 'startup_program'], varargs=None, keywords=None, defaults=(None,)), ('document', '78fb5c7f70ef76bcf4a1862c3f6b8191'))
paddle.fluid.program_guard (ArgSpec(args=['main_program', 'startup_program'], varargs=None, keywords=None, defaults=(None,)), ('document', '78fb5c7f70ef76bcf4a1862c3f6b8191'))
paddle.fluid.name_scope (ArgSpec(args=['prefix'], varargs=None, keywords=None, defaults=(None,)), ('document', '61660461e1f44e0480ca22fa8a482c41'))
paddle.fluid.name_scope (ArgSpec(args=['prefix'], varargs=None, keywords=None, defaults=(None,)), ('document', '61660461e1f44e0480ca22fa8a482c41'))
paddle.fluid.cuda_places (ArgSpec(args=['device_ids'], varargs=None, keywords=None, defaults=(None,)), ('document', '7f3068b82fc427bfa04b1af953610992'))
paddle.fluid.cuda_places (ArgSpec(args=['device_ids'], varargs=None, keywords=None, defaults=(None,)), ('document', '7f3068b82fc427bfa04b1af953610992'))
paddle.fluid.cpu_places (ArgSpec(args=['device_count'], varargs=None, keywords=None, defaults=(None,)), ('document', '
8b674e9a7ac7944c27fd853b675c2cb
2'))
paddle.fluid.cpu_places (ArgSpec(args=['device_count'], varargs=None, keywords=None, defaults=(None,)), ('document', '
dad57e8624794766d770cea905dec1c
2'))
paddle.fluid.cuda_pinned_places (ArgSpec(args=['device_count'], varargs=None, keywords=None, defaults=(None,)), ('document', 'cc83b6c5ba8be38ff3ee87e9cec9de5f'))
paddle.fluid.cuda_pinned_places (ArgSpec(args=['device_count'], varargs=None, keywords=None, defaults=(None,)), ('document', 'cc83b6c5ba8be38ff3ee87e9cec9de5f'))
paddle.fluid.in_dygraph_mode (ArgSpec(args=[], varargs=None, keywords=None, defaults=None), ('document', 'eddb7a1f0083dcc70e9f6c71ee003cb9'))
paddle.fluid.in_dygraph_mode (ArgSpec(args=[], varargs=None, keywords=None, defaults=None), ('document', 'eddb7a1f0083dcc70e9f6c71ee003cb9'))
paddle.fluid.is_compiled_with_cuda (ArgSpec(args=[], varargs=None, keywords=None, defaults=None), ('document', '60c7f107a5050aeb58bb74eb175672b5'))
paddle.fluid.Executor.__init__ (ArgSpec(args=['self', 'place'], varargs=None, keywords=None, defaults=None), ('document', '6adf97f83acf6453d4a6a4b1070f3754'))
paddle.fluid.Executor.__init__ (ArgSpec(args=['self', 'place'], varargs=None, keywords=None, defaults=None), ('document', '6adf97f83acf6453d4a6a4b1070f3754'))
paddle.fluid.Executor.close (ArgSpec(args=['self'], varargs=None, keywords=None, defaults=None), ('document', '3a584496aa1343f36eebf3c46b323a74'))
paddle.fluid.Executor.close (ArgSpec(args=['self'], varargs=None, keywords=None, defaults=None), ('document', '3a584496aa1343f36eebf3c46b323a74'))
paddle.fluid.Executor.infer_from_dataset (ArgSpec(args=['self', 'program', 'dataset', 'scope', 'thread', 'debug', 'fetch_list', 'fetch_info', 'print_period'], varargs=None, keywords=None, defaults=(None, None, None, 0, False, None, None, 100)), ('document', 'bedc29ad01c1b911e99032ee1e19ac59'))
paddle.fluid.Executor.infer_from_dataset (ArgSpec(args=['self', 'program', 'dataset', 'scope', 'thread', 'debug', 'fetch_list', 'fetch_info', 'print_period'], varargs=None, keywords=None, defaults=(None, None, None, 0, False, None, None, 100)), ('document', 'bedc29ad01c1b911e99032ee1e19ac59'))
...
...
python/paddle/fluid/framework.py
浏览文件 @
3cd78f6e
...
@@ -44,6 +44,7 @@ __all__ = [
...
@@ -44,6 +44,7 @@ __all__ = [
'cpu_places'
,
'cpu_places'
,
'cuda_pinned_places'
,
'cuda_pinned_places'
,
'in_dygraph_mode'
,
'in_dygraph_mode'
,
'is_compiled_with_cuda'
,
]
]
EMPTY_VAR_NAME
=
core
.
kEmptyVarName
()
EMPTY_VAR_NAME
=
core
.
kEmptyVarName
()
...
@@ -102,6 +103,21 @@ def _cuda_ids():
...
@@ -102,6 +103,21 @@ def _cuda_ids():
return
device_ids
return
device_ids
def
is_compiled_with_cuda
():
"""
Whether this whl package can be used to run the model on GPU.
Returns (bool): support gpu or not.
Examples:
.. code-block:: python
import paddle.fluid as fluid
support_gpu = fluid.is_compiled_with_cuda()
"""
return
core
.
is_compiled_with_cuda
()
def
cuda_places
(
device_ids
=
None
):
def
cuda_places
(
device_ids
=
None
):
"""
"""
Create a list of :code:`fluid.CUDAPlace` objects.
Create a list of :code:`fluid.CUDAPlace` objects.
...
@@ -145,8 +161,8 @@ def cpu_places(device_count=None):
...
@@ -145,8 +161,8 @@ def cpu_places(device_count=None):
If :code:`device_count` is None, the device count would
If :code:`device_count` is None, the device count would
be determined by environment variable :code:`CPU_NUM`.
be determined by environment variable :code:`CPU_NUM`.
If :code:`CPU_NUM` is not set, the de
vice count would
If :code:`CPU_NUM` is not set, the de
fault value is 1,
be determined by :code:`multiprocessing.cpu_count()`.
i.e. CPU_NUM=1.
Args:
Args:
device_count (None|int): device number.
device_count (None|int): device number.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录