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

Function window_init

engine/metal/src/engine/window.cpp:3970–3982  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3968 }
3969}
3970bool window_init(void* w, const strata::core::ModelGeometry& g, strata::core::SessionState& ss, int max_t, int64_t max_cells,
3971 int64_t* n_vocab, std::string& err) {
3972 Window* x = (Window*) w;
3973 if (!x->ready()) {
3974 if (g_shard1.empty()) { err = "metal window: the model shard is not set (--native SHARD1)"; return false; }
3975 if (!x->init(g, ss, g_shard1, MAXT, max_cells, err)) return false;
3976 window_register(w);
3977 if (!mtp_load_pending(x, err)) return false;
3978 }
3979 x->set_max_t(max_t);
3980 *n_vocab = x->vocab();
3981 return true;
3982}
3983bool window_ensure(const strata::core::ModelGeometry& g, strata::core::SessionState& ss, int64_t max_cells, std::string& err) {
3984 int64_t nv = 0;
3985 return window_init(window_create(), g, ss, MAXT, max_cells, &nv, err);

Callers 4

verify.cppFile · 0.85
window_ensureFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 7

window_registerFunction · 0.85
mtp_load_pendingFunction · 0.85
set_max_tMethod · 0.80
readyMethod · 0.65
emptyMethod · 0.45
initMethod · 0.45
vocabMethod · 0.45

Tested by

no test coverage detected