mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 21:42:53 +08:00
fix: use real size when putting into usm reuse
Real allocation size should be used to properly apply limits and allow more usm reuse hits. Related-To: NEO-6893 Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
f344eb9bca
commit
3703ff550c
@@ -652,7 +652,7 @@ bool SVMAllocsManager::freeSVMAlloc(void *ptr, bool blocking) {
|
||||
}
|
||||
if (InternalMemoryType::hostUnifiedMemory == svmData->memoryType &&
|
||||
this->usmHostAllocationsCache) {
|
||||
if (this->usmHostAllocationsCache->insert(svmData->size, ptr, svmData)) {
|
||||
if (this->usmHostAllocationsCache->insert(svmData->gpuAllocations.getDefaultGraphicsAllocation()->getUnderlyingBufferSize(), ptr, svmData)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -676,13 +676,13 @@ bool SVMAllocsManager::freeSVMAllocDefer(void *ptr) {
|
||||
if (svmData) {
|
||||
if (InternalMemoryType::deviceUnifiedMemory == svmData->memoryType &&
|
||||
this->usmDeviceAllocationsCache) {
|
||||
if (this->usmDeviceAllocationsCache->insert(svmData->size, ptr, svmData)) {
|
||||
if (this->usmDeviceAllocationsCache->insert(svmData->gpuAllocations.getDefaultGraphicsAllocation()->getUnderlyingBufferSize(), ptr, svmData)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (InternalMemoryType::hostUnifiedMemory == svmData->memoryType &&
|
||||
this->usmHostAllocationsCache) {
|
||||
if (this->usmHostAllocationsCache->insert(svmData->size, ptr, svmData)) {
|
||||
if (this->usmHostAllocationsCache->insert(svmData->gpuAllocations.getDefaultGraphicsAllocation()->getUnderlyingBufferSize(), ptr, svmData)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user