Skip to main content

Module module_cache

Module module_cache 

Source
Expand description

Host-side module-binary cache and EU-occupancy heuristics.

Compiling SPIR-V to an Intel native binary (the zeModuleCreate JIT) is expensive. Level Zero lets an application retrieve the compiled native binary via zeModuleGetNativeBinary and re-create the module from it on a later run, skipping the JIT. The cache bookkeeping — keying compiled binaries by a stable hash of the SPIR-V input and build flags, tracking hit / miss statistics — is pure host-side logic modelled here by ModuleBinaryCache.

This module also provides EuOccupancyAdvisor, a tile-size heuristic that consumes an EU-utilisation fraction (which on hardware comes from sysman zesDeviceProcessesGetState) and recommends a workgroup size. The heuristic itself is CPU-testable; only the utilisation reading is device-gated.

Structs§

EuOccupancyAdvisor
Recommends a workgroup size from an EU-utilisation fraction.
ModuleBinaryCache
An in-memory cache mapping (SPIR-V, build flags) to compiled native binaries, with hit/miss accounting.
NativeBinary
A compiled Intel native binary retrieved from zeModuleGetNativeBinary.

Functions§

spirv_cache_key
64-bit FNV-1a hash over a SPIR-V word stream and its build flags.