llama.cpp/ggml
Raul Torres befefdaca9 Refactor `is_matched_graph` for better maintainability
** Description of the problem **

`is_matched_graph` implementation is a bit confusing because is not
so easy to understand the comparison between the current graph and
the properties of the cached graphs. The usage of `continue` to
skip graphs of different sizes, and a combination of a `break` and
a flag to exit the inner loop to simulate a `continue` in the outer
loop, make it very difficult to follow the logic. Moreover, the
passed arguments and the function name do not match the intended
semantics properly.

** Proposed solution **

* Rename the function to `is_matched_graph_in_cache` to better
  reflect its intention.
* Pass only the graph cache list instead of the whole context.
* Enclose the graph node traversal check inside a lambda to avoid
  having to use statements that break the control flow arbitrarily.
* Rename variables in a more meaningful way.
* Update the corresponding function call.
2025-12-04 13:01:55 +00:00
..
cmake ggml: Skip backend library linking code when GGML_BACKEND_DL=ON (#15094) 2025-08-07 13:45:41 +02:00
include build : move _WIN32_WINNT definition to headers (#17736) 2025-12-04 07:04:02 +01:00
src Refactor `is_matched_graph` for better maintainability 2025-12-04 13:01:55 +00:00
.gitignore vulkan : cmake integration (#8119) 2024-07-13 18:12:39 +02:00
CMakeLists.txt build : move _WIN32_WINNT definition to headers (#17736) 2025-12-04 07:04:02 +01:00