zero initialize gfbuf and gbbuf

This commit is contained in:
xaedes 2023-06-12 20:43:48 +02:00
parent 32dc227284
commit cb469f7efb
No known key found for this signature in database
GPG key ID: 30030EDD817EA2B1

View file

@ -3218,6 +3218,9 @@ int main(int argc, char ** argv) {
struct ggml_tensor * gfbuf = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, sizeof(struct ggml_cgraph) / ggml_type_size(GGML_TYPE_I32) + (sizeof(struct ggml_cgraph) % ggml_type_size(GGML_TYPE_I32) ? 1 : 0));
struct ggml_tensor * gbbuf = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, sizeof(struct ggml_cgraph) / ggml_type_size(GGML_TYPE_I32) + (sizeof(struct ggml_cgraph) % ggml_type_size(GGML_TYPE_I32) ? 1 : 0));
memset(gfbuf->data, 0, ggml_nbytes(gfbuf));
memset(gbbuf->data, 0, ggml_nbytes(gbbuf));
struct ggml_cgraph * gf = (struct ggml_cgraph *) gfbuf->data;
struct ggml_cgraph * gb = (struct ggml_cgraph *) gbbuf->data;