Skip to content

Fix calls to ze destructors in level-zero adapter v2 #2531

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

Merged
merged 5 commits into from
Jan 15, 2025

Conversation

Xewar313
Copy link
Contributor

@Xewar313 Xewar313 commented Jan 8, 2025

Currently, when using level zero v2 adapter, all destructions reported with use of UR_L0_DEBUG flag are labeled as "destroy(handle)". It provides no information on which objects are destroyed and which level zero functions are called. It also breaks leak detection using UR_L0_LEAKS_DEBUG flag - it does not report any objects freed this way.

This is a bit crude workaround, however I wasn't able to come up with any cleaner solution.

@Xewar313 Xewar313 requested a review from a team as a code owner January 8, 2025 11:30
@github-actions github-actions bot added the level-zero L0 adapter specific issues label Jan 8, 2025
@@ -90,19 +96,19 @@ struct ze_handle_wrapper {
};

using ze_kernel_handle_t =
ze_handle_wrapper<::ze_kernel_handle_t, zeKernelDestroy>;
ze_handle_wrapper<::ze_kernel_handle_t, zeKernelDestroy, 0>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, no, this is too awkward to use ;) I'd rather we create some sort of macro (or some clever lambda as parametr, dunno) that wraps all the destroy functions and calls ZE_CALL_NOCHECK inside of the wrapper.

@pbalcer pbalcer merged commit cb74dc9 into oneapi-src:main Jan 15, 2025
73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level-zero L0 adapter specific issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants