fix: add missing host ptr assignment increment

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2023-05-22 11:07:09 +00:00
committed by Compute-Runtime-Automation
parent 6a3a90a83f
commit 8e51d9ae90
10 changed files with 40 additions and 4 deletions

View File

@@ -82,7 +82,8 @@ NEO::GraphicsAllocation *CommandList::getAllocationFromHostPtrMap(const void *bu
auto allocation = this->csr->getInternalAllocationStorage()->obtainTemporaryAllocationWithPtr(bufferSize, buffer, NEO::AllocationType::EXTERNAL_HOST_PTR);
if (allocation != nullptr) {
auto alloc = allocation.get();
this->csr->getInternalAllocationStorage()->storeAllocation(std::move(allocation), NEO::AllocationUsage::TEMPORARY_ALLOCATION);
alloc->hostPtrTaskCountAssignment++;
this->csr->getInternalAllocationStorage()->storeAllocationWithTaskCount(std::move(allocation), NEO::AllocationUsage::TEMPORARY_ALLOCATION, this->csr->peekTaskCount());
return alloc;
}
}
@@ -107,6 +108,7 @@ NEO::GraphicsAllocation *CommandList::getHostPtrAlloc(const void *buffer, uint64
return nullptr;
}
if (this->storeExternalPtrAsTemporary()) {
alloc->hostPtrTaskCountAssignment++;
this->csr->getInternalAllocationStorage()->storeAllocationWithTaskCount(std::unique_ptr<NEO::GraphicsAllocation>(alloc), NEO::AllocationUsage::TEMPORARY_ALLOCATION, this->csr->peekTaskCount());
} else if (alloc->getAllocationType() == NEO::AllocationType::EXTERNAL_HOST_PTR) {
hostPtrMap.insert(std::make_pair(buffer, alloc));

View File

@@ -335,6 +335,7 @@ void CommandQueueImp::handleIndirectAllocationResidency(UnifiedMemoryControls un
void CommandQueueImp::makeResidentAndMigrate(bool performMigration, const NEO::ResidencyContainer &residencyContainer) {
for (auto alloc : residencyContainer) {
alloc->prepareHostPtrForResidency(csr);
csr->makeResident(*alloc);
if (performMigration &&
(alloc->getAllocationType() == NEO::AllocationType::SVM_GPU ||