oneapi-src / level-zero

oneAPI Level Zero Specification Headers and Loader
https://spec.oneapi.com/versions/latest/elements/l0/source/index.html
MIT License
208 stars 90 forks source link

zesDriverEventListen[Ex] timeout return code #63

Open kevin-harms opened 3 years ago

kevin-harms commented 3 years ago

I suggest adding an explicit timeout return code for zesDriverEventListen[Ex] calls. Right now, the user has to infer a timeout occurred when ze_result_t == ZE_SUCCESS and pNumDeviceEvents = 0. The specification isn't 100% clear that a timeout will result in the pNumDeviceEvents being cleared. An explicit error code leaves no doubt. The spec is also ambitious in stating that the timeout will only occur once the time expires. It seems like an -EINTR or similar type error could cause a timeout to occur before the time expires. Perhaps the spec should allow for a timeout to occur before the time expires?

https://spec.oneapi.com/level-zero/latest/sysman/api.html#zesdrivereventlistenex

Kerilk commented 3 years ago

It should be noted that ZE_RESULT_NOT_READY is mentioned as a return code for the function in the timeout parameter documentation, but does not appear as a valid return code for the function.