Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions cuda_core/cuda/core/typing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0

"""Public type aliases and protocols used in cuda.core API signatures."""

from cuda.core._memory._buffer import DevicePointerT
from cuda.core._stream import IsStreamT

__all__ = [
"DevicePointerT",
"IsStreamT",
]
4 changes: 2 additions & 2 deletions cuda_core/docs/source/api_private.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ CUDA runtime
.. autosummary::
:toctree: generated/

_memory._buffer.DevicePointerT
typing.DevicePointerT
_memory._virtual_memory_resource.VirtualMemoryAllocationTypeT
_memory._virtual_memory_resource.VirtualMemoryLocationTypeT
_memory._virtual_memory_resource.VirtualMemoryGranularityT
Expand All @@ -41,4 +41,4 @@ CUDA protocols
:toctree: generated/
:template: protocol.rst

_stream.IsStreamT
typing.IsStreamT
29 changes: 29 additions & 0 deletions cuda_core/tests/test_typing_imports.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0

"""Tests for cuda.core.typing public type aliases and protocols."""


def test_typing_module_imports():
"""All type aliases and protocols are importable from cuda.core.typing."""
from cuda.core.typing import (
DevicePointerT,
IsStreamT,
)

assert DevicePointerT is not None
assert IsStreamT is not None


def test_typing_matches_private_definitions():
"""cuda.core.typing re-exports match the original private definitions."""
from cuda.core._memory._buffer import DevicePointerT as _DevicePointerT
from cuda.core._stream import IsStreamT as _IsStreamT
from cuda.core.typing import (
DevicePointerT,
IsStreamT,
)

assert DevicePointerT is _DevicePointerT
assert IsStreamT is _IsStreamT
Loading