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
This commit is contained in:
Vladislav Sytchenko
2021-07-27 17:44:21 -04:00
committed by Maneesh Gupta
orang tua 255f27fd7a
melakukan ffbf368f4c
+2 -1
Melihat File
@@ -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