From ffbf368f4c5888c2d322a12a9766f5e226ef744e Mon Sep 17 00:00:00 2001 From: Vladislav Sytchenko Date: Tue, 27 Jul 2021 17:44:21 -0400 Subject: [PATCH] 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 --- rocclr/device/pal/paldevice.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rocclr/device/pal/paldevice.cpp b/rocclr/device/pal/paldevice.cpp index b37b674d16..33906557da 100644 --- a/rocclr/device/pal/paldevice.cpp +++ b/rocclr/device/pal/paldevice.cpp @@ -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