oneapi-src / level-zero-spec

MIT License
18 stars 27 forks source link

Add ZE_API_VERSION_CURRENT_M macro #306

Closed lisanna-dettwyler closed 4 months ago

lisanna-dettwyler commented 6 months ago

This enables preprocessor level API version checks, which can be used to guard code that requires a specific version of the API. For example:

#ifdef ZE_API_VERSION_CURRENT_M
#if ZE_API_VERSION_CURRENT_M >= ZE_MAKE_VERSION(1, 9)

namespace {
  // test content
}

#endif
#endif

Our specific use case is the L0 conformance tests repository. Every time tests of newly released features are added, backwards compatibility with older loader releases is broken. Our users can't always choose which version of the loader they have installed, so our goal is to be able to support all loader releases at least back to v1.15 (spec API 1.8).

lisanna-dettwyler commented 4 months ago

Will be introduced with v1.10 changes