Correct cmake files in driver model specific execution environment files

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2022-05-09 14:56:32 +00:00
committed by Compute-Runtime-Automation
parent 1c366d1ec0
commit 77621158e0
7 changed files with 26 additions and 36 deletions

View File

@@ -0,0 +1,12 @@
#
# Copyright (C) 2021-2022 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
set(NEO_CORE_EXECUTION_ENVIRONMENT_WDDM
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/execution_environment_wddm.cpp
)
set_property(GLOBAL PROPERTY NEO_CORE_EXECUTION_ENVIRONMENT_WDDM ${NEO_CORE_EXECUTION_ENVIRONMENT_WDDM})

View File

@@ -0,0 +1,42 @@
/*
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/os_interface/os_interface.h"
#include "shared/source/os_interface/windows/wddm/wddm.h"
#include <sstream>
namespace NEO {
bool comparePciIdBusNumberWDDM(std::unique_ptr<RootDeviceEnvironment> &rootDeviceEnvironment1, std::unique_ptr<RootDeviceEnvironment> &rootDeviceEnvironment2) {
// BDF sample format is : 00:02.0
auto bdfDevice1 = rootDeviceEnvironment1.get()->osInterface->getDriverModel()->as<NEO::Wddm>()->getAdapterBDF();
auto bdfDevice2 = rootDeviceEnvironment2.get()->osInterface->getDriverModel()->as<NEO::Wddm>()->getAdapterBDF();
if (bdfDevice1.Bus != bdfDevice2.Bus) {
return (bdfDevice1.Bus < bdfDevice2.Bus);
}
if (bdfDevice1.Device != bdfDevice2.Device) {
return (bdfDevice1.Device < bdfDevice2.Device);
}
return bdfDevice1.Function < bdfDevice2.Function;
}
void ExecutionEnvironment::sortNeoDevicesWDDM() {
const auto pciOrderVar = DebugManager.flags.ZE_ENABLE_PCI_ID_DEVICE_ORDER.get();
if (pciOrderVar) {
std::sort(rootDeviceEnvironments.begin(), rootDeviceEnvironments.end(), comparePciIdBusNumberWDDM);
}
}
} // namespace NEO