OpenCL Offline Binary Compatibility Query Before Program Load
0 reputation · 10 Jan 2021, 09:10 UTC
Cached OpenCL Offline Binary Device Compatibility
Goal: load a previously built OpenCL program binary on a repeatable build machine only when the binary is compatible with the target OpenCL device, without relying on trial-and-error calls to clCreateProgramWithBinary.
Constraint: OpenCL 1.2 through 3.0 does not standardize binary compatibility across vendors, driver versions, or device revisions, and the specification provides no pre-load query to confirm that a cached binary matches the current device. Device enumeration order is implementation-defined, so selection must use device attributes rather than index.
Uncertainty: whether an application can safely validate binary suitability before load, or must attempt clCreateProgramWithBinary and handle CL_INVALID_BINARY after the fact.
Questions:
- Is there a standardized OpenCL API or extension to query cached binary compatibility against a device before program creation?
- Which device attributes should be compared to decide that a saved binary remains valid across driver updates?
- What optional OpenCL 3.0 features must be rechecked when reusing binaries built on a different implementation?