Moving rootDeviceIndex from DrmMemoryOperationsHandlerBind to base class

This fix will allow all DrmMemoryOperationsHandler objects
to be sorted correctly

Related-To: NEO-7505
Signed-off-by: Andrzej Koska andrzej.koska@intel.com
This commit is contained in:
Andrzej Koska
2022-12-14 15:12:43 +00:00
committed by Compute-Runtime-Automation
parent fa44d61fd8
commit 52c7c96635
10 changed files with 115 additions and 21 deletions

View File

@@ -46,14 +46,14 @@ void ExecutionEnvironment::sortNeoDevicesDRM() {
if (pciOrderVar) {
std::vector<uint32_t> presortIndex;
for (uint32_t i = 0; i < rootDeviceEnvironments.size(); i++) {
NEO::DrmMemoryOperationsHandlerBind *drm = static_cast<DrmMemoryOperationsHandlerBind *>(rootDeviceEnvironments[i]->memoryOperationsInterface.get());
NEO::DrmMemoryOperationsHandler *drm = static_cast<DrmMemoryOperationsHandler *>(rootDeviceEnvironments[i]->memoryOperationsInterface.get());
presortIndex.push_back(drm->getRootDeviceIndex());
}
std::sort(rootDeviceEnvironments.begin(), rootDeviceEnvironments.end(), comparePciIdBusNumberDRM);
for (uint32_t i = 0; i < rootDeviceEnvironments.size(); i++) {
NEO::DrmMemoryOperationsHandlerBind *drm = static_cast<DrmMemoryOperationsHandlerBind *>(rootDeviceEnvironments[i]->memoryOperationsInterface.get());
NEO::DrmMemoryOperationsHandler *drm = static_cast<DrmMemoryOperationsHandler *>(rootDeviceEnvironments[i]->memoryOperationsInterface.get());
if (drm->getRootDeviceIndex() != presortIndex[i]) {
drm->setRootDeviceIndex(presortIndex[i]);
}