MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / ggml_hash_find

Function ggml_hash_find

subprojects/llama.cpp/ggml/src/ggml-impl.h:253–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251}
252
253static size_t ggml_hash_find(const struct ggml_hash_set * hash_set, const struct ggml_tensor * key) {
254 size_t h = ggml_hash(key) % hash_set->size;
255
256 // linear probing
257 size_t i = h;
258 while (ggml_bitset_get(hash_set->used, i) && hash_set->keys[i] != key) {
259 i = (i + 1) % hash_set->size;
260 if (i == h) {
261 // visited all hash table entries -> not found
262 return GGML_HASHSET_FULL;
263 }
264 }
265 return i;
266}
267
268static bool ggml_hash_contains(const struct ggml_hash_set * hash_set, struct ggml_tensor * key) {
269 size_t i = ggml_hash_find(hash_set, key);

Callers 13

ggml_compute_backwardFunction · 0.85
ggml_visit_parents_graphFunction · 0.85
ggml_graph_cpyFunction · 0.85
ggml_graph_get_gradFunction · 0.85
ggml_graph_get_grad_accFunction · 0.85
dup_graphFunction · 0.85
graph_copy_dup_tensorFunction · 0.85
graph_copy_init_tensorFunction · 0.85
ggml_backend_graph_copyFunction · 0.85
ggml_hash_containsFunction · 0.85

Calls 2

ggml_hashFunction · 0.85
ggml_bitset_getFunction · 0.85

Tested by

no test coverage detected