Skip to content

Conversation

@mdboom
Copy link
Contributor

@mdboom mdboom commented Jan 29, 2026

Fixes #1535. See that bug for more details.

Basically, this adds a helper function to step in for the macro in nvml.h (which can't be used from Cython as it's a macro). This just makes it a little more obvious what all of the shifting and or'ing is about.

@copy-pr-bot
Copy link
Contributor

copy-pr-bot bot commented Jan 29, 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 requested a review from Copilot January 29, 2026 13:53
@mdboom
Copy link
Contributor Author

mdboom commented Jan 29, 2026

/ok to test

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 adds a helper function to improve code readability when setting NVML struct versions. The change addresses issue #1535 by replacing repetitive bit-shifting operations with a clearer helper function.

Changes:

  • Added NVML_VERSION_STRUCT helper function to encapsulate the version encoding logic
  • Replaced all manual sizeof(...) | (ver << 24) patterns with calls to the new helper function

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

@github-actions

This comment has been minimized.

@mdboom mdboom self-assigned this Jan 29, 2026
@mdboom mdboom enabled auto-merge (squash) January 29, 2026 16:36
@mdboom mdboom merged commit 4098f40 into NVIDIA:main Jan 29, 2026
174 of 175 checks passed
@github-actions
Copy link

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENH]: Provide a helper for NVML "struct version" handling

2 participants