oneapi-src / unified-runtime

https://oneapi-src.github.io/unified-runtime/
Other
37 stars 115 forks source link

CL adapter: add consistent and useful fail state if entry point extension isn't supported. #1362

Open aarongreig opened 8 months ago

aarongreig commented 8 months ago

We have a few entry point implementations in the CL adapter that rely on functions from OpenCL extensions, such as the USM functionality. Right now if we find that the CL extension function needed for an entry point isn't available we return UR_RESULT_ERROR_INVALID_VALUE, which isn't helpful and doesn't fit with the few instances where we have a spec definition of what should happen in these cases (for instance the UR_RESULT_ERROR_INVALID_OPERATION return from urUSMHostAlloc).

We should for sure just change the return code from that helper function, and I think this should be accompanied by a spec pass to make sure that, wherever appropriate, we have a return code defined for when a backend doesn't support an entry point with an associated device info query. For example the host pipe functions are similar to the USM ones in that there is an associated device info query for support, but their spec doesn't define the error code that should be returned if that support isn't there.

alycm commented 8 months ago

Discussed 2024-02-28: An error code in this case makes sense.