-
Notifications
You must be signed in to change notification settings - Fork 240
cuda.bindings.nvml: Simplify the "#defines as enums" naming #1509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
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. |
There was a problem hiding this 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 simplifies the naming convention for manually-written enums in cuda.bindings.nvml by removing redundant prefixes from enum member names. Since Python enums provide their own namespace, the common prefixes that were necessary in C (where these were #defines) are no longer needed.
Changes:
- Simplified enum member names by removing redundant prefixes (e.g.,
EVENT_TYPE_SINGLE_BIT_ECC_ERROR→SINGLE_BIT_ECC_ERROR) - Updated test references to use the new simplified enum names
- Updated documentation references to use the new enum names
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| cuda_bindings/cuda/bindings/_nvml.pyx | Simplified enum member names across ~30 enum classes by removing redundant prefixes |
| cuda_core/tests/system/test_system_device.py | Updated test to use new EventType enum names without EVENT_TYPE_ prefix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
/ok to test |
This comment has been minimized.
This comment has been minimized.
|
/ok to test |
kkraus14
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
|
Good catch! |
cuda.bindings.nvml has a bunch of enums which are written by hand because they are
#definesin the nvml header. In hindsight, these didn't all need full names, but the common prefixes of the individual values can be removed. (Since Python enums are a namespace, unlike C, the prefixes aren't necessary).