@@ -23,11 +23,11 @@ class Device:
23
23
and use the same GPU device.
24
24
25
25
While acting as the entry point, many other CUDA resources can be
26
- allocated such as streams and buffers. Any :obj:`Context` dependent
26
+ allocated such as streams and buffers. Any :obj:`~_context. Context` dependent
27
27
resource created through this device, will continue to refer to
28
28
this device's context.
29
29
30
- Newly returend :obj:`Device` object are is a thread-local singleton
30
+ Newly returned :obj:`~_device. Device` objects are thread-local singletons
31
31
for a specified device.
32
32
33
33
Note
@@ -37,7 +37,7 @@ class Device:
37
37
Parameters
38
38
----------
39
39
device_id : int, optional
40
- Device ordinal to return a :obj:`Device` object for.
40
+ Device ordinal to return a :obj:`~_device. Device` object for.
41
41
Default value of `None` return the currently used device.
42
42
43
43
"""
@@ -144,7 +144,7 @@ def compute_capability(self) -> ComputeCapability:
144
144
@property
145
145
@precondition (_check_context_initialized )
146
146
def context (self ) -> Context :
147
- """Return the current :obj:`Context` associated with this device.
147
+ """Return the current :obj:`~_context. Context` associated with this device.
148
148
149
149
Note
150
150
----
@@ -157,7 +157,7 @@ def context(self) -> Context:
157
157
158
158
@property
159
159
def memory_resource (self ) -> MemoryResource :
160
- """Return :obj:`MemoryResource` associated with this device."""
160
+ """Return :obj:`~_memory. MemoryResource` associated with this device."""
161
161
return self ._mr
162
162
163
163
@memory_resource .setter
@@ -168,7 +168,7 @@ def memory_resource(self, mr):
168
168
169
169
@property
170
170
def default_stream (self ) -> Stream :
171
- """Return default CUDA :obj:`Stream` associated with this device.
171
+ """Return default CUDA :obj:`~_stream. Stream` associated with this device.
172
172
173
173
The type of default stream returned depends on if the environment
174
174
variable CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM is set.
@@ -191,18 +191,18 @@ def set_current(self, ctx: Context = None) -> Union[Context, None]:
191
191
192
192
Initializes CUDA and sets the calling thread to a valid CUDA
193
193
context. By default the primary context is used, but optional `ctx`
194
- parameter can be used to explicitly supply a :obj:`Context` object.
194
+ parameter can be used to explicitly supply a :obj:`~_context. Context` object.
195
195
196
196
Providing a `ctx` causes the previous set context to be popped and returned.
197
197
198
198
Parameters
199
199
----------
200
- ctx : :obj:`Context`, optional
200
+ ctx : :obj:`~_context. Context`, optional
201
201
Optional context to push onto this device's current thread stack.
202
202
203
203
Returns
204
204
-------
205
- Union[:obj:`Context`, None], optional
205
+ Union[:obj:`~_context. Context`, None], optional
206
206
Popped context.
207
207
208
208
Examples
@@ -247,20 +247,20 @@ def set_current(self, ctx: Context = None) -> Union[Context, None]:
247
247
self ._has_inited = True
248
248
249
249
def create_context (self , options : ContextOptions = None ) -> Context :
250
- """Create a new :obj:`Context` object.
250
+ """Create a new :obj:`~_context. Context` object.
251
251
252
252
Note
253
253
----
254
254
The newly context will not be set as current.
255
255
256
256
Parameters
257
257
----------
258
- options : :obj:`ContextOptions`, optional
258
+ options : :obj:`~_context. ContextOptions`, optional
259
259
Customizable dataclass for context creation options.
260
260
261
261
Returns
262
262
-------
263
- :obj:`Context`
263
+ :obj:`~_context. Context`
264
264
Newly created context object.
265
265
266
266
"""
@@ -286,12 +286,12 @@ def create_stream(self, obj=None, options: StreamOptions = None) -> Stream:
286
286
----------
287
287
obj : Any, optional
288
288
Any object supporting the __cuda_stream__ protocol.
289
- options : :obj:`StreamOptions`, optional
289
+ options : :obj:`~_stream. StreamOptions`, optional
290
290
Customizable dataclass for stream creation options.
291
291
292
292
Returns
293
293
-------
294
- :obj:`Stream`
294
+ :obj:`~_stream. Stream`
295
295
Newly created stream object.
296
296
297
297
"""
@@ -314,13 +314,13 @@ def allocate(self, size, stream=None) -> Buffer:
314
314
----------
315
315
size : int
316
316
Number of bytes to allocate.
317
- stream : :obj:`Stream`, optional
317
+ stream : :obj:`~_stream. Stream`, optional
318
318
The stream establishing the stream ordering semantic.
319
319
Default value of `None` uses default stream.
320
320
321
321
Returns
322
322
-------
323
- :obj:`Buffer`
323
+ :obj:`~_memory. Buffer`
324
324
Newly created buffer object.
325
325
326
326
"""
0 commit comments