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

Add zelReloadDrivers(flags) API #191

Open lisanna-dettwyler opened 2 weeks ago

lisanna-dettwyler commented 2 weeks ago

Provides a means to re-initialize all of the drivers' library handles and DDI tables. The value of flags must match what was provided to zeInit(flags).

lisanna-dettwyler commented 2 weeks ago

I guess the theory here is that an application could use this to guarantee a clean slate if hardware resources change out from underneath a driver library.

The only concerns I have with this are that it may be more straightforward to have it re-init only a passed in driver handle rather than all of them, but I couldn't get the handle typecasting to work inside of ze_loader_api.cpp; that I'm adding another location where I've manually written out something that is normally autogenerated; and that the debug trace logging functions aren't available for any of the failure cases.

I still need to add a null driver test to verify that this works.