mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Move initialization of AubCenter to RootDeviceEnvironment
make RootDeviceEnvironments vector of unique_ptr Related-To: NEO-3857 Change-Id: I23998502198307c8535cdd5c9c4af5223a5d69a5 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
8cc6a65e69
commit
3e1b15c31d
@@ -5,6 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "core/execution_environment/root_device_environment.h"
|
||||
#include "core/helpers/hw_helper.h"
|
||||
#include "core/os_interface/aub_memory_operations_handler.h"
|
||||
#include "runtime/aub/aub_center.h"
|
||||
@@ -20,7 +21,7 @@ bool DeviceFactory::getDevicesForProductFamilyOverride(size_t &numDevices, Execu
|
||||
if (DebugManager.flags.CreateMultipleRootDevices.get()) {
|
||||
numRootDevices = DebugManager.flags.CreateMultipleRootDevices.get();
|
||||
}
|
||||
executionEnvironment.rootDeviceEnvironments.resize(numRootDevices);
|
||||
executionEnvironment.prepareRootDeviceEnvironments(numRootDevices);
|
||||
|
||||
auto productFamily = DebugManager.flags.ProductFamilyOverride.get();
|
||||
auto hwInfoConst = *platformDevices;
|
||||
@@ -39,12 +40,14 @@ bool DeviceFactory::getDevicesForProductFamilyOverride(size_t &numDevices, Execu
|
||||
|
||||
numDevices = numRootDevices;
|
||||
DeviceFactory::numDevices = numDevices;
|
||||
auto csr = DebugManager.flags.SetCommandStreamReceiver.get();
|
||||
if (csr > 0) {
|
||||
auto csrType = DebugManager.flags.SetCommandStreamReceiver.get();
|
||||
if (csrType > 0) {
|
||||
auto &hwHelper = HwHelper::get(hardwareInfo->platform.eRenderCoreFamily);
|
||||
auto localMemoryEnabled = hwHelper.getEnableLocalMemory(*hardwareInfo);
|
||||
executionEnvironment.initAubCenter(localMemoryEnabled, "", static_cast<CommandStreamReceiverType>(csr));
|
||||
auto aubCenter = executionEnvironment.rootDeviceEnvironments[0].aubCenter.get();
|
||||
for (auto rootDeviceIndex = 0u; rootDeviceIndex < numRootDevices; rootDeviceIndex++) {
|
||||
executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->initAubCenter(localMemoryEnabled, "", static_cast<CommandStreamReceiverType>(csrType));
|
||||
}
|
||||
auto aubCenter = executionEnvironment.rootDeviceEnvironments[0]->aubCenter.get();
|
||||
executionEnvironment.memoryOperationsInterface = std::make_unique<AubMemoryOperationsHandler>(aubCenter->getAubManager());
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -26,7 +26,7 @@ bool DeviceFactory::getDevices(size_t &numDevices, ExecutionEnvironment &executi
|
||||
numRootDevices = DebugManager.flags.CreateMultipleRootDevices.get();
|
||||
}
|
||||
|
||||
executionEnvironment.rootDeviceEnvironments.resize(numRootDevices);
|
||||
executionEnvironment.prepareRootDeviceEnvironments(static_cast<uint32_t>(numRootDevices));
|
||||
|
||||
Drm *drm = Drm::create(devNum);
|
||||
if (!drm) {
|
||||
|
||||
@@ -593,7 +593,7 @@ MemoryManager::AllocationStatus DrmMemoryManager::populateOsHandles(OsHandleStor
|
||||
return AllocationStatus::Success;
|
||||
}
|
||||
|
||||
void DrmMemoryManager::cleanOsHandles(OsHandleStorage &handleStorage) {
|
||||
void DrmMemoryManager::cleanOsHandles(OsHandleStorage &handleStorage, uint32_t rootDeviceIndex) {
|
||||
for (unsigned int i = 0; i < maxFragmentsCount; i++) {
|
||||
if (handleStorage.fragmentStorageData[i].freeTheFragment) {
|
||||
if (handleStorage.fragmentStorageData[i].osHandleStorage->bo) {
|
||||
|
||||
@@ -41,7 +41,7 @@ class DrmMemoryManager : public MemoryManager {
|
||||
uint64_t getLocalMemorySize() override;
|
||||
|
||||
AllocationStatus populateOsHandles(OsHandleStorage &handleStorage) override;
|
||||
void cleanOsHandles(OsHandleStorage &handleStorage) override;
|
||||
void cleanOsHandles(OsHandleStorage &handleStorage, uint32_t rootDeviceIndex) override;
|
||||
|
||||
// drm/i915 ioctl wrappers
|
||||
MOCKABLE_VIRTUAL uint32_t unreference(BufferObject *bo, bool synchronousDestroy);
|
||||
|
||||
@@ -28,7 +28,7 @@ bool DeviceFactory::getDevices(size_t &numDevices, ExecutionEnvironment &executi
|
||||
numRootDevices = DebugManager.flags.CreateMultipleRootDevices.get();
|
||||
}
|
||||
|
||||
executionEnvironment.rootDeviceEnvironments.resize(numRootDevices);
|
||||
executionEnvironment.prepareRootDeviceEnvironments(static_cast<uint32_t>(numRootDevices));
|
||||
|
||||
auto hardwareInfo = executionEnvironment.getMutableHardwareInfo();
|
||||
std::unique_ptr<Wddm> wddm(Wddm::createWddm());
|
||||
|
||||
@@ -428,7 +428,7 @@ MemoryManager::AllocationStatus WddmMemoryManager::populateOsHandles(OsHandleSto
|
||||
return AllocationStatus::Success;
|
||||
}
|
||||
|
||||
void WddmMemoryManager::cleanOsHandles(OsHandleStorage &handleStorage) {
|
||||
void WddmMemoryManager::cleanOsHandles(OsHandleStorage &handleStorage, uint32_t rootDeviceIndex) {
|
||||
|
||||
D3DKMT_HANDLE handles[maxFragmentsCount] = {0};
|
||||
auto allocationCount = 0;
|
||||
|
||||
@@ -43,7 +43,7 @@ class WddmMemoryManager : public MemoryManager {
|
||||
void removeAllocationFromHostPtrManager(GraphicsAllocation *memory) override;
|
||||
|
||||
AllocationStatus populateOsHandles(OsHandleStorage &handleStorage) override;
|
||||
void cleanOsHandles(OsHandleStorage &handleStorage) override;
|
||||
void cleanOsHandles(OsHandleStorage &handleStorage, uint32_t rootDeviceIndex) override;
|
||||
|
||||
void obtainGpuAddressFromFragments(WddmAllocation *allocation, OsHandleStorage &handleStorage);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user