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

Function ggml_hash_insert

ggml.c:15195–15208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15193}
15194
15195size_t ggml_hash_insert(struct ggml_hash_set hash_set, struct ggml_tensor * key) {
15196 size_t i = ggml_hash_find(hash_set, key);
15197
15198 GGML_ASSERT(i != GGML_HASHTABLE_FULL);
15199
15200 if (hash_set.keys[i] == key) {
15201 return GGML_HASHTABLE_ALREADY_EXISTS;
15202 }
15203
15204 // insert
15205 GGML_ASSERT(hash_set.keys[i] == NULL);
15206 hash_set.keys[i] = key;
15207 return i;
15208}
15209
15210size_t ggml_hash_find_or_insert(struct ggml_hash_set hash_set, struct ggml_tensor * key) {
15211 size_t i = ggml_hash_find(hash_set, key);

Callers 3

ggml_visit_parentsFunction · 0.70
ggml_graph_cpyFunction · 0.70

Calls 1

ggml_hash_findFunction · 0.70

Tested by

no test coverage detected