mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
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:
committed by
sys_ocldev
parent
47f5867e8f
commit
bd9695a19a
@@ -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;
|
||||
|
||||
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user