fix: Fix HostPointerManager multi-allocation for non-zero root device indices

Related-To: NEO-15430

Previously, HostPointerManager constructed HostPointerData and
MultiGraphicsAllocation using devices.size()-1 as the max root device index.
This caused aborts when devices with non-zero root device indices were used,
since the internal allocation vector was undersized.
This change computes the maximum root device index from the input device vector
and uses it to size HostPointerData and MultiGraphicsAllocation correctly.

Signed-off-by: Slawomir Milczarek <slawomir.milczarek@intel.com>
This commit is contained in:
Slawomir Milczarek
2025-10-14 20:55:16 +00:00
committed by Compute-Runtime-Automation
parent 9cc773f7ab
commit 1410459836
2 changed files with 38 additions and 2 deletions

View File

@@ -82,7 +82,11 @@ ze_result_t HostPointerManager::createHostPointerMultiAllocation(std::vector<Dev
return ZE_RESULT_ERROR_INVALID_SIZE;
}
HostPointerData hostData(static_cast<uint32_t>(devices.size() - 1));
uint32_t maxRootDeviceIndex = 0;
for (auto device : devices) {
maxRootDeviceIndex = std::max(maxRootDeviceIndex, device->getRootDeviceIndex());
}
HostPointerData hostData(maxRootDeviceIndex);
hostData.basePtr = ptr;
hostData.size = size;
for (auto device : devices) {