Sarek_opencl.Opencl_disk_cachemodule Cache = Spoc_framework_registry.Framework_cachetype target = {platform_name : string;platform_version : string;device_name : string;device_version : string;driver_version : string;build_options : string;}Everything that changes the binary a driver produces from a source.
A driver update changes driver_version (and usually device_version); a different compiler front end changes platform_*; the screened and capability-gated option string is build_options. Any difference must miss, so each is a key component.
val key : target -> source:string -> stringThe cache key of source built for target.
The program binary holds every kernel of the source, so the key is per source, not per kernel name: keying by name would store one identical binary per kernel of a multi-kernel source. The fixed name below only fills the shared key shape.
An entry is the binary prefixed by its own MD5, so a truncated or bit-rotted file is rejected here instead of being handed to the driver. A driver is free to accept garbage; MD5 is for corruption, not for an adversary.
The stored binary for key, or None on a miss, a disabled cache, an unusable cache directory, or a corrupt entry. Never raises: the cache is an optimisation.