Bounded-LRU cache of compiled MPSGraph executables.
Thread-safe. Stores raw CompiledExecutable pointers and
destroys them via destroy_executable on eviction or
destruction.
Constructors
1ExecutableCache
void ExecutableCache()Construct an empty cache with the default LRU cap (32 entries). Use set_max_entries to override before inserting.
Destructor
1~ExecutableCache
void ~ExecutableCache()Destructor — releases every cached CompiledExecutable via destroy_executable before the map is torn down.
Static methods
1Operators
1Methods
5Release every stored executable.
Look up an executable.
Returns the borrowed pointer on hit (and bumps the entry to
most-recent in the LRU order) or nullptr on miss.
Insert exec under key, taking ownership. Replaces any existing entry (releasing the previous executable). If the resulting size exceeds max_entries, evicts least-recently used entries until back at capacity.
Override the LRU cap. Honoured by subsequent inserts; existing entries are not evicted retroactively. Default is 32.
Number of currently-cached entries.