SWDEV-483586 - Unblock staging H2D transfers

Although unpinned copies require synchronizations
in HIP, runtime can avoid syncs for H2D copies with
a staging buffer

Change-Id: If2203c6bc0cbd89742823688dc8e89e9acd873b2
This commit is contained in:
German Andryeyev
2024-09-06 18:16:04 -04:00
rodzic 2d1c6ee23e
commit 29cc678d8d
10 zmienionych plików z 119 dodań i 64 usunięć
+3 -1
Wyświetl plik
@@ -599,7 +599,9 @@ hipError_t ihipMemcpy(void* dst, const void* src, size_t sizeBytes, hipMemcpyKin
return hipSuccess;
} else if (((srcMemory == nullptr) && (dstMemory != nullptr)) ||
((srcMemory != nullptr) && (dstMemory == nullptr))) {
isHostAsync = false;
// Don't wait for unpinned H2D copy if staging is used for copy
isHostAsync &= ((srcMemory == nullptr) && (dstMemory != nullptr) && AMD_DIRECT_DISPATCH &&
(sizeBytes <= stream.device().settings().stagedXferSize_)) ? true : false;
} else if (srcMemory->GetDeviceById() == dstMemory->GetDeviceById()) {
hipMemoryType srcMemoryType = ((CL_MEM_SVM_FINE_GRAIN_BUFFER | CL_MEM_USE_HOST_PTR) &
srcMemory->getMemFlags())? hipMemoryTypeHost : hipMemoryTypeDevice;