Skip to content

Commit 4455c7f

Browse files
committed
fix: increase page size to 32 on iOS
1 parent 1516f7b commit 4455c7f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ggml/src/ggml.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,8 @@ void * ggml_aligned_malloc(size_t size) {
414414
break;
415415
}
416416
#elif GGML_USE_METAL
417-
int result = posix_memalign(&aligned_memory, sysconf(_SC_PAGESIZE), size);
417+
const auto page_size = sysconf(_SC_PAGESIZE);
418+
int result = posix_memalign(&aligned_memory, MAX(TENSOR_ALIGNMENT, page_size), sysconf(_SC_PAGESIZE), size);
418419
#else
419420
int result = posix_memalign(&aligned_memory, TENSOR_ALIGNMENT, size);
420421
#endif

0 commit comments

Comments
 (0)