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

Function llama_kv_cache_cell_max

llama.cpp:1735–1743  ·  view source on GitHub ↗

find how many cells are currently in use

Source from the content-addressed store, hash-verified

1733
1734// find how many cells are currently in use
1735static int32_t llama_kv_cache_cell_max(const struct llama_kv_cache & cache) {
1736 for (uint32_t i = cache.size - 1; i > 0; --i) {
1737 if (cache.cells[i].pos >= 0 && !cache.cells[i].seq_id.empty()) {
1738 return i + 1;
1739 }
1740 }
1741
1742 return 0;
1743}
1744
1745static void llama_kv_cache_clear(struct llama_kv_cache & cache) {
1746 for (int32_t i = 0; i < (int32_t) cache.size; ++i) {

Callers 1

llama_decode_internalFunction · 0.85

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected