Modify hipMalloc to take size of 0 and return NULL pointer for it.
Modify hipMemoryAllocate test for this change. Change-Id: I884aee0cd5fe0c60aebb4cb37cdbb4833c5bd0c7
이 커밋은 다음에 포함됨:
1 부모
43998387aa
커밋
b726f0e949
2 파일이 변경됨
+11
-2
검색과 일치하는 파일 없음
+7
-1
@@ -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) {
|
||||
|
||||
새 이슈에서 참조
사용자 차단