From 19b361281adddac6998bb1488164d842713f5a41 Mon Sep 17 00:00:00 2001 From: Wilkin Chau Date: Thu, 28 Feb 2019 22:42:46 +0000 Subject: [PATCH] Fix hipMemset3D test Calculate the allocated size based on the width, height and depth. [ROCm/clr commit: 99540373cf1459fcb5b48a055a8b7d549594b864] --- projects/clr/hipamd/src/hip_memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/clr/hipamd/src/hip_memory.cpp b/projects/clr/hipamd/src/hip_memory.cpp index ef5f80aee4..8e29bee68e 100644 --- a/projects/clr/hipamd/src/hip_memory.cpp +++ b/projects/clr/hipamd/src/hip_memory.cpp @@ -350,7 +350,7 @@ hipError_t ihipMallocPitch(void** ptr, size_t* pitch, size_t width, size_t heigh } // hardcoded 128 bytes *pitch = ((((int)width - 1) / 128) + 1) * 128; - const size_t sizeBytes = (*pitch) * height; + const size_t sizeBytes = (*pitch) * height * ((depth==0) ? 1 : depth); auto ctx = ihipGetTlsDefaultCtx();