]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
ggml : remove redundant set of contexts used field (ggml/978)
authorDaniel Bevenius <redacted>
Wed, 16 Oct 2024 18:10:01 +0000 (20:10 +0200)
committerGeorgi Gerganov <redacted>
Wed, 23 Oct 2024 13:50:02 +0000 (16:50 +0300)
commitc19af0acb1fe6d0fdbecadd8483c1fbe5d68d095
tree5742223498b9a5abc2418783781de36c1b0db833
parentac113a0feee0935b2018312f7bc8d7a646b117ed
ggml : remove redundant set of contexts used field (ggml/978)

This commit removes the setting of the `used` field of the contexts in
the global state (g_state) in `ggml_init`.

The motivation for this change is that I believe that this additional
initialization might not be required after the changes in Commit
45fc4fed0b9fb5b1af4a8525cbebb95e11208732 ("sync : latest changes from
whisper.cpp"), which changed the initialization of the contexts field
from `{ 0 }` to `{ { 0 } }`:

```console
             g_state = (struct ggml_state) {
-                /*.contexts =*/ { 0 },
+                /*.contexts =*/ { { 0 } },
             };
```
My understanding is that the `{0}` initialization might not have
zero-initialized all the nested fields in every array element because of
compiler differences, and might have been the reason for having the
explicit setting of the `used` fields to false.
ggml/src/ggml.c