From cb224645e17dca23f966735927c3143e5979198d Mon Sep 17 00:00:00 2001 From: Gilad S Date: Tue, 15 Oct 2024 02:55:13 +0300 Subject: [PATCH] fix: page align to `TENSOR_ALIGNMENT` --- ggml/src/ggml.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ggml/src/ggml.c b/ggml/src/ggml.c index 8c4766469..0deb2f90e 100644 --- a/ggml/src/ggml.c +++ b/ggml/src/ggml.c @@ -387,7 +387,7 @@ void ggml_log_callback_default(enum ggml_log_level level, const char * text, voi void * ggml_aligned_malloc(size_t size) { #if defined(_MSC_VER) || defined(__MINGW32__) - return _aligned_malloc(size, GGUF_DEFAULT_ALIGNMENT); + return _aligned_malloc(size, TENSOR_ALIGNMENT); #else if (size == 0) { GGML_LOG_WARN("Behavior may be unexpected when allocating 0 bytes for ggml_aligned_malloc!\n"); @@ -416,7 +416,7 @@ void * ggml_aligned_malloc(size_t size) { #elif GGML_USE_METAL int result = posix_memalign(&aligned_memory, sysconf(_SC_PAGESIZE), size); #else - int result = posix_memalign(&aligned_memory, GGUF_DEFAULT_ALIGNMENT, size); + int result = posix_memalign(&aligned_memory, TENSOR_ALIGNMENT, size); #endif if (result != 0) { // Handle allocation failure