SWDEV-455869 - Revert "SWDEV-410751 - Consider null amd::memory is invalid."

This reverts commit 60a3077ed4.

Change-Id: I26c4b3c74b2861afc17f979492d025b59d4388ab


[ROCm/clr commit: e829ef68e4]
This commit is contained in:
Anusha GodavarthySurya
2024-04-10 11:35:54 +00:00
committed by Anusha Godavarthy Surya
parent 71aa6ff3a0
commit c7022ad6ce
+1 -1
View File
@@ -89,7 +89,7 @@ hipError_t hipMemPrefetchAsync(const void* dev_ptr, size_t count, int device,
size_t offset = 0;
amd::Memory* memObj = getMemoryObject(dev_ptr, offset);
if (memObj == nullptr || (memObj && count > (memObj->getSize() - offset))) {
if ((memObj != nullptr) && (count > (memObj->getSize() - offset))) {
HIP_RETURN(hipErrorInvalidValue);
}
if (device != hipCpuDeviceId && (static_cast<size_t>(device) >= g_devices.size())) {