Skip to content

Conversation

@gandryey
Copy link
Contributor

@gandryey gandryey commented Feb 2, 2026

Motivation

Refcounters can delay memory object destruction, which affect some logic in the apps, written with CUDA's expectations in the behavior.

Technical Details

Disable memory object ref counting for HIP in DD mode

JIRA ID

SWDEV-440746

Test Plan

N/A

Test Result

N/A

Submission Checklist

N/A

Refcounters can delay memory object destruction, which affect some logic in the apps, written with CUDA's expectations in the behavior.
@gandryey gandryey requested a review from a team as a code owner February 2, 2026 20:17
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 PR disables memory object reference counting for HIP in Direct Dispatch (DD) mode to align with CUDA's memory management behavior, preventing delayed memory object destruction that can affect application logic.

Changes:

  • Added conditional guards around retain() and release() calls to skip reference counting when amd::IS_HIP && AMD_DIRECT_DISPATCH is true
  • Removed unused variable declaration in rocvirtual.cpp

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
projects/clr/rocclr/platform/kernel.cpp Wraps memory object retain/release calls in kernel parameter handling with HIP DD mode checks
projects/clr/rocclr/platform/command.hpp Wraps memory object retain/release calls in various command classes with HIP DD mode checks
projects/clr/rocclr/device/rocm/rocvirtual.cpp Removes unused memories variable declaration

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants