Skip to content

Commit 8006fb6

Browse files
rwgkcpcloudleofangpre-commit-ci[bot]
authored
cuda-core experimental namespace deprecation (attempt v1) (NVIDIA#1377)
* Migrate cuda.core.experimental to cuda.core This commit migrates all code from cuda.core.experimental to cuda.core, completing the deprecation of the experimental namespace. Changes: - Move all files from cuda/core/experimental/ to cuda/core/ - Move include/ directory to _include/ (with leading underscore for implementation detail) - Update all imports from cuda.core.experimental.* to cuda.core.* - Update build_hooks.py to use cuda.core instead of cuda.core.experimental - Update pyproject.toml package-data paths - Update cuda/core/__init__.py to export all symbols - Update cuda/core/experimental/__init__.py for backward compatibility with deprecation warnings - Update Cython extern declarations to use _include/ instead of include/ - Fix import paths for _memory_pool (cuda.core._memory._memory_pool) - Update test files and test helpers to use new import paths All tests pass (1499 passed, 79 skipped). * Remove experimental namespace from examples and test files Update all example files and test Cython files to use cuda.core instead of cuda.core.experimental: - Update all example imports from cuda.core.experimental.* to cuda.core.* - Update example utils imports from cuda.core.experimental.utils to cuda.core.utils - Update test Cython file imports - Update build_tests.sh include path from experimental/include to _include All example files now use the non-experimental import paths. * Update .spdx-ignore for cuda_core/cuda/core/_include/dlpack.h * Update documentation to reflect migration from experimental to core Update all documentation files to reference cuda.core instead of cuda.core.experimental: - api.rst: Change module from cuda.core.experimental to cuda.core - getting-started.rst: Update currentmodule and example imports - interoperability.rst: Update currentmodule - api_private.rst: Update currentmodule - conf.py: Update system import paths and excluded_dirs paths All documentation now reflects the new non-experimental API paths. Release notes files are left unchanged as they are historical. * Update issue templates and wheel merge script for cuda.core migration Update GitHub issue templates and wheel merge script to reference cuda.core instead of cuda.core.experimental: - bug_report.yml: Update example references from cuda.core.experimental to cuda.core - feature_request.yml: Update example references from cuda.core.experimental to cuda.core - merge_cuda_core_wheels.py: Update to merge cuda/core/ instead of cuda/core/experimental/, and adopt logic that copies only binaries into versioned subdirectories while keeping Python modules in cuda/core/ * chore: bump pixi version * test: handle deprecated calls * build: remove unnecessary `local_include_dirs` * chore: try reverting to the original merge wheel script * revert: chore: try reverting to the original merge wheel script This reverts commit e0f784d. * test: try removing unnecessary utils import * chore: copy everything * Fix merge script to selectively copy files to versioned directories Fix the wheel merge script to copy files selectively instead of copying everything, which was causing import errors: - Copy binaries (.so, .pyd, .dll) to versioned directories (version-specific) - Copy Python files (.py) to versioned directories (needed for imports like utils.py) - Do NOT copy Cython files (.pyx, .pxd) to versioned directories The previous "copy everything" approach caused failures when testing CUDA 12.9.1 because CUDA 13 .pyx files (which reference version-specific C functions like cuMemGetMemPool) were being copied into cu12/ directories, causing import errors. This selective approach fixes both: - Original issue: utils.py import failures (now .py files are copied) - Current issue: cuMemGetMemPool errors (now .pyx files are NOT copied) * Add debugging output to show wheel directory structures Add debugging output to show the directory structure of input and output wheels for troubleshooting. This will help diagnose issues with the wheel merge process. - Use Python's zipfile module (standard library) to list wheel contents - Add debugging output showing cuda/core/ directory structure for: * Each input wheel before merging * The output merged wheel after merging - Format output similar to unzip -l for readability - Filter output to show only cuda/core/ entries * Fix merge script to match main branch's working approach Based on analysis of main branch's merge script and CI logs, updated the merge logic to: 1. Use shutil.copytree() to copy entire directory trees into versioned subdirectories (cu12/, cu13/), matching main's approach for experimental/ 2. Clean up main cuda/core/ directory to only keep: - __init__.py - _include/ directory - Versioned subdirectories (cu12/, cu13/) This ensures Python imports from versioned directories instead of main directory, which may contain binaries from a different CUDA version. 3. Add DRY helper function print_wheel_directory_structure() for debugging output, refactored from duplicate code. 4. Update docstring to reference cuda/core instead of experimental namespace. This fixes the ImportError issues where Python was loading CUDA 13 binaries when running on CUDA 12.9.1, because the main directory still contained .so files from the base wheel. * Fix merge script: keep _version.py and __init__.pxd in main directory The merge script was removing _version.py and __init__.pxd from the main cuda/core/ directory, but these files are required: - _version.py: imported by __init__.py at module initialization - __init__.pxd: kept for Cython compatibility (matches main branch behavior) Updated the cleanup logic to preserve these files along with __init__.py, _include/, and versioned subdirectories (cu12/, cu13/). The code was also manually cleaned up for better readability and maintainability. * Rework top-level into in cuda_core/docs/source/api.rst * Bug fix in ci/tools/merge_cuda_core_wheels.py: replace AI-generated .touch() with os.truncate() * Add backward compatibility tests for experimental namespace - Add test_experimental_backward_compat.py from v0 branch - Remove __getattr__ from experimental/__init__.py per reviewer feedback (underscored modules are not public APIs) - Update test to expect AttributeError when accessing underscored modules - Document in module docstring that underscored modules are intentionally not accessible through experimental namespace - Move note about underscored modules to module docstring (per pre-commit) * Remove __init__.pxd from items_to_keep list in ci/tools/merge_cuda_core_wheels.py * Combine experimental backward compat tests into single function - Combine all test functions into test_experimental_backward_compatibility() to avoid race conditions when tests run in parallel - Add defensive sys.modules cleanup at start of test function - Remove test for underscored module access (not needed per reviewer feedback) * Remove StridedMemoryView from experimental namespace Remove StridedMemoryView and args_viewable_as_strided_memory from experimental namespace. These should be imported from cuda.core.utils instead. * Specify v1.0.0 as removal target for experimental namespace Update deprecation warning and docstring to specify that the experimental namespace will be removed in v1.0.0, rather than the vague 'future release'. This provides users with a clear timeline for migration. * Apply suggestions from code review * [pre-commit.ci] auto code formatting * make linter happy * [pre-commit.ci] auto code formatting * revert the utils change --------- Co-authored-by: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Co-authored-by: Leo Fang <leof@nvidia.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 65ff57f commit 8006fb6

111 files changed

Lines changed: 596 additions & 326 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ body:
5252
attributes:
5353
label: Describe the bug
5454
description: A clear and concise description of what problem you are running into.
55-
placeholder: "Attempting to compile a program via `cuda.core.experimental.Program.compile` throws a `ValueError`."
55+
placeholder: "Attempting to compile a program via `cuda.core.Program.compile` throws a `ValueError`."
5656
validations:
5757
required: true
5858

@@ -62,7 +62,7 @@ body:
6262
label: How to Reproduce
6363
description: Steps used to reproduce the bug.
6464
placeholder: |
65-
0. Construct a `cuda.core.experimental.Program` instance
65+
0. Construct a `cuda.core.Program` instance
6666
1. Call the `.compile(...)` method of the instance
6767
2. The call throws a `ValueError` with the following:
6868
```
@@ -76,7 +76,7 @@ body:
7676
attributes:
7777
label: Expected behavior
7878
description: A clear and concise description of what you expected to happen.
79-
placeholder: "Using `cuda.core.experimental.Program.compile(...)` should run successfully and not throw a `ValueError`"
79+
placeholder: "Using `cuda.core.Program.compile(...)` should run successfully and not throw a `ValueError`"
8080
validations:
8181
required: true
8282

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ body:
3636
attributes:
3737
label: Is your feature request related to a problem? Please describe.
3838
description: A clear and concise description of what the problem is, e.g., "I would like to be able to..."
39-
placeholder: I would like to be able to use the equivalent of `cuda.core.experimental.Program.compile(...)` to compile my code to PTX.
39+
placeholder: I would like to be able to use the equivalent of `cuda.core.Program.compile(...)` to compile my code to PTX.
4040
validations:
4141
required: true
4242

@@ -46,7 +46,7 @@ body:
4646
label: Describe the solution you'd like
4747
description: A clear and concise description of what you want to happen.
4848
placeholder: |
49-
Support a `ptx` target_type in the `cuda.core.experimental.Program.compile(...)` function.
49+
Support a `ptx` target_type in the `cuda.core.Program.compile(...)` function.
5050
validations:
5151
required: true
5252

@@ -57,7 +57,7 @@ body:
5757
description:
5858
If applicable, please add a clear and concise description of any alternative solutions or features you've
5959
considered.
60-
placeholder: The alternatives to using `cuda.core.experimental.Program.compile(...)` are unappealing. They usually involve using lower level bindings to something like nvRTC or invoking the nvcc executable.
60+
placeholder: The alternatives to using `cuda.core.Program.compile(...)` are unappealing. They usually involve using lower level bindings to something like nvRTC or invoking the nvcc executable.
6161
validations:
6262
required: false
6363

.spdx-ignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ requirements*.txt
99
cuda_bindings/examples/*
1010

1111
# Vendored
12-
cuda_core/cuda/core/experimental/include/dlpack.h
12+
cuda_core/cuda/core/_include/dlpack.h
1313

1414
qa/ctk-next.drawio.svg

ci/tools/merge_cuda_core_wheels.py

Lines changed: 78 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
1313
In particular, each wheel contains a CUDA-specific build of the `cuda.core` library
1414
and the associated bindings. This script merges these directories into a single wheel
15-
that supports both CUDA versions, i.e., containing both `cuda/core/experimental/cu12`
16-
and `cuda/core/experimental/cu13`. At runtime, the code in `cuda/core/experimental/__init__.py`
15+
that supports both CUDA versions, i.e., containing both `cuda/core/cu12`
16+
and `cuda/core/cu13`. At runtime, the code in `cuda/core/__init__.py`
1717
is used to import the appropriate CUDA-specific bindings.
1818
1919
This script is based on the one in NVIDIA/CCCL.
@@ -25,6 +25,7 @@
2525
import subprocess
2626
import sys
2727
import tempfile
28+
import zipfile
2829
from pathlib import Path
2930
from typing import List
3031

@@ -46,7 +47,38 @@ def run_command(cmd: List[str], cwd: Path = None, env: dict = os.environ) -> sub
4647
return result
4748

4849

49-
def merge_wheels(wheels: List[Path], output_dir: Path) -> Path:
50+
def print_wheel_directory_structure(wheel_path: Path, filter_prefix: str = "cuda/core/", label: str = None):
51+
"""Print the directory structure of a wheel file, similar to unzip -l output.
52+
53+
Args:
54+
wheel_path: Path to the wheel file to inspect
55+
filter_prefix: Only show files matching this prefix (default: "cuda/core/")
56+
label: Optional label to print before the structure (e.g., "Input wheel 1: name.whl")
57+
"""
58+
if label:
59+
print(f"\n--- {label} ---", file=sys.stderr)
60+
try:
61+
with zipfile.ZipFile(wheel_path, "r") as zf:
62+
print(f"{'Length':>10} {'Date':>12} {'Time':>8} Name", file=sys.stderr)
63+
print("-" * 80, file=sys.stderr)
64+
total_size = 0
65+
file_count = 0
66+
for name in sorted(zf.namelist()):
67+
if filter_prefix in name:
68+
info = zf.getinfo(name)
69+
total_size += info.file_size
70+
file_count += 1
71+
date_time = info.date_time
72+
date_str = f"{date_time[0]:04d}-{date_time[1]:02d}-{date_time[2]:02d}"
73+
time_str = f"{date_time[3]:02d}:{date_time[4]:02d}:{date_time[5]:02d}"
74+
print(f"{info.file_size:10d} {date_str} {time_str} {name}", file=sys.stderr)
75+
print("-" * 80, file=sys.stderr)
76+
print(f"{total_size:10d} {file_count} files", file=sys.stderr)
77+
except Exception as e:
78+
print(f"Warning: Could not list wheel contents: {e}", file=sys.stderr)
79+
80+
81+
def merge_wheels(wheels: List[Path], output_dir: Path, show_wheel_contents: bool = True) -> Path:
5082
"""Merge multiple wheels into a single wheel with version-specific binaries."""
5183
print("\n=== Merging wheels ===", file=sys.stderr)
5284
print(f"Input wheels: {[w.name for w in wheels]}", file=sys.stderr)
@@ -91,30 +123,50 @@ def merge_wheels(wheels: List[Path], output_dir: Path) -> Path:
91123

92124
extracted_wheels.append(extract_dir)
93125

126+
if show_wheel_contents:
127+
print("\n=== Input wheel directory structures ===", file=sys.stderr)
128+
for i, wheel in enumerate(wheels):
129+
print_wheel_directory_structure(wheel, label=f"Input wheel {i + 1}: {wheel.name}")
130+
94131
# Use the first wheel as the base and merge binaries from others
95132
base_wheel = extracted_wheels[0]
96133

97-
# now copy the version-specific directory from other wheels
98-
# into the appropriate place in the base wheel
134+
# Copy version-specific directories from each wheel into versioned subdirectories
135+
base_dir = Path("cuda") / "core"
136+
99137
for i, wheel_dir in enumerate(extracted_wheels):
100138
cuda_version = wheels[i].name.split(".cu")[1].split(".")[0]
101-
base_dir = Path("cuda") / "core" / "experimental"
102-
# Copy from other wheels
103-
print(f" Copying {wheel_dir} to {base_wheel}", file=sys.stderr)
104-
shutil.copytree(wheel_dir / base_dir, base_wheel / base_dir / f"cu{cuda_version}")
105-
106-
# Overwrite the __init__.py in versioned dirs
107-
os.truncate(base_wheel / base_dir / f"cu{cuda_version}" / "__init__.py", 0)
108-
109-
# The base dir should only contain __init__.py, the include dir, and the versioned dirs
110-
files_to_remove = os.scandir(base_wheel / base_dir)
111-
for f in files_to_remove:
139+
versioned_dir = base_wheel / base_dir / f"cu{cuda_version}"
140+
141+
# Copy entire directory tree from source wheel to versioned directory
142+
print(f" Copying {wheel_dir / base_dir} to {versioned_dir}", file=sys.stderr)
143+
shutil.copytree(wheel_dir / base_dir, versioned_dir, dirs_exist_ok=True)
144+
145+
# Overwrite the __init__.py in versioned dirs to be empty
146+
os.truncate(versioned_dir / "__init__.py", 0)
147+
148+
print("\n=== Removing files from cuda/core/ directory ===", file=sys.stderr)
149+
items_to_keep = (
150+
"__init__.py",
151+
"_version.py",
152+
"_include",
153+
"cu12",
154+
"cu13",
155+
)
156+
all_items = os.scandir(base_wheel / base_dir)
157+
removed_count = 0
158+
for f in all_items:
112159
f_abspath = f.path
113-
if f.name not in ("__init__.py", "cu12", "cu13", "include"):
114-
if f.is_dir():
115-
shutil.rmtree(f_abspath)
116-
else:
117-
os.remove(f_abspath)
160+
if f.name in items_to_keep:
161+
continue
162+
if f.is_dir():
163+
print(f" Removing directory: {f.name}", file=sys.stderr)
164+
shutil.rmtree(f_abspath)
165+
else:
166+
print(f" Removing file: {f.name}", file=sys.stderr)
167+
os.remove(f_abspath)
168+
removed_count += 1
169+
print(f"Removed {removed_count} items from cuda/core/ directory", file=sys.stderr)
118170

119171
# Repack the merged wheel
120172
output_dir.mkdir(parents=True, exist_ok=True)
@@ -142,6 +194,11 @@ def merge_wheels(wheels: List[Path], output_dir: Path) -> Path:
142194

143195
merged_wheel = output_wheels[0]
144196
print(f"Successfully merged wheel: {merged_wheel}", file=sys.stderr)
197+
198+
if show_wheel_contents:
199+
print("\n=== Output wheel directory structure ===", file=sys.stderr)
200+
print_wheel_directory_structure(merged_wheel)
201+
145202
return merged_wheel
146203

147204

cuda_core/build_hooks.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def _build_cuda_core():
6868

6969
# It seems setuptools' wildcard support has problems for namespace packages,
7070
# so we explicitly spell out all Extension instances.
71-
root_module = "cuda.core.experimental"
71+
root_module = "cuda.core"
7272
root_path = f"{os.path.sep}".join(root_module.split(".")) + os.path.sep
7373
ext_files = glob.glob(f"{root_path}/**/*.pyx", recursive=True)
7474

@@ -86,6 +86,7 @@ def get_cuda_paths():
8686
print("CUDA paths:", CUDA_PATH)
8787
return CUDA_PATH
8888

89+
all_include_dirs = list(os.path.join(root, "include") for root in get_cuda_paths())
8990
extra_compile_args = []
9091
if COMPILE_FOR_COVERAGE:
9192
# CYTHON_TRACE_NOGIL indicates to trace nogil functions. It is not
@@ -94,9 +95,9 @@ def get_cuda_paths():
9495

9596
ext_modules = tuple(
9697
Extension(
97-
f"cuda.core.experimental.{mod.replace(os.path.sep, '.')}",
98-
sources=[f"cuda/core/experimental/{mod}.pyx"],
99-
include_dirs=list(os.path.join(root, "include") for root in get_cuda_paths()),
98+
f"cuda.core.{mod.replace(os.path.sep, '.')}",
99+
sources=[f"cuda/core/{mod}.pyx"],
100+
include_dirs=all_include_dirs,
100101
language="c++",
101102
extra_compile_args=extra_compile_args,
102103
)

cuda_core/cuda/core/__init__.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,67 @@
33
# SPDX-License-Identifier: Apache-2.0
44

55
from cuda.core._version import __version__
6+
7+
try:
8+
from cuda import bindings
9+
except ImportError:
10+
raise ImportError("cuda.bindings 12.x or 13.x must be installed") from None
11+
else:
12+
cuda_major, cuda_minor = bindings.__version__.split(".")[:2]
13+
if cuda_major not in ("12", "13"):
14+
raise ImportError("cuda.bindings 12.x or 13.x must be installed")
15+
16+
import importlib
17+
18+
subdir = f"cu{cuda_major}"
19+
try:
20+
versioned_mod = importlib.import_module(f".{subdir}", __package__)
21+
# Import all symbols from the module
22+
globals().update(versioned_mod.__dict__)
23+
except ImportError:
24+
# This is not a wheel build, but a conda or local build, do nothing
25+
pass
26+
else:
27+
del versioned_mod
28+
finally:
29+
del bindings, importlib, subdir, cuda_major, cuda_minor
30+
31+
from cuda.core import utils # noqa: E402
32+
from cuda.core._device import Device # noqa: E402
33+
from cuda.core._event import Event, EventOptions # noqa: E402
34+
from cuda.core._graph import ( # noqa: E402
35+
Graph,
36+
GraphBuilder,
37+
GraphCompleteOptions,
38+
GraphDebugPrintOptions,
39+
)
40+
from cuda.core._launch_config import LaunchConfig # noqa: E402
41+
from cuda.core._launcher import launch # noqa: E402
42+
from cuda.core._layout import _StridedLayout # noqa: E402
43+
from cuda.core._linker import Linker, LinkerOptions # noqa: E402
44+
from cuda.core._memory import ( # noqa: E402
45+
Buffer,
46+
DeviceMemoryResource,
47+
DeviceMemoryResourceOptions,
48+
GraphMemoryResource,
49+
LegacyPinnedMemoryResource,
50+
ManagedMemoryResource,
51+
ManagedMemoryResourceOptions,
52+
MemoryResource,
53+
PinnedMemoryResource,
54+
PinnedMemoryResourceOptions,
55+
VirtualMemoryResource,
56+
VirtualMemoryResourceOptions,
57+
)
58+
from cuda.core._memoryview import ( # noqa: E402
59+
StridedMemoryView, # noqa: E402
60+
args_viewable_as_strided_memory, # noqa: E402
61+
)
62+
from cuda.core._module import Kernel, ObjectCode # noqa: E402
63+
from cuda.core._program import Program, ProgramOptions # noqa: E402
64+
from cuda.core._stream import Stream, StreamOptions # noqa: E402
65+
from cuda.core._system import System # noqa: E402
66+
67+
system = System()
68+
__import__("sys").modules[__spec__.name + ".system"] = system
69+
del System

cuda_core/cuda/core/experimental/_context.pyx renamed to cuda_core/cuda/core/_context.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from dataclasses import dataclass
66

7-
from cuda.core.experimental._utils.cuda_utils import driver
7+
from cuda.core._utils.cuda_utils import driver
88

99

1010
@dataclass

cuda_core/cuda/core/experimental/_device.pyx renamed to cuda_core/cuda/core/_device.pyx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@ cimport cpython
66
from libc.stdint cimport uintptr_t
77

88
from cuda.bindings cimport cydriver
9-
from cuda.core.experimental._utils.cuda_utils cimport HANDLE_RETURN
9+
from cuda.core._utils.cuda_utils cimport HANDLE_RETURN
1010

1111
import threading
1212
from typing import Optional, TYPE_CHECKING, Union
1313

14-
from cuda.core.experimental._context import Context, ContextOptions
15-
from cuda.core.experimental._event import Event, EventOptions
16-
from cuda.core.experimental._graph import GraphBuilder
17-
from cuda.core.experimental._stream import IsStreamT, Stream, StreamOptions
18-
from cuda.core.experimental._utils.clear_error_support import assert_type
19-
from cuda.core.experimental._utils.cuda_utils import (
14+
from cuda.core._context import Context, ContextOptions
15+
from cuda.core._event import Event, EventOptions
16+
from cuda.core._graph import GraphBuilder
17+
from cuda.core._stream import IsStreamT, Stream, StreamOptions
18+
from cuda.core._utils.clear_error_support import assert_type
19+
from cuda.core._utils.cuda_utils import (
2020
ComputeCapability,
2121
CUDAError,
2222
driver,
2323
handle_return,
2424
runtime,
2525
)
26-
from cuda.core.experimental._stream cimport default_stream
26+
from cuda.core._stream cimport default_stream
2727

2828
if TYPE_CHECKING:
29-
from cuda.core.experimental._memory import Buffer, MemoryResource
29+
from cuda.core._memory import Buffer, MemoryResource
3030

3131
# TODO: I prefer to type these as "cdef object" and avoid accessing them from within Python,
3232
# but it seems it is very convenient to expose them for testing purposes...
@@ -1034,7 +1034,7 @@ class Device:
10341034
tuple of Device
10351035
A tuple containing instances of available devices.
10361036
"""
1037-
from cuda.core.experimental import system
1037+
from cuda.core import system
10381038
total = system.get_num_devices()
10391039
return tuple(cls(device_id) for device_id in range(total))
10401040

@@ -1168,17 +1168,17 @@ class Device:
11681168
)
11691169
)
11701170
if attr == 1:
1171-
from cuda.core.experimental._memory import DeviceMemoryResource
1171+
from cuda.core._memory import DeviceMemoryResource
11721172
self._memory_resource = DeviceMemoryResource(self._id)
11731173
else:
1174-
from cuda.core.experimental._memory import _SynchronousMemoryResource
1174+
from cuda.core._memory import _SynchronousMemoryResource
11751175
self._memory_resource = _SynchronousMemoryResource(self._id)
11761176

11771177
return self._memory_resource
11781178

11791179
@memory_resource.setter
11801180
def memory_resource(self, mr):
1181-
from cuda.core.experimental._memory import MemoryResource
1181+
from cuda.core._memory import MemoryResource
11821182
assert_type(mr, MemoryResource)
11831183
self._memory_resource = mr
11841184

@@ -1237,7 +1237,7 @@ class Device:
12371237
Acts as an entry point of this object. Users always start a code by
12381238
calling this method, e.g.
12391239

1240-
>>> from cuda.core.experimental import Device
1240+
>>> from cuda.core import Device
12411241
>>> dev0 = Device(0)
12421242
>>> dev0.set_current()
12431243
>>> # ... do work on device 0 ...

cuda_core/cuda/core/experimental/_dlpack.pxd renamed to cuda_core/cuda/core/_dlpack.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ from libc.stdint cimport uint64_t
1414
from libc.stdint cimport intptr_t
1515

1616

17-
cdef extern from "include/dlpack.h" nogil:
17+
cdef extern from "_include/dlpack.h" nogil:
1818
"""
1919
#define DLPACK_TENSOR_UNUSED_NAME "dltensor"
2020
#define DLPACK_VERSIONED_TENSOR_UNUSED_NAME "dltensor_versioned"
File renamed without changes.

0 commit comments

Comments
 (0)