From 4455c7f0737f15180d2f386f344c3cb214af3aba Mon Sep 17 00:00:00 2001 From: Gilad S Date: Tue, 15 Oct 2024 03:29:23 +0300 Subject: [PATCH] fix: increase page size to `32` on iOS --- ggml/src/ggml.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ggml/src/ggml.c b/ggml/src/ggml.c index 0deb2f90e..a92600e01 100644 --- a/ggml/src/ggml.c +++ b/ggml/src/ggml.c @@ -414,7 +414,8 @@ void * ggml_aligned_malloc(size_t size) { break; } #elif GGML_USE_METAL - int result = posix_memalign(&aligned_memory, sysconf(_SC_PAGESIZE), size); + const auto page_size = sysconf(_SC_PAGESIZE); + int result = posix_memalign(&aligned_memory, MAX(TENSOR_ALIGNMENT, page_size), sysconf(_SC_PAGESIZE), size); #else int result = posix_memalign(&aligned_memory, TENSOR_ALIGNMENT, size); #endif