From 3a6e8aadbdcd847b2c8f13919561c8c7085ecaa3 Mon Sep 17 00:00:00 2001 From: Rahul Garg Date: Mon, 4 Jun 2018 18:00:22 +0530 Subject: [PATCH] Fix depth value for 3D allocations [ROCm/clr commit: fa6ce7a724e6db93c0ca24dac220556f724f1891] --- projects/clr/hipamd/src/hip_memory.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/clr/hipamd/src/hip_memory.cpp b/projects/clr/hipamd/src/hip_memory.cpp index dbaec8e1d8..fa2be7c1ab 100644 --- a/projects/clr/hipamd/src/hip_memory.cpp +++ b/projects/clr/hipamd/src/hip_memory.cpp @@ -363,7 +363,7 @@ hipError_t ihipMallocPitch(void** ptr, size_t* pitch, size_t width, size_t heigh hsa_ext_image_descriptor_t imageDescriptor; imageDescriptor.width = *pitch; imageDescriptor.height = height; - imageDescriptor.depth = 0; // depth; + imageDescriptor.depth = depth; imageDescriptor.array_size = 0; if (depth == 0) imageDescriptor.geometry = HSA_EXT_IMAGE_GEOMETRY_2D; @@ -778,11 +778,11 @@ hipError_t hipMalloc3DArray(hipArray** array, const struct hipChannelFormatDesc* HIP_SET_DEVICE(); hipError_t hip_status = hipSuccess; - if(array==NULL ) - { + if(array==NULL ) + { hip_status=hipErrorInvalidValue; return ihipLogStatus(hip_status); - } + } auto ctx = ihipGetTlsDefaultCtx(); *array = (hipArray*)malloc(sizeof(hipArray)); @@ -830,7 +830,7 @@ hipError_t hipMalloc3DArray(hipArray** array, const struct hipChannelFormatDesc* hsa_ext_image_descriptor_t imageDescriptor; imageDescriptor.width = extent.width; imageDescriptor.height = extent.height; - imageDescriptor.depth = 0; + imageDescriptor.depth = extent.depth; imageDescriptor.array_size = 0; switch (flags) { case hipArrayLayered: