Skip to content

Conversation

@KseniyaTikhomirova
Copy link
Contributor

SYCL 2020 spec says: "The free function aspect_selector has several overloads, each of which returns a selector object that selects a SYCL device from any supported SYCL backend which contains all the requested aspects, i.e. for the specific device dev and each aspect devAspect from aspectList dev.has(devAspect) equals true. If no aspects are passed in, the generated selector behaves like default_selector_v."

So original impl in intel/llvm fallbacks to default selector when require aspect list is empty and disregards emptiness of deny list. (please don't get it like we return device with aspects in deny list, it is only about score).

Although it seems to be more correct that "the aspect selector is guaranteed to be the same as the default selector only in the case when there are no aspects in either list".

Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
@KseniyaTikhomirova
Copy link
Contributor Author

KseniyaTikhomirova commented Dec 18, 2025

I confirmed my understanding with @gmlueck.
current intel/llvm impl: https://github.com/intel/llvm/blob/sycl/sycl/source/device_selector.cpp#L248
the answer was:

I looked at the code more closely now. I think the spec is saying the that behavior of the aspect selector is guaranteed to be the same as the default selector only in the case when there are no aspects in either list. Therefore, I think the code on line 248 should be:
if ((RequireList.size() > 0) || (DenyList.size() > 0) {

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