refactor: reorder bindless heaps helper members

Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk 2025-05-09 14:19:00 +00:00 committed by Compute-Runtime-Automation
parent a19fa245ab
commit a51902bb3a
2 changed files with 28 additions and 29 deletions

View File

@ -49,11 +49,11 @@ constexpr size_t heapRegularSize = reservedRangeSize - heapFrontWindowSize;
using BindlesHeapType = BindlessHeapsHelper::BindlesHeapType;
BindlessHeapsHelper::BindlessHeapsHelper(Device *rootDevice, bool isMultiOsContextCapable) : rootDevice(rootDevice),
surfaceStateSize(rootDevice->getRootDeviceEnvironment().getHelper<GfxCoreHelper>().getRenderSurfaceStateSize()),
memManager(rootDevice->getMemoryManager()),
isMultiOsContextCapable(isMultiOsContextCapable),
deviceBitfield(rootDevice->getDeviceBitfield()),
surfaceStateSize(rootDevice->getRootDeviceEnvironment().getHelper<GfxCoreHelper>().getRenderSurfaceStateSize()),
rootDeviceIndex(rootDevice->getRootDeviceIndex()),
deviceBitfield(rootDevice->getDeviceBitfield()) {
isMultiOsContextCapable(isMultiOsContextCapable) {
for (auto heapType = 0; heapType < BindlesHeapType::numHeapTypes; heapType++) {
auto size = MemoryConstants::pageSize64k;

View File

@ -70,41 +70,40 @@ class BindlessHeapsHelper : NEO::NonCopyableAndNonMovableClass {
void clearStateDirtyForContext(uint32_t osContextId);
protected:
bool tryReservingMemoryForSpecialSsh(const size_t size, size_t alignment);
std::optional<AddressRange> reserveMemoryRange(size_t size, size_t alignment, HeapIndex heapIndex);
bool growHeap(BindlesHeapType heapType);
bool initializeReservedMemory();
bool isReservedMemoryModeAvailable();
protected:
Device *rootDevice = nullptr;
const size_t surfaceStateSize;
bool growHeap(BindlesHeapType heapType);
MemoryManager *memManager = nullptr;
bool isMultiOsContextCapable = false;
const uint32_t rootDeviceIndex;
std::unique_ptr<IndirectHeap> surfaceStateHeaps[BindlesHeapType::numHeapTypes];
GraphicsAllocation *borderColorStates;
std::vector<GraphicsAllocation *> ssHeapsAllocations;
size_t reuseSlotCountThreshold = 512;
uint32_t allocatePoolIndex = 0;
uint32_t releasePoolIndex = 0;
bool allocateFromReusePool = false;
std::array<std::vector<SurfaceStateInHeapInfo>, 2> surfaceStateInHeapVectorReuse[2];
std::bitset<64> stateCacheDirtyForContext;
bool tryReservingMemoryForSpecialSsh(const size_t size, size_t alignment);
std::optional<AddressRange> reserveMemoryRange(size_t size, size_t alignment, HeapIndex heapIndex);
std::mutex mtx;
DeviceBitfield deviceBitfield;
bool globalBindlessDsh = false;
bool useReservedMemory = false;
bool reservedMemoryInitialized = false;
uint64_t reservedRangeBase = 0;
Device *rootDevice = nullptr;
MemoryManager *memManager = nullptr;
GraphicsAllocation *borderColorStates = nullptr;
std::vector<AddressRange> reservedRanges;
std::vector<GraphicsAllocation *> ssHeapsAllocations;
std::array<std::vector<SurfaceStateInHeapInfo>, 2> surfaceStateInHeapVectorReuse[2];
std::unique_ptr<IndirectHeap> surfaceStateHeaps[BindlesHeapType::numHeapTypes];
std::unique_ptr<HeapAllocator> heapFrontWindow;
std::unique_ptr<HeapAllocator> heapRegular;
std::vector<AddressRange> reservedRanges;
size_t reuseSlotCountThreshold = 512;
uint64_t reservedRangeBase = 0;
std::bitset<64> stateCacheDirtyForContext;
DeviceBitfield deviceBitfield;
const size_t surfaceStateSize;
const uint32_t rootDeviceIndex;
uint32_t allocatePoolIndex = 0;
uint32_t releasePoolIndex = 0;
bool allocateFromReusePool = false;
bool globalBindlessDsh = false;
bool isMultiOsContextCapable = false;
bool reservedMemoryInitialized = false;
bool useReservedMemory = false;
};
static_assert(NEO::NonCopyableAndNonMovable<BindlessHeapsHelper>);