Skip to content

Commit 0992a02

Browse files
authored
Remove _SynchronousMemoryResource from cuda.core._memory public API (#1933)
Remove _SynchronousMemoryResource from __all__ in _legacy.py since it is a private symbol (underscore-prefixed) that should not be part of the public API surface. Update internal imports in _device.pyx and test_launcher.py to use the full private module path (cuda.core._memory._legacy) instead of the package-level import.
1 parent 330b30e commit 0992a02

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cuda_core/cuda/core/_device.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ class Device:
11451145
from cuda.core._memory import DeviceMemoryResource
11461146
self._memory_resource = DeviceMemoryResource(self._device_id)
11471147
else:
1148-
from cuda.core._memory import _SynchronousMemoryResource
1148+
from cuda.core._memory._legacy import _SynchronousMemoryResource
11491149
self._memory_resource = _SynchronousMemoryResource(self._device_id)
11501150

11511151
return self._memory_resource

cuda_core/cuda/core/_memory/_legacy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -17,7 +17,7 @@
1717
driver,
1818
)
1919

20-
__all__ = ["LegacyPinnedMemoryResource", "_SynchronousMemoryResource"]
20+
__all__ = ["LegacyPinnedMemoryResource"]
2121

2222

2323
class LegacyPinnedMemoryResource(MemoryResource):

cuda_core/tests/test_launcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
ProgramOptions,
2525
launch,
2626
)
27-
from cuda.core._memory import _SynchronousMemoryResource
27+
from cuda.core._memory._legacy import _SynchronousMemoryResource
2828
from cuda.core._utils.cuda_utils import CUDAError
2929

3030

0 commit comments

Comments
 (0)