Modify hipMalloc to take size of 0 and return NULL pointer for it.

Modify hipMemoryAllocate test for this change.

Change-Id: I884aee0cd5fe0c60aebb4cb37cdbb4833c5bd0c7


[ROCm/hip commit: b726f0e949]
Este commit está contenido en:
pensun
2016-09-01 13:06:55 -05:00
padre 6d95372587
commit 6824b3af6d
Se han modificado 2 ficheros con 11 adiciones y 2 borrados
+7 -1
Ver fichero
@@ -119,7 +119,13 @@ hipError_t hipMalloc(void** ptr, size_t sizeBytes)
HIP_INIT_API(ptr, sizeBytes);
hipError_t hip_status = hipSuccess;
// return NULL pointer when malloc size is 0
if (sizeBytes == 0)
{
*ptr = NULL;
return ihipLogStatus(hip_status);
}
auto ctx = ihipGetTlsDefaultCtx();
if (ctx) {