SWDEV-293519 - [PAL] Limit mgpu SVM logic only to mgpu cases

Below logic allocates the host buffer whenever a subbuffer is created
from a SVM allocation. This is only needed for multi-device contexts.

HIP does not support multi-device contexts, hence this logic just ends
up performing unnecessary system allocations.

Change-Id: I8eae635f7c5289c52ef73434218c1658b788a456


[ROCm/clr commit: ffbf368f4c]
Tá an tiomantas seo le fáil i:
Vladislav Sytchenko údaraithe agus Maneesh Gupta tiomanta 2021-08-22 23:56:08 -07:00
1 tuismitheoir 840d5bbdb5
tiomantas 4a2da6ea45
1 comhad athraithe
+2 -1
+2 -1
Féach ar an gComhad
@@ -1396,7 +1396,8 @@ pal::Memory* Device::createBuffer(amd::Memory& owner, bool directAccess) const {
return nullptr;
}
if (nullptr != owner.parent()->getSvmPtr()) {
if ((nullptr != owner.parent()->getSvmPtr()) &&
(owner.parent()->getContext().devices().size() > 1)) {
amd::Memory* amdParent = owner.parent();
{
// Lock memory object, so only one commitment will occur