level-zero icon indicating copy to clipboard operation
level-zero copied to clipboard

Add zelReloadDrivers(flags) API

Open lisanna-dettwyler opened this issue 1 year ago • 1 comments

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 avatar Sep 03 '24 18:09 lisanna-dettwyler

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.

lisanna-dettwyler avatar Sep 04 '24 19:09 lisanna-dettwyler