Skip to content
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

Remove unnecessary and confusing unique_ptr usage #17144

Open
wants to merge 1 commit into
base: sycl
Choose a base branch
from

Conversation

ldrumm
Copy link
Contributor

@ldrumm ldrumm commented Feb 24, 2025

std::unique_ptr was being used as a scoped deleter for a UMF value, but this was both confusing and more expensive than it needed to be.

Here we introduce the simple OnScopeExit class which calls a callable when it goes out of scope, and use it here to simplify the meaning and overhead of the CUDA adapter's UMF pool allocation.

@ldrumm ldrumm requested review from a team as code owners February 24, 2025 18:11
@ldrumm ldrumm requested a review from frasercrmck February 24, 2025 18:11
@aarongreig
Copy link
Contributor

there's another use of this pattern here https://github.com/intel/llvm/blob/sycl/unified-runtime/source/adapters/cuda/platform.cpp#L30 and I think that's the last usage of cuda_params_unique_handle_t so could delete that definition as well

@ldrumm
Copy link
Contributor Author

ldrumm commented Feb 25, 2025 via email

`std::unique_ptr` was being used as a scoped deleter for a UMF value,
but this was both confusing and more expensive than it needed to be.

Here we introduce the simple `OnScopeExit` class which calls a callable
when it goes out of scope, and use it here to simplify the meaning and
overhead of the CUDA adapter's UMF pool allocation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants