SWDEV-440004 - Fix Unit_hipHostMalloc_AllocateUseMoreThanAvailGPUMemory

int(32bit -2147483648~2147483647) could overflow if allocated size >= 2GB(2147483648).
Use size_t instead.

Change-Id: I1511574464b96fcb09eae18daa5ee9f56d817505
Signed-off-by: Lang Yu <Lang.Yu@amd.com>


[ROCm/hip-tests commit: c7aa062b66]
This commit is contained in:
Lang Yu
2024-01-08 13:35:49 +08:00
committato da Rakesh Roy
parent f83e9be99c
commit 7e5e392f2d
@@ -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