File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -4579,6 +4579,11 @@ struct ggml_context * ggml_init(struct ggml_init_params params) {
4579
4579
return NULL;
4580
4580
}
4581
4581
4582
+ // allow to call ggml_init with 0 size
4583
+ if (params.mem_size == 0) {
4584
+ params.mem_size = GGML_MEM_ALIGN;
4585
+ }
4586
+
4582
4587
const size_t mem_size = params.mem_buffer ? params.mem_size : GGML_PAD(params.mem_size, GGML_MEM_ALIGN);
4583
4588
4584
4589
*ctx = (struct ggml_context) {
Original file line number Diff line number Diff line change @@ -5406,7 +5406,7 @@ void llama_backend_init(bool numa) {
5406
5406
5407
5407
// needed to initialize f16 tables
5408
5408
{
5409
- struct ggml_init_params params = { 1 , NULL , false };
5409
+ struct ggml_init_params params = { 0 , NULL , false };
5410
5410
struct ggml_context * ctx = ggml_init (params);
5411
5411
ggml_free (ctx);
5412
5412
}
You can’t perform that action at this time.
0 commit comments