Skip to content

[UR][OpenCL][CUDA][HIP][L0][L0v2][Offload] Refactor reference counting in UR across all adapters into a new common UR_ReferenceCounter class #18823

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

Draft
wants to merge 5 commits into
base: sycl
Choose a base branch
from

Conversation

martygrant
Copy link
Contributor

@martygrant martygrant commented Jun 5, 2025

Closes #18644

Some adapters had a count member in their structs with methods to modify, or a dedicated class which classes inherited from. I opted to create a new class UR_ReferenceCounter in /common/ur_ref_counter.hpp and added this as a member to any structs which had reference counting to follow preferring composition over inheritance. Happy to hear opinions on other ways of doing it.

Removes contextReleaseMutex from OpenCL urContextRelease which shouldn't be required.

Also added this across the Sanitizer layers.

@martygrant martygrant force-pushed the martin/commonReferenceCounting branch from 5e1d95f to dc52dce Compare June 5, 2025 14:58
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.

[UR] Unify reference counting helpers across adapters
1 participant