Coverage for cuda / core / experimental / __init__.py: 100.00%
17 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-29 01:27 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-29 01:27 +0000
1# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2#
3# SPDX-License-Identifier: Apache-2.0
5"""
6Backward compatibility stubs for cuda.core.experimental namespace.
8This module provides forwarding stubs that import from the new cuda.core.*
9locations and emit deprecation warnings. Users should migrate to importing
10directly from cuda.core instead of cuda.core.experimental.
12The experimental namespace will be removed in v1.0.0.
14"""
17def _warn_deprecated(): 1a
18 """Emit a deprecation warning for using the experimental namespace.
20 Note: This warning is only when the experimental module is first imported.
21 Subsequent accesses to attributes (like utils, Device, etc.) do not trigger
22 additional warnings since they are already set in the module namespace.
23 """
24 import warnings 1a
26 warnings.warn( 1a
27 "The cuda.core.experimental namespace is deprecated. "
28 "Please import directly from cuda.core instead. "
29 "For example, use 'from cuda.core import Device' instead of "
30 "'from cuda.core.experimental import Device'. "
31 "The experimental namespace will be removed in v1.0.0.",
32 DeprecationWarning,
33 stacklevel=3,
34 )
37# Import from new locations and re-export
38_warn_deprecated() 1a
41from cuda.core import system, utils 1a
43# Make utils accessible as a submodule for backward compatibility
44__import__("sys").modules[__spec__.name + ".utils"] = utils 1a
47from cuda.core._device import Device 1a
48from cuda.core._event import Event, EventOptions 1a
49from cuda.core._launch_config import LaunchConfig 1a
50from cuda.core._launcher import launch 1a
51from cuda.core._layout import _StridedLayout 1a
52from cuda.core._linker import Linker, LinkerOptions 1a
53from cuda.core._memory import ( 1a
54 Buffer,
55 DeviceMemoryResource,
56 DeviceMemoryResourceOptions,
57 GraphMemoryResource,
58 LegacyPinnedMemoryResource,
59 ManagedMemoryResource,
60 ManagedMemoryResourceOptions,
61 MemoryResource,
62 PinnedMemoryResource,
63 PinnedMemoryResourceOptions,
64 VirtualMemoryResource,
65 VirtualMemoryResourceOptions,
66)
67from cuda.core._module import Kernel, ObjectCode 1a
68from cuda.core._program import Program, ProgramOptions 1a
69from cuda.core._stream import Stream, StreamOptions 1a
70from cuda.core.graph import ( 1a
71 Graph,
72 GraphBuilder,
73 GraphCompleteOptions,
74 GraphDebugPrintOptions,
75)