fix(ventus): add missing reinit function to ensure proper device cleanup#101
Open
fix(ventus): add missing reinit function to ensure proper device cleanup#101
Conversation
- Add pocl_ventus_reinit function to fix uninit not being called issue - Implement proper device re-initialization with hardware connectivity reset - Reset command queue state and device connection - Ensure ventus device follows pocl device management lifecycle - Fix resource leak where vt_dev_close was not called due to missing reinit Fixes issue where pocl_uninit_devices skips ventus device cleanup because ops->reinit was NULL, preventing proper resource cleanup.
- Add proper reinit function for Ventus device following POCL framework patterns - Reuses hardware connection setup consistent with init function - Properly handles memory allocation, error cases, and device state reset - Follows same error handling and resource management as pocl_ventus_init - Only reinitializes runtime state, skips static device properties This resolves device reinitialization issues for Ventus GPU devices.
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.
Problem
Currently, the Ventus device in POCL has
ops->reinitset toNULL, which causespocl_uninit_devices()to skip the cleanup process for Ventus devices. This results in a resource leak wherevt_dev_close()is never called, preventing proper device cleanup.Solution
This PR adds the missing
pocl_ventus_reinit()function to ensure proper device lifecycle management:Key Changes
pocl_ventus_reinit()function inpocl_ventus.ccpocl_ventus.hops->reinit = pocl_ventus_reinitinstead ofNULLTechnical Details
The reinit function:
vt_dev_close)vt_dev_open)Testing
vt_dev_close()is called during uninit processFixes issue where pocl_uninit_devices skips ventus device cleanup because ops->reinit was NULL, preventing proper resource cleanup.