From 7e5e392f2d50fda271b7bbd13629728b101d6779 Mon Sep 17 00:00:00 2001 From: Lang Yu Date: Mon, 8 Jan 2024 13:35:49 +0800 Subject: [PATCH] SWDEV-440004 - Fix Unit_hipHostMalloc_AllocateUseMoreThanAvailGPUMemory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit int(32bit -2147483648~2147483647) could overflow if allocated size >= 2GB(2147483648). Use size_t instead. Change-Id: I1511574464b96fcb09eae18daa5ee9f56d817505 Signed-off-by: Lang Yu [ROCm/hip-tests commit: c7aa062b66dab628e6f4813b938638413e5b1120] --- projects/hip-tests/catch/unit/memory/hipHostMalloc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/hip-tests/catch/unit/memory/hipHostMalloc.cc b/projects/hip-tests/catch/unit/memory/hipHostMalloc.cc index edc6e128fc..6e4c06eb24 100644 --- a/projects/hip-tests/catch/unit/memory/hipHostMalloc.cc +++ b/projects/hip-tests/catch/unit/memory/hipHostMalloc.cc @@ -48,7 +48,7 @@ static constexpr size_t sizeBytes{numElements * sizeof(int)}; #if HT_AMD static __global__ void kerTestMemAccess(char *buf) { - int myId = threadIdx.x + blockDim.x * blockIdx.x; + size_t myId = threadIdx.x + blockDim.x * blockIdx.x; buf[myId] = VALUE; } #endif