SWDEV-300584 - Update memory validation checks in hipMemPrefetchAsync

Change-Id: Ie3f07781da58a5d909b8e6d0284387493a97e488
此提交包含在:
Satyanvesh Dittakavi committed 2021-09-01 13:19:04 -04:00
1 父節點 dda2613525
當前提交 9adc14a0f5
1 file changed
+2 -6
+2 -6
查看文件
@@ -86,8 +86,8 @@ hipError_t hipMemPrefetchAsync(const void* dev_ptr, size_t count, int device,
size_t offset = 0;
amd::Memory* memObj = getMemoryObject(dev_ptr, offset);
// Return error if count passed is more than the actual size allocated
if (memObj && count > (memObj->getSize() - offset)) {
if (memObj == nullptr || (count > (memObj->getSize() - offset))) {
HIP_RETURN(hipErrorInvalidValue);
}
@@ -119,10 +119,6 @@ hipError_t hipMemPrefetchAsync(const void* dev_ptr, size_t count, int device,
return hipErrorOutOfMemory;
}
if (!command->validateMemory()) {
delete command;
HIP_RETURN(hipErrorInvalidValue);
}
command->enqueue();
command->release();