Fix enum parsing for CUstreamAtomicReductionDataType_enum#4
Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Open
Fix enum parsing for CUstreamAtomicReductionDataType_enum#4devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Conversation
Add replace pattern to handle unsigned literal shift syntax (1u<<) that pyclibrary fails to parse. Also add safety net to extract enum tag names from defs['types'] keys that start with 'enum ' prefix. This eliminates the manual workaround that was previously needed to add CUstreamAtomicReductionDataType_enum to found_types. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
closes NVIDIA#1312
This PR fixes the
parse_headersfunction incuda_bindings/setup.pyto properly extractCUstreamAtomicReductionDataType_enumfrom CUDA headers, eliminating the manual workaround.Root cause: pyclibrary's CParser fails to parse enums when their values use unsigned literal shift syntax (e.g.,
1u<<0). In CUDA 13.x headers,CUatomicCapability_enumuses1u<<0syntax, andCUstreamAtomicReductionDataType_enumreferences those values with bitwise OR expressions, causing the parser to fail.Fix:
"1u<<": "1<<"to normalize unsigned literal shifts before parsingdefs["types"]keys that start with"enum "prefix (pyclibrary sometimes stores enums there instead ofdefs["enums"])Validation: Tested against actual CUDA 13.1.0 headers downloaded from NVIDIA's redistribution server, confirming the enum is now correctly extracted.
Checklist for human review
1u<<replacement doesn't affect other header parsing unexpectedlyChecklist
Link to Devin run: https://app.devin.ai/sessions/349f9751c64e4be08f02bb35be35eb52
Requested by: Shawn Azman (shawn@cognition.ai) (@ShawnAzman)