Skip to content

Commit 30b6d78

Browse files
committed
[XPU] update paddle.device.xpu doc for new Stream Event api
1 parent db2b9e3 commit 30b6d78

File tree

4 files changed

+70
-0
lines changed

4 files changed

+70
-0
lines changed

docs/api/paddle/device/Overview_cn.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ XPU 相关
126126
:header: "API 名称", "API 功能"
127127
:widths: 10, 30
128128

129+
" :ref:`Stream <cn_api_paddle_device_xpu_Stream>` ", "XPU ``StreamBase`` 的设备流包装器,该 API 未来计划废弃,不推荐使用"
130+
" :ref:`Event <cn_api_paddle_device_xpu_Event>` ", "XPU ``StreamBase`` 的设备事件包装器,该 API 未来计划废弃,不推荐使用"
131+
" :ref:`current_stream <cn_api_paddle_device_xpu_current_stream>` ", "通过 device 返回当前的 XPU stream"
129132
" :ref:`device_count <cn_api_paddle_device_xpu_device_count>` ", "返回值是 int,表示当前程序可用的 XPU 数量"
130133
" :ref:`empty_cache <cn_api_paddle_device_xpu_empty_cache>` ", "用于释放显存分配器中空闲的显存"
131134
" :ref:`max_memory_allocated <cn_api_paddle_device_xpu_max_memory_allocated>` ", "返回给定设备上分配给 Tensor 的显存峰值统计"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.. _cn_api_paddle_device_xpu_Event:
2+
3+
Event
4+
-------------------------------
5+
6+
.. py:class:: paddle.device.xpu.Event()
7+
8+
XPU event 的句柄。
9+
10+
返回
11+
::::::::::::
12+
None
13+
14+
代码示例
15+
::::::::::::
16+
17+
COPY-FROM: paddle.device.xpu.Event
18+
19+
20+
.. warning::
21+
该 API 未来计划废弃,不推荐使用。
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.. _cn_api_paddle_device_xpu_Stream:
2+
3+
Stream
4+
-------------------------------
5+
6+
.. py:class:: paddle.device.xpu.Stream(device=None)
7+
8+
XPU stream 的句柄。
9+
10+
参数
11+
::::::::::::
12+
13+
- **device** (paddle.XPUPlace()|int|None,可选) - 希望分配 stream 的设备。如果是 None 或者负数,则设备为当前的设备。如果是正数,则必须小于设备的个数。默认值为 None。
14+
15+
16+
代码示例
17+
::::::::::::
18+
19+
COPY-FROM: paddle.device.xpu.Stream
20+
21+
22+
23+
.. warning::
24+
该 API 未来计划废弃,不推荐使用。
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.. _cn_api_paddle_device_xpu_current_stream:
2+
3+
current_stream
4+
-------------------------------
5+
6+
.. py:function:: paddle.device.xpu.current_stream(device=None)
7+
8+
通过 device 返回当前的 XPU stream。
9+
10+
11+
参数
12+
::::::::::::
13+
14+
- **device** (paddle.XPUPlace()|int,可选) - 希望获取 stream 的设备或者设备 ID。如果为 None,则为当前的设备。默认值为 None。
15+
16+
返回
17+
::::::::::::
18+
XPUStream,设备的 stream。
19+
20+
代码示例
21+
::::::::::::
22+
COPY-FROM: paddle.device.xpu.current_stream

0 commit comments

Comments
 (0)