reprospect.tools.ncu.cacher module
- class reprospect.tools.ncu.cacher.Cacher(*, directory: str | Path | None = None)View on GitHub
Bases:
CacherCacher tailored to
ncuresults.ncurequire quite some time to acquire results, especially when there are many kernels to profile and/or many metrics to collect.On a cache hit, the cacher will serve:
<cache_key>.ncu-repfile.logfile
On a cache miss,
ncuis launched and the cache entry populated accordingly.Note
It is assumed that hashing is faster than running
ncuitself.Warning
The cache should not be shared between machines, since there may be differences between machines that influence the results but are not included in the hashing.
- __init__(*, directory: str | Path | None = None)View on GitHub
- database: sqlite3.Connection | None
- hash(**kwargs) blake3View on GitHub
- hash_impl(*, command: Command) blake3View on GitHub
Hash based on:
ncuversionncuoptions (but not the output and log files)executable content
executable arguments
linked libraries
environment
- populate(directory: Path, **kwargs) NoneView on GitHub
When there is a cache miss, call
reprospect.tools.ncu.Session.run(). Fill the directory with the artifacts.
- run(command: Command, **kwargs) EntryView on GitHub
On a cache hit, copy files from the cache entry.