[DOC]: `PinnedMemoryResource.allocate` documents no parameters

Aperta Adatta ai principianti
#2,712 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
1-3 ore
Idoneità per principianti
90/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
documentation

Direzione di ricerca

Inizia con la docstring di override di una riga in cuda_core/cuda/core/_memory/_pinned_memory_resource.pyx e confronta i corpi numpydoc completi o i riferimenti incrociati alla classe base utilizzati altrove in cuda.core. Il lavoro è completato quando la pagina renderizzata di PinnedMemoryResource.allocate documenta l'argomento stream obbligatorio e passabile solo per nome, il valore restituito e la condizione RuntimeError.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

triage
Is this a duplicate?
Is this for new documentation, or an update to existing docs?

Update

Describe the incorrect/future/missing documentation

The rendered page for PinnedMemoryResource.allocate is a single sentence. It does not say what the required keyword-only stream argument must be, what the method returns, or that the method raises RuntimeError when the device does not support the requested host memory pool. The one-line docstring on the override in cuda_core/cuda/core/_memory/_pinned_memory_resource.pyx is all autodoc has to render.

from cuda.core import PinnedMemoryResource

doc = PinnedMemoryResource.allocate.__doc__
print(doc)
print("documents the 'stream' parameter:", "stream :" in doc)
print("documents a return value:", "Returns" in doc)
PinnedMemoryResource.allocate(self, size_t size, *, stream: Stream | GraphBuilder) -> Buffer

Allocate a host-pinned buffer asynchronously on the supplied stream.
documents the 'stream' parameter: False
documents a return value: False

Expected: the page states that stream is required and has no default, what allocate returns, and that it raises RuntimeError on a device without the required host memory pool support. Either the full numpydoc body or a cross-reference to the base class would fill the gap, and both shapes are already used elsewhere in cuda.core.

If this is a correction, please provide a link to the incorrect documentation. If this is a new documentation request, please link to where you have looked.

https://nvidia.github.io/cuda-python/cuda-core/latest/generated/cuda.core.PinnedMemoryResource.html

Lingua principale
Cython
Stelle
3.4k
Fork
329
Merge medio
1g 21h
PR unite (30g)
113

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NVIDIA/cuda-python

Tutte le issue di NVIDIA/cuda-python

Issue simili

Altre issue su Documentation

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.