Skip to content

Commit 7d87f0f

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

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed

docs/api/paddle/device/Overview_cn.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ CUDA 相关
100100
:widths: 10, 30
101101

102102
" :ref:`Stream <cn_api_paddle_device_cuda_Stream>` ", "CUDA ``StreamBase`` 的设备流包装器,该 API 未来计划废弃,不推荐使用"
103-
" :ref:`Event <cn_api_paddle_device_cuda_Event>` ", "CUDA ``StreamBase`` 的设备事件包装器,该 API 未来计划废弃,不推荐使用"
103+
" :ref:`Event <cn_api_paddle_device_cuda_Event>` ", "CUDA ``EventBase`` 的设备事件包装器,该 API 未来计划废弃,不推荐使用"
104104
" :ref:`current_stream <cn_api_paddle_device_cuda_current_stream>` ", "通过 device 返回当前的 CUDA stream"
105105
" :ref:`device_count <cn_api_paddle_device_cuda_device_count>` ", "返回值是 int,表示当前程序可用的 GPU 数量"
106106
" :ref:`empty_cache <cn_api_paddle_device_cuda_empty_cache>` ", "用于释放显存分配器中空闲的显存"
@@ -126,6 +126,8 @@ 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 ``EventBase`` 的设备事件包装器,该 API 未来计划废弃,不推荐使用"
129131
" :ref:`device_count <cn_api_paddle_device_xpu_device_count>` ", "返回值是 int,表示当前程序可用的 XPU 数量"
130132
" :ref:`empty_cache <cn_api_paddle_device_xpu_empty_cache>` ", "用于释放显存分配器中空闲的显存"
131133
" :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 未来计划废弃,不推荐使用。

0 commit comments

Comments
 (0)