Skip to content

Remove _StridedLayout from cuda.core public API#1932

Merged
cpcloud merged 2 commits intomainfrom
fix/remove-strided-layout-from-public-api
Apr 17, 2026
Merged

Remove _StridedLayout from cuda.core public API#1932
cpcloud merged 2 commits intomainfrom
fix/remove-strided-layout-from-public-api

Conversation

@mdboom
Copy link
Copy Markdown
Contributor

@mdboom mdboom commented Apr 16, 2026

I'm doing this as part of auditing the cuda.core API. This exposure of a private class may be intentional -- I don't have enough context.

Solutions include:

  • Not exposing it (as in this PR)
  • Removing the underscore
  • Leaving as-is because it's a hairy problem somehow (in which case let's add a comment).

Bot summary below:

Problem: _StridedLayout is a private symbol (underscore-prefixed) imported from cuda.core._layout into cuda/core/__init__.py, making it unintentionally available as a public name in the cuda.core namespace.

Fix: Remove the _StridedLayout import from __init__.py. All internal usage (in _memoryview.pyx) already imports it directly via cimport from the private module, so the re-export is unnecessary.

_StridedLayout is a private symbol (underscore-prefixed) that was
imported from cuda.core._layout into cuda/core/__init__.py, making it
unintentionally available as a public name. All internal usage
(in _memoryview.pyx) already imports it directly via cimport from the
private module, so the re-export in __init__.py is unnecessary.
@mdboom mdboom added this to the cuda.core v1.0.0 milestone Apr 16, 2026
@mdboom mdboom added bug Something isn't working cuda.core Everything related to the cuda.core module labels Apr 16, 2026
@mdboom mdboom requested a review from cpcloud April 16, 2026 20:57
@mdboom mdboom added enhancement Any code-related improvements and removed bug Something isn't working labels Apr 17, 2026
@mdboom mdboom self-assigned this Apr 17, 2026
@github-actions

This comment has been minimized.

@cpcloud cpcloud enabled auto-merge (squash) April 17, 2026 14:24
@cpcloud cpcloud merged commit f73c1c8 into main Apr 17, 2026
90 of 91 checks passed
@cpcloud cpcloud deleted the fix/remove-strided-layout-from-public-api branch April 17, 2026 14:27
@github-actions
Copy link
Copy Markdown

Doc Preview CI
Preview removed because the pull request was closed or merged.

mdboom added a commit to mdboom/cuda-python that referenced this pull request Apr 20, 2026
_StridedLayout is a private symbol (underscore-prefixed) that was
imported from cuda.core._layout into cuda/core/__init__.py, making it
unintentionally available as a public name. All internal usage
(in _memoryview.pyx) already imports it directly via cimport from the
private module, so the re-export in __init__.py is unnecessary.
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 enhancement Any code-related improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants