Skip to content

Commit 8465211

Browse files
JohannesGaesslerjordankanter
authored andcommitted
CUDA: fix DEBUG_CUDA_MALLOC (ggml-org#5729)
1 parent 6ebeebd commit 8465211

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ggml-cuda.cu

+4-4
Original file line numberDiff line numberDiff line change
@@ -8079,8 +8079,8 @@ static void * ggml_cuda_pool_malloc_leg(int device, size_t size, size_t * actual
80798079
*actual_size = look_ahead_size;
80808080
g_cuda_pool_size[device] += look_ahead_size;
80818081
#ifdef DEBUG_CUDA_MALLOC
8082-
fprintf(stderr, "%s[%d]: %d buffers, max_size = %u MB, pool_size = %u MB, requested %u MB\n", __func__, id, nnz,
8083-
(uint32_t)(max_size/1024/1024), (uint32_t)(g_cuda_pool_size[id]/1024/1024), (uint32_t)(size/1024/1024));
8082+
fprintf(stderr, "%s[%d]: %d buffers, max_size = %u MB, pool_size = %u MB, requested %u MB\n", __func__, device, nnz,
8083+
(uint32_t)(max_size/1024/1024), (uint32_t)(g_cuda_pool_size[device]/1024/1024), (uint32_t)(size/1024/1024));
80848084
#endif
80858085
return ptr;
80868086
}
@@ -8166,7 +8166,7 @@ static void * ggml_cuda_pool_malloc_vmm(int device, size_t size, size_t * actual
81668166
g_cuda_pool_used[device] += size;
81678167

81688168
#ifdef DEBUG_CUDA_MALLOC
8169-
printf("cuda pool[%d]: allocated %llu bytes at %llx [%s]\n", id, (unsigned long long) size, ptr);
8169+
printf("cuda pool[%d]: allocated %llu bytes at %llx\n", device, (unsigned long long) size, ptr);
81708170
#endif
81718171

81728172
return ptr;
@@ -8176,7 +8176,7 @@ static void ggml_cuda_pool_free_vmm(int device, void * ptr, size_t size) {
81768176
scoped_spin_lock lock(g_cuda_pool_lock);
81778177

81788178
#ifdef DEBUG_CUDA_MALLOC
8179-
printf("cuda pool[%d]: freed %llu bytes at %llx\n", id, (unsigned long long) size, ptr);
8179+
printf("cuda pool[%d]: freed %llu bytes at %llx\n", device, (unsigned long long) size, ptr);
81808180
#endif
81818181

81828182
g_cuda_pool_used[device] -= size;

0 commit comments

Comments
 (0)