MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / get_slot

Method get_slot

examples/server/server.cpp:652–671  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

650 }
651
652 llama_client_slot* get_slot(int id) {
653 int64_t t_last = ggml_time_us();
654 llama_client_slot *last_used = nullptr;
655
656 for (llama_client_slot & slot : slots)
657 {
658 if (slot.id == id && slot.available())
659 {
660 return &slot;
661 }
662
663 if (slot.available() && slot.t_last_used < t_last)
664 {
665 last_used = &slot;
666 t_last = slot.t_last_used;
667 }
668 }
669
670 return last_used;
671 }
672
673 bool launch_slot_with_data(llama_client_slot* &slot, json data) {
674 slot_params default_params;

Callers

nothing calls this directly

Calls 2

availableMethod · 0.80
ggml_time_usFunction · 0.50

Tested by

no test coverage detected