Fix HIP and HIPRTC Python bindings for correctness, add missing APIs …#14
Open
cjatin wants to merge 1 commit intojatinx:mainfrom
Open
Fix HIP and HIPRTC Python bindings for correctness, add missing APIs …#14cjatin wants to merge 1 commit intojatinx:mainfrom
cjatin wants to merge 1 commit intojatinx:mainfrom
Conversation
…and tests Built with Claude (claude-4.6-opus) via Cursor. hip.py: - Rewrite hipDeviceProperties struct to match hipDeviceProp_tR0600 layout (100+ fields reordered/added including hipUUID, hipDeviceArch, arrays) - Use hipGetDevicePropertiesR0600 symbol to match C++ macro redefinition - Fix hipMemoryType enum values (hipMemoryTypeArray=10, Unified=11, add Unregistered=0, Managed=3) - Fix hipPointerAttributes struct (add isManaged, allocationFlags; rename memoryType to type) - Fix hipMallocPitch to treat pitch as output parameter - Fix hipError to handle string arguments without crashing - Add argtypes for hipPointerGetAttributes, hipMemGetInfo, hipEventCreateWithFlags (c_uint for flags) - Clean up hipModuleLaunchKernel (remove dead code, rename params) - Add 16 missing error codes to knownExceptions hiprtc.py: - Fix hiprtcGetProgramLog/hiprtcGetCode to use create_string_buffer instead of writing into immutable Python bytes objects - Fix hiprtcCheckStatus crash on unknown error codes - Fix hiprtcGetErrorString to return decoded string - Add HIPRTC_ERROR_LINKING=100 to knownExceptions - Add missing API bindings: hiprtcVersion, hiprtcGetLoweredName, hiprtcGetBitcode/hiprtcGetBitcodeSize tests: - Add test_device_management.py (hipInit, Get/SetDevice, Synchronize) - Add test_device_properties.py (21 field validations) - Add test_memory_advanced.py (MemGetInfo, MallocPitch, PointerAttributes) - Add test_event_flags.py (flag variants, timing-disabled events) - Add test_module.py (load/unload, get function, kernel launch, streams) - Add test_error_handling.py (error class, known/unknown codes, strings) Made-with: Cursor
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.
…and tests
Built with Claude (claude-4.6-opus) via Cursor.
hip.py:
hiprtc.py:
tests:
Made-with: Cursor