Get rid of UNRECOVERABLE_IF in MemoryManager constructor

Related-To: NEO-5053

Change-Id: Ibf955c760e61e34c4d38cbb5071ef712bae1c518
Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
This commit is contained in:
Igor Venevtsev
2020-09-18 16:19:41 +02:00
committed by sys_ocldev
parent 47f5867e8f
commit bd9695a19a
18 changed files with 161 additions and 23 deletions

View File

@@ -30,14 +30,22 @@
namespace NEO {
OsAgnosticMemoryManager::OsAgnosticMemoryManager(bool aubUsage, ExecutionEnvironment &executionEnvironment) : MemoryManager(executionEnvironment) {
initialize(aubUsage);
}
void OsAgnosticMemoryManager::initialize(bool aubUsage) {
// 4 x sizeof(Heap32) + 2 x sizeof(Standard/Standard64k)
size_t reservedCpuAddressRangeSize = is64bit ? (4 * 4 + 2 * (aubUsage ? 32 : 4)) * GB : 0;
size_t reservedCpuAddressRangeSize = (4 * 4 + 2 * (aubUsage ? 32 : 4)) * GB;
for (uint32_t rootDeviceIndex = 0; rootDeviceIndex < gfxPartitions.size(); ++rootDeviceIndex) {
auto gpuAddressSpace = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo()->capabilityTable.gpuAddressSpace;
getGfxPartition(rootDeviceIndex)->init(gpuAddressSpace, reservedCpuAddressRangeSize, rootDeviceIndex, gfxPartitions.size(), heapAssigner.apiAllowExternalHeapForSshAndDsh);
if (!getGfxPartition(rootDeviceIndex)->init(gpuAddressSpace, reservedCpuAddressRangeSize, rootDeviceIndex, gfxPartitions.size(), heapAssigner.apiAllowExternalHeapForSshAndDsh)) {
initialized = false;
return;
}
}
initialized = true;
}
OsAgnosticMemoryManager::~OsAgnosticMemoryManager() = default;

View File

@@ -61,6 +61,7 @@ class OsAgnosticMemoryManager : public MemoryManager {
OsAgnosticMemoryManager(ExecutionEnvironment &executionEnvironment) : OsAgnosticMemoryManager(false, executionEnvironment) {}
OsAgnosticMemoryManager(bool aubUsage, ExecutionEnvironment &executionEnvironment);
void initialize(bool aubUsage);
~OsAgnosticMemoryManager() override;
GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness) override;
GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex) override { return nullptr; }