Skip to content
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

Level zero images and samplers: native handles and query support #1341

Open
aarongreig opened this issue Feb 14, 2024 · 2 comments
Open

Level zero images and samplers: native handles and query support #1341

aarongreig opened this issue Feb 14, 2024 · 2 comments
Labels
images UR images

Comments

@aarongreig
Copy link
Contributor

The level zero API does not natively support querying out information about its image and sampler handles. We could implement this support by storing all the information that can be queried out in the UR handle during construction, but this falls over if we ever implement SamplerCreateWithNativeHandle or ImageCreateWithNativeHandle - these are ways to construct the objects without providing all the information we'd need to store to support the queries.

In practice not supporting these queries isn't a big deal for current users of UR images, sycl image support works just fine on level zero because the sycl implementation stores image info in its own objects rather than relying on the backend API. In principal there's maybe an argument to be made that if something resembling these queries is supported by anything we want to implement with UR then they should be supported by UR, the fact that the sycl implementation we currently support doesn't need them doesn't necessarily reflect the requirements we need to encode in the spec.

As I see it there's two options:

  • Image and sampler queries remain a non-optional feature in the spec, we say we are going to implement them for level zero with the caveat that they will not work for objects created from native handles. This would be tricky to communicate clearly, and if we ever get to the point of supporting native handle images and image queries on the level zero adapter I feel it would inevitably lead to someone trying to use them together and being confused when it doesn't work.
  • Image and sampler queries are all made optional, either by the definition of optional described in Explicitly define which info queries are optional. #1332 or by adding some "image queries" device info flag. Also would probably require a bit of clarification in the spec for the image support flag around what entry points and functionality reporting "image support" actually means. This could have the same problem as the first option in that it's unintuitive and not easy to communicate clearly - like we can write it in the spec but whether that's enough to prevent someone seeing that the level zero adapter is reporting image support and then being confused when the queries don't work is debatable.
@aarongreig aarongreig added the needs-discussion This needs further discussion label Feb 14, 2024
@aarongreig
Copy link
Contributor Author

aarongreig commented Feb 14, 2024

actually I just double checked and maybe level zero can support the queries natively never mind, zeImageGetProperties is a confusing api

@aarongreig aarongreig reopened this Feb 14, 2024
@kbenzie kbenzie added images UR images and removed needs-discussion This needs further discussion labels Apr 10, 2024
@aarongreig
Copy link
Contributor Author

We concluded at some point to just make these optional

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
images UR images
Projects
None yet
Development

No branches or pull requests

2 participants