mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 05:24:02 +08:00
Store indirect residency at command queue level
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
81f2d04f5a
commit
1458602efc
@@ -428,6 +428,7 @@ void SVMAllocsManager::freeSVMAllocImpl(void *ptr, bool blocking, SvmAllocationD
|
||||
if (pageFaultManager) {
|
||||
pageFaultManager->removeAllocation(ptr);
|
||||
}
|
||||
std::unique_lock<std::mutex> lockForIndirect(mtxForIndirectAccess);
|
||||
std::unique_lock<std::shared_mutex> lock(mtx);
|
||||
if (svmData->gpuAllocations.getAllocationType() == AllocationType::SVM_ZERO_COPY) {
|
||||
freeZeroCopySvmAllocation(svmData);
|
||||
@@ -685,5 +686,7 @@ void SVMAllocsManager::prefetchMemory(Device &device, SvmAllocationData &svmData
|
||||
memoryManager->setMemPrefetch(gfxAllocation, subDeviceId, device.getRootDeviceIndex());
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_lock<std::mutex> SVMAllocsManager::obtainOwnership() {
|
||||
return std::unique_lock<std::mutex>(mtxForIndirectAccess);
|
||||
}
|
||||
} // namespace NEO
|
||||
|
||||
@@ -173,17 +173,18 @@ class SVMAllocsManager {
|
||||
MOCKABLE_VIRTUAL void insertSvmMapOperation(void *regionSvmPtr, size_t regionSize, void *baseSvmPtr, size_t offset, bool readOnlyMap);
|
||||
void removeSvmMapOperation(const void *regionSvmPtr);
|
||||
SvmMapOperation *getSvmMapOperation(const void *regionPtr);
|
||||
void addInternalAllocationsToResidencyContainer(uint32_t rootDeviceIndex,
|
||||
ResidencyContainer &residencyContainer,
|
||||
uint32_t requestedTypesMask);
|
||||
MOCKABLE_VIRTUAL void addInternalAllocationsToResidencyContainer(uint32_t rootDeviceIndex,
|
||||
ResidencyContainer &residencyContainer,
|
||||
uint32_t requestedTypesMask);
|
||||
void makeInternalAllocationsResident(CommandStreamReceiver &commandStreamReceiver, uint32_t requestedTypesMask);
|
||||
void *createUnifiedAllocationWithDeviceStorage(size_t size, const SvmAllocationProperties &svmProperties, const UnifiedMemoryProperties &unifiedMemoryProperties);
|
||||
void freeSvmAllocationWithDeviceStorage(SvmAllocationData *svmData);
|
||||
bool hasHostAllocations();
|
||||
std::atomic<uint32_t> allocationsCounter = 0;
|
||||
void makeIndirectAllocationsResident(CommandStreamReceiver &commandStreamReceiver, uint32_t taskCount);
|
||||
MOCKABLE_VIRTUAL void makeIndirectAllocationsResident(CommandStreamReceiver &commandStreamReceiver, uint32_t taskCount);
|
||||
void prepareIndirectAllocationForDestruction(SvmAllocationData *);
|
||||
void prefetchMemory(Device &device, SvmAllocationData &svmData);
|
||||
std::unique_lock<std::mutex> obtainOwnership();
|
||||
|
||||
std::map<CommandStreamReceiver *, InternalAllocationsTracker> indirectAllocationsResidency;
|
||||
|
||||
@@ -204,6 +205,7 @@ class SVMAllocsManager {
|
||||
MapOperationsTracker svmMapOperations;
|
||||
MemoryManager *memoryManager;
|
||||
std::shared_mutex mtx;
|
||||
std::mutex mtxForIndirectAccess;
|
||||
bool multiOsContextSupport;
|
||||
SvmAllocationCache usmDeviceAllocationsCache;
|
||||
bool usmDeviceAllocationsCacheEnabled = false;
|
||||
|
||||
Reference in New Issue
Block a user