Skip to content

Conversation

@mdboom
Copy link
Contributor

@mdboom mdboom commented Jan 9, 2026

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
Contributor

copy-pr-bot bot commented Jan 9, 2026

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.

@mdboom mdboom self-assigned this Jan 9, 2026
@mdboom mdboom 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 Copilot January 9, 2026 18:37
@mdboom
Copy link
Contributor Author

mdboom commented Jan 9, 2026

/ok to test

@mdboom mdboom requested a review from leofang January 9, 2026 18:39
Copy link
Contributor

Copilot AI left a comment

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.

File Description
cuda_bindings/cuda/bindings/_lib/utils.pxd.in Added _int field to _HelperCUpointer_attribute class
cuda_bindings/cuda/bindings/_lib/utils.pxi.in Updated __cinit__ to store device ordinal in _int instead of _uint (incomplete - pyObj not updated)
cuda_bindings/tests/test_cuda.py Added test for device ordinal attribute retrieval
cuda_bindings/docs/source/release/13.1.X-notes.rst Documented the bugfix in release notes

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

@github-actions
Copy link

github-actions bot commented Jan 9, 2026

@rparolin
Copy link
Collaborator

rparolin commented Jan 9, 2026

@greptileai, please review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cuda.bindings Everything related to the cuda.bindings module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants