Skip to content

Conversation

@steffenlarsen
Copy link
Contributor

Kernel bundles attempt to remove duplicate devices from a passed device list. This is done through the removeDuplicateDevices function which creates a set through comparing devices by their native handles. However, the getNative member function on device_impl used to get these handles will retain the native devices if the backend is OpenCL. For root devices this will not have an effect, but on sub-devices this can potentially lead to a leak of the devices. As a fix this commit compares the PI devices rather than the native handles.

Kernel bundles attempt to remove duplicate devices from a passed device
list. This is done through the removeDuplicateDevices function which
creates a set through comparing devices by their native handles.
However, the getNative member function on device_impl used to get these
handles will retain the native devices if the backend is OpenCL. For
root devices this will not have an effect, but on sub-devices this can
potentially lead to a leak of the devices. As a fix this commit compares
the PI devices rather than the native handles.

Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
@steffenlarsen steffenlarsen requested a review from a team as a code owner September 8, 2022 11:01
@steffenlarsen steffenlarsen merged commit c527a0e into intel:sycl Sep 8, 2022
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.

2 participants