SWDEV-439241 - Keep direct map for MGPU

Single OCL context with multiple devices should use direct map
even with persistent memory, because cache coherency layer.

Change-Id: I02a48830440203a1dea176acd4dff4452b70f133


[ROCm/clr commit: 49037b9762]
This commit is contained in:
German
2024-01-08 13:25:50 -05:00
کامیت شده توسط German Andryeyev
والد 5718f13901
کامیت ba4a3cd9f4
@@ -158,7 +158,8 @@ class Memory : public device::Memory, public Resource {
//! forced USWC memory on APU and will cause a switch to
//! indirect map for allocations with a possibility of host read
bool isDirectMap() {
return (isCacheable() || (!isHostMemDirectAccess() && !IsPersistent()) ||
return (isCacheable() || (!isHostMemDirectAccess() &&
(!IsPersistent() || (owner()->getContext().devices().size() > 1))) ||
(owner()->getMemFlags() &
(CL_MEM_ALLOC_HOST_PTR | CL_MEM_HOST_WRITE_ONLY | CL_MEM_READ_ONLY)));
}