Return error from hipMallocManaged for size =0

Change-Id: Ida0cecf05e1df731176d41e59422d1e606cc9bd9


[ROCm/hip commit: d620a25b64]
이 커밋은 다음에 포함됨:
Rahul Garg가 2020-08-10 18:25:31 +00:00를 커밋했습니다
1 부모 003e50f6cb
커밋 da32b4f5b6
1 파일이 변경됨
+2 -2
+2 -2
파일 보기
@@ -59,7 +59,7 @@ static_assert(static_cast<uint32_t>(hipMemRangeAttributeLastPrefetchLocation) ==
hipError_t hipMallocManaged(void** dev_ptr, size_t size, unsigned int flags) {
HIP_INIT_API(hipMallocManaged, dev_ptr, size, flags);
if ((dev_ptr == nullptr) || (flags != hipMemAttachGlobal)) {
if ((dev_ptr == nullptr) || (size == 0) || (flags != hipMemAttachGlobal)) {
HIP_RETURN(hipErrorInvalidValue);
}
@@ -213,4 +213,4 @@ static hipError_t ihipMallocManaged(void** ptr, size_t size) {
ClPrint(amd::LOG_INFO, amd::LOG_API, "%-5d: [%zx] ihipMallocManaged ptr=0x%zx", getpid(),
std::this_thread::get_id(), *ptr);
return hipSuccess;
}
}