Skip to content

[SYCL][Unittests] Fix unloading of mock images on Windows #19068

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

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

Conversation

steffenlarsen
Copy link
Contributor

The implementation of mock images try to unload the images using __sycl_unregister_lib. However, this is a no-op on Windows under the assumption that shutdown will handle the images. This causes unittests, like RootGroup, to leave dead binaries in the program manager that subsequent test runs may pick up. This commit fixes this issue by having the mock image arrays forciby remove the images from the program manager instead.

The implementation of mock images try to unload the images using
__sycl_unregister_lib. However, this is a no-op on Windows under the
assumption that shutdown will handle the images. This causes unittests,
like RootGroup, to leave dead binaries in the program manager that
subsequent test runs may pick up. This commit fixes this issue by having
the mock image arrays forciby remove the images from the program
manager instead.

Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
@steffenlarsen
Copy link
Contributor Author

Turns out this issue is wider than just the unittests. Converting to draft with the expectation of closing this in favor of a runtime library fix: #19074

@steffenlarsen steffenlarsen marked this pull request as draft June 19, 2025 12:51
steffenlarsen pushed a commit that referenced this pull request Jun 23, 2025
Changes the `MockDeviceImage` and `MockDeviceImageArray` to static
variables so that they're not created in each test case. Relates to
#19068 and #19074. Fixes #18892.

Signed-off-by: Michael Aziz <michael.aziz@intel.com>
@steffenlarsen steffenlarsen marked this pull request as ready for review June 24, 2025 09:54
@steffenlarsen
Copy link
Contributor Author

The RootGroup test provoking a failure has been fixed separately, but this change should still make the mock images more robust to future tests wanting to leverage the functionality.

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.

1 participant