[SYCL] Improve ODS negative filter implementation #7453
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The negative filter implementation for ONEAPI_DEVICE_SELECTOR uses a map to keep track of blacklisted devices. The keys used by this map were originally device addresses in a vector container which are not very robust because vectors can potentially move their data to other locations and the device addresses could change thus invalidating the blacklist map. Even though in the source code the resizing of the vector only happens after we are done with the blacklist, you never know what tricks the compiler might pull on us. We use device numbers instead which are unique for each device in a platform and do not change during the function execution.