fix: increase page size to 32 on iOS

This commit is contained in:
Gilad S 2024-10-15 03:29:23 +03:00
parent 1516f7b790
commit 4455c7f073

View file

@ -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