Skip to content

cuda.core: add docstrings to Host properties and public StrEnum types#2134

Open
aryanputta wants to merge 2 commits into
NVIDIA:mainfrom
aryanputta:docs/typing-strenum-docstrings
Open

cuda.core: add docstrings to Host properties and public StrEnum types#2134
aryanputta wants to merge 2 commits into
NVIDIA:mainfrom
aryanputta:docs/typing-strenum-docstrings

Conversation

@aryanputta
Copy link
Copy Markdown
Contributor

Summary

Contributes to the doc-finalization step of #2131.

Two doc-only changes to cuda.core, touching no logic:

cuda/core/_host.py — Host property docstrings

Host is a new 1.1.0 API (release notes: #2131 checklist item "Finalize the doc update"). The class-level docstring is already complete, but numa_id and is_numa_current had no docstrings, leaving them blank in generated API docs and help():

@property
def numa_id(self) -> int | None:
    """NUMA node ID, or ``None`` if not pinned to a specific NUMA node."""

@property
def is_numa_current(self) -> bool:
    """Whether this ``Host`` represents the calling thread's NUMA node (constructed via :meth:`numa_current`)."""

cuda/core/typing.py — StrEnum class docstrings

All 11 public StrEnum subclasses (SourceCodeType, ObjectCodeFormatType, CompilerBackendType, PCHStatusType, GraphConditionalType, GraphMemoryType, ManagedMemoryLocationType, VirtualMemoryHandleType, VirtualMemoryLocationType, VirtualMemoryGranularityType, VirtualMemoryAccessType, VirtualMemoryAllocationType) previously had zero class-level docstrings. Each now has a short description and a one-liner per member so help() and Sphinx show meaningful output.

Checklist

  • cuda.core only — no cuda.bindings files touched
  • No logic changes — docstrings only
  • Consistent with existing single-line property docstring style (Host.numa_current, ManagedBuffer methods)

Each StrEnum class in cuda.core.typing now has a class-level docstring
that states its purpose and briefly describes every member value.
Sphinx and help() now show meaningful descriptions for CompilerBackendType,
GraphConditionalType, GraphMemoryType, ManagedMemoryLocationType,
ObjectCodeFormatType, PCHStatusType, SourceCodeType, VirtualMemory*.

No logic changes.
…urrent

Host is a new 1.1.0 API. The class-level docstring is complete but the two
public properties had no docstrings, leaving them blank in generated API docs
and in help().
@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot Bot commented May 22, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the cuda.core Everything related to the cuda.core module label May 22, 2026
@aryanputta
Copy link
Copy Markdown
Contributor Author

@leofang @rwgk — flagging this for your awareness in the context of #2131.

This is a doc-only contribution to cuda.core (no cuda.bindings files touched — I know external contributions there aren't permitted). Both changes are pure docstring additions, zero logic:

  • _host.py: Host.numa_id and Host.is_numa_current were undocumented. Since Host is new in 1.1.0 and explicitly in the release notes, having blank property docs felt like the most directly useful thing I could help with for the doc-finalization step.
  • typing.py: added class-level docstrings to all 11 public StrEnum types so help() and Sphinx show something meaningful.

Happy to split into two PRs if that's easier to review, or adjust wording on any of the docstrings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.core Everything related to the cuda.core module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant