find how many cells are currently in use
| 1733 | |
| 1734 | // find how many cells are currently in use |
| 1735 | static 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 | |
| 1745 | static void llama_kv_cache_clear(struct llama_kv_cache & cache) { |
| 1746 | for (int32_t i = 0; i < (int32_t) cache.size; ++i) { |
no test coverage detected