From 20860daee29b94038b639eb95cc4785e52006268 Mon Sep 17 00:00:00 2001 From: slaren Date: Sat, 23 Dec 2023 13:42:18 +0100 Subject: [PATCH] clarify granularity --- ggml-cuda.cu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ggml-cuda.cu b/ggml-cuda.cu index bf53cef73..a488e4082 100644 --- a/ggml-cuda.cu +++ b/ggml-cuda.cu @@ -6669,10 +6669,10 @@ static void * ggml_cuda_pool_malloc_vmm(size_t size, size_t * actual_size) { prop.location.id = id; // get the minimum allocation granularity for this device - size_t granularity = 0; + size_t granularity; CU_CHECK(cuMemGetAllocationGranularity(&granularity, &prop, CU_MEM_ALLOC_GRANULARITY_MINIMUM)); - // round up to the nearest granularity + // round up to the next multiple of the granularity reserve_size = granularity * ((reserve_size + granularity - 1) / granularity); GGML_ASSERT(g_cuda_pool_size[id] + reserve_size <= CUDA_POOL_VMM_MAX_SIZE);