KhronosGroup / SYCL-Docs

SYCL Open Source Specification
Other
114 stars 67 forks source link

Clarify behavior when wrong property is passed #643

Open gmlueck opened 1 week ago

gmlueck commented 1 week ago

This question came from our development team.

The specification does not say what should happen if an incompatible property is passed to an API that takes a property_list. Here is a list of the APIs that take a property_list. I don't think any of them currently specify the behavior when an incompatible property is passed.

I think there are two reasonable options:

  1. Mandate that these APIs throw errc::invalid in this case.
  2. Add a precondition that the properties are compatible with the given API, which means that the behavior is undefined if they are not.
KseniyaTikhomirova commented 1 week ago

I want to add one more thing to consider against option #2. What to return when someone sends incorrect runtime property and we ignore it stating that it is UB but then call get/has_property with it? Then it seems to be declared as UB also but in reality it will work and user will never know that the scenario is incorrect.