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

Provide "dummy" backend for unit-testing application's L0 API usage #117

Open eero-t opened 1 year ago

eero-t commented 1 year ago

In my own project, I've mocked every Sysman call used, so that I can verify code handling properly any of them working or erroring: https://github.com/collectd/collectd/blob/collectd-6.0/src/gpu_sysman_test.c

But it would be nice to avoid every L0 API user needing to duplicate the same work. Could level-zero frontend provide a dummy backend, that depending on e.g. env variable, either returns synthetized value according to some pre-determined formula (so that this value can be validated), or an error for the Nth Sysman call?