Return error from hipMallocManaged for size =0
Change-Id: Ida0cecf05e1df731176d41e59422d1e606cc9bd9
[ROCm/clr commit: 236ef94166]
이 커밋은 다음에 포함됨:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
새 이슈에서 참조
사용자 차단