From cede497cb253da2ee7410004204c260fb4b14a5f Mon Sep 17 00:00:00 2001 From: Satyanvesh Dittakavi Date: Thu, 17 Sep 2020 10:43:53 +0000 Subject: [PATCH] Print size_t variables with %zu Change-Id: I02bb073b07e9efd03dea2b76b6ba1bd2f552bcaa Total Memory is not being printed correctly with %u. %zu represents size_t variables appropriately. --- rocclr/hip_memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rocclr/hip_memory.cpp b/rocclr/hip_memory.cpp index b0e1d6abdd..63685f275b 100755 --- a/rocclr/hip_memory.cpp +++ b/rocclr/hip_memory.cpp @@ -124,7 +124,7 @@ hipError_t ihipMalloc(void** ptr, size_t sizeBytes, unsigned int flags) if (*ptr == nullptr) { size_t free = 0, total =0; hipMemGetInfo(&free, &total); - LogPrintfError("Allocation failed : Device memory : required :%u | free :%u | total :%u \n", sizeBytes, free, total); + LogPrintfError("Allocation failed : Device memory : required :%zu | free :%zu | total :%zu \n", sizeBytes, free, total); return hipErrorOutOfMemory; }