mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
Revert "fix: configure ISA Pool params based on productHelper"
This reverts commit bf20ae7ae8.
Signed-off-by: Fabian Zwoliński <fabian.zwolinski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b32f726913
commit
f5e37e725c
@@ -8,7 +8,6 @@
|
||||
#include "shared/source/utilities/isa_pool_allocator.h"
|
||||
|
||||
#include "shared/source/device/device.h"
|
||||
#include "shared/source/helpers/aligned_memory.h"
|
||||
#include "shared/source/memory_manager/allocation_properties.h"
|
||||
#include "shared/source/memory_manager/memory_manager.h"
|
||||
#include "shared/source/utilities/buffer_pool_allocator.inl"
|
||||
@@ -17,9 +16,6 @@ namespace NEO {
|
||||
|
||||
ISAPool::ISAPool(Device *device, bool isBuiltin, size_t storageSize)
|
||||
: BaseType(device->getMemoryManager(), nullptr), device(device), isBuiltin(isBuiltin) {
|
||||
DEBUG_BREAK_IF(device->getProductHelper().is2MBLocalMemAlignmentEnabled() &&
|
||||
!isAligned(storageSize, MemoryConstants::pageSize2M));
|
||||
|
||||
this->chunkAllocator.reset(new NEO::HeapAllocator(params.startingOffset, storageSize, MemoryConstants::pageSize, 0u));
|
||||
|
||||
auto allocationType = isBuiltin ? NEO::AllocationType::kernelIsaInternal : NEO::AllocationType::kernelIsa;
|
||||
@@ -59,7 +55,6 @@ const StackVec<NEO::GraphicsAllocation *, 1> &ISAPool::getAllocationsVector() {
|
||||
}
|
||||
|
||||
ISAPoolAllocator::ISAPoolAllocator(Device *device) : device(device) {
|
||||
initAllocParams();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,7 +76,7 @@ SharedIsaAllocation *ISAPoolAllocator::requestGraphicsAllocationForIsa(bool isBu
|
||||
auto maxAllocationSize = getAllocationSize(isBuiltin);
|
||||
|
||||
if (size > maxAllocationSize) {
|
||||
addNewBufferPool(ISAPool(device, isBuiltin, alignToPoolSize(size)));
|
||||
addNewBufferPool(ISAPool(device, isBuiltin, size));
|
||||
}
|
||||
|
||||
auto sharedIsaAllocation = tryAllocateISA(isBuiltin, size);
|
||||
@@ -96,7 +91,7 @@ SharedIsaAllocation *ISAPoolAllocator::requestGraphicsAllocationForIsa(bool isBu
|
||||
return sharedIsaAllocation;
|
||||
}
|
||||
|
||||
addNewBufferPool(ISAPool(device, isBuiltin, alignToPoolSize(getAllocationSize(isBuiltin))));
|
||||
addNewBufferPool(ISAPool(device, isBuiltin, getAllocationSize(isBuiltin)));
|
||||
return tryAllocateISA(isBuiltin, size);
|
||||
}
|
||||
|
||||
@@ -135,19 +130,4 @@ SharedIsaAllocation *ISAPoolAllocator::tryAllocateISA(bool isBuiltin, size_t siz
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ISAPoolAllocator::initAllocParams() {
|
||||
if (device->getProductHelper().is2MBLocalMemAlignmentEnabled()) {
|
||||
userAllocationSize = MemoryConstants::pageSize2M * 2;
|
||||
buitinAllocationSize = MemoryConstants::pageSize2M;
|
||||
poolAlignment = MemoryConstants::pageSize2M;
|
||||
} else {
|
||||
userAllocationSize = MemoryConstants::pageSize2M * 2;
|
||||
buitinAllocationSize = MemoryConstants::pageSize64k;
|
||||
}
|
||||
}
|
||||
|
||||
size_t ISAPoolAllocator::alignToPoolSize(size_t size) const {
|
||||
return alignUp(size, poolAlignment);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -73,17 +73,15 @@ class ISAPoolAllocator : public AbstractBuffersAllocator<ISAPool, GraphicsAlloca
|
||||
void freeSharedIsaAllocation(SharedIsaAllocation *sharedIsaAllocation);
|
||||
|
||||
private:
|
||||
void initAllocParams();
|
||||
SharedIsaAllocation *tryAllocateISA(bool isBuiltin, size_t size);
|
||||
|
||||
size_t getAllocationSize(bool isBuiltin) const {
|
||||
return isBuiltin ? buitinAllocationSize : userAllocationSize;
|
||||
}
|
||||
size_t alignToPoolSize(size_t size) const;
|
||||
|
||||
Device *device;
|
||||
size_t userAllocationSize = MemoryConstants::pageSize2M * 2;
|
||||
size_t buitinAllocationSize = MemoryConstants::pageSize64k;
|
||||
size_t poolAlignment = 1u;
|
||||
std::mutex allocatorMtx;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user