mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Refactor memory manager so as to support device reset
Move out neoDevice dependent pieces of memory manager code into separate methods. Those methods could be used for recreating a neoDevice after a device reset is performed. Related-To: LOCI-2615 Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
e063b120de
commit
f8c89fe984
@@ -219,6 +219,12 @@ class MemoryManager {
|
||||
return !force32bitAllocations && hostPtr && !isHostPointerTrackingEnabled(rootDeviceIndex) && (allocationType == GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY);
|
||||
}
|
||||
|
||||
virtual void releaseDeviceSpecificMemResources(uint32_t rootDeviceIndex){};
|
||||
virtual void createDeviceSpecificMemResources(uint32_t rootDeviceIndex){};
|
||||
void reInitLatestContextId() {
|
||||
latestContextId = std::numeric_limits<uint32_t>::max();
|
||||
}
|
||||
|
||||
protected:
|
||||
bool getAllocationData(AllocationData &allocationData, const AllocationProperties &properties, const void *hostPtr, const StorageInfo &storageInfo);
|
||||
static void overrideAllocationData(AllocationData &allocationData, const AllocationProperties &properties);
|
||||
@@ -253,6 +259,7 @@ class MemoryManager {
|
||||
memset(cpuPtr, 0, size);
|
||||
}
|
||||
}
|
||||
void updateLatestContextIdForRootDevice(uint32_t rootDeviceIndex);
|
||||
|
||||
bool initialized = false;
|
||||
bool forceNonSvmForExternalHostPtr = false;
|
||||
@@ -268,6 +275,7 @@ class MemoryManager {
|
||||
EngineControlContainer registeredEngines;
|
||||
std::unique_ptr<HostPtrManager> hostPtrManager;
|
||||
uint32_t latestContextId = std::numeric_limits<uint32_t>::max();
|
||||
std::map<uint32_t, uint32_t> rootDeviceIndexToContextId; // This map will contain initial value of latestContextId for each rootDeviceIndex
|
||||
std::unique_ptr<DeferredDeleter> multiContextResourceDestructor;
|
||||
std::vector<std::unique_ptr<GfxPartition>> gfxPartitions;
|
||||
std::vector<std::unique_ptr<LocalMemoryUsageBankSelector>> internalLocalMemoryUsageBankSelector;
|
||||
|
||||
Reference in New Issue
Block a user