Skip to content

Fix #1336: Correct CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL type - #1451

Merged
mdboom merged 1 commit into
NVIDIA:mainfrom
mdboom:issue1336
Jan 12, 2026
Merged

Fix #1336: Correct CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL type#1451
mdboom merged 1 commit into
NVIDIA:mainfrom
mdboom:issue1336

Conversation

@mdboom

Copy link
Copy Markdown
Contributor

Description

The docs for CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL say:

 * - ::CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL:
*
* Returns in \p *data an integer representing a device ordinal of a device against
* which the memory was allocated or registered.

This attribute type was erroneously being converted to an unsigned int. This simply fixes that and adds a test.

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@copy-pr-bot

Copy link
Copy Markdown
Contributor

Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@mdboommdboom self-assigned this Jan 9, 2026
@mdboommdboom added bug Something isn't working cuda.bindings Everything related to the cuda.bindings module labels Jan 9, 2026
@mdboom
mdboom requested a review from CopilotJanuary 9, 2026 18:37
@mdboom

Copy link
Copy Markdown
ContributorAuthor

/ok to test

@mdboom
mdboom requested a review from leofangJanuary 9, 2026 18:39

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request attempts to fix a type mismatch for the CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL attribute, which should be retrieved as a signed int rather than an unsigned int according to the CUDA documentation.

  • Changed the storage type from unsigned int to int for CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL
  • Added test coverage for the device ordinal attribute
  • Updated release notes

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

FileDescription
cuda_bindings/cuda/bindings/_lib/utils.pxd.inAdded _int field to _HelperCUpointer_attribute class
cuda_bindings/cuda/bindings/_lib/utils.pxi.inUpdated __cinit__ to store device ordinal in _int instead of _uint (incomplete - pyObj not updated)
cuda_bindings/tests/test_cuda.pyAdded test for device ordinal attribute retrieval
cuda_bindings/docs/source/release/13.1.X-notes.rstDocumented the bugfix in release notes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadcuda_bindings/cuda/bindings/_lib/utils.pxi.in
Comment threadcuda_bindings/tests/test_cuda.py
@github-actions

This comment has been minimized.

@rparolin

Copy link
Copy Markdown
Collaborator

@greptileai, please review

@mdboom
mdboom merged commit abf7ff8 into NVIDIA:mainJan 12, 2026
88 checks passed
@github-actions

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

@leofangleofang added this to the cuda-python 13-next, 12-next milestone Jan 14, 2026
@leofangleofang added the to-be-backported Trigger the bot to raise a backport PR upon merge label Jan 14, 2026
github-actionsBot pushed a commit that referenced this pull request Jan 14, 2026
@leofangleofang linked an issue Jan 14, 2026 that may be closed by this pull request
@github-actions

Copy link
Copy Markdown

Successfully created backport PR for 12.9.x:

kkraus14 pushed a commit that referenced this pull request Jan 17, 2026
…NAL type (#1479)
* Fix#1336: Correct CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL type (#1451)
(cherry picked from commit abf7ff8)
* Delete cuda_bindings/docs/source/release/13.1.X-notes.rst
---------
Co-authored-by: Michael Droettboom <mdboom@gmail.com>
Co-authored-by: Leo Fang <leof@nvidia.com>
@leofangleofang modified the milestones: cuda.bindings 13.1.2 & 12.9.6, cuda.bindings nextFeb 17, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugSomething isn't workingcuda.bindingsEverything related to the cuda.bindings moduleto-be-backportedTrigger the bot to raise a backport PR upon merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Overflow in cuPointerGetAttributes return values?

5 participants

@mdboom@rparolin@kkraus14@leofang