MCPcopy Create free account
hub / github.com/Niko1221/Strata / hold

Method hold

engine/src/core/expert_source.cpp:7282–7293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7280}
7281
7282void ForesightSwap::hold(int64_t layer, int32_t expert) {
7283 if (layer < 0 || layer >= n_layers || expert < 0 || expert >= n_expert) return;
7284 std::lock_guard<std::mutex> smu_lk(smu_);
7285 const size_t key = (size_t) (layer * n_expert + expert);
7286 const int s = where[key];
7287 where[key] = kHeld;
7288 if (s < 0) return;
7289 Slot& sl = slot[(size_t) (layer * slots + s)];
7290 sl.expert = kDropped; // `loading` and `last_ref` stay: a copy in flight and a window that read it are waited for
7291 sl.ready = false;
7292 ++dropped;
7293}
7294
7295void ForesightSwap::unhold(int64_t layer, int32_t expert) {
7296 if (layer < 0 || layer >= n_layers || expert < 0 || expert >= n_expert) return;

Callers 3

fs_hold_stagedMethod · 0.80
install_residentMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected