fix(ocl): track buffer pool count per device

Track amount of created buffer pools per device. Do not allocate extra
pools if limit is reached. New contexts will have pooling disabled if
limit is reached on device.

Related-To: NEO-13461

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
Dominik Dabek
2024-12-16 10:19:12 +00:00
committed by Compute-Runtime-Automation
parent b6fc2b5861
commit e61d04a881
12 changed files with 140 additions and 23 deletions

View File

@@ -84,6 +84,7 @@ class AbstractBuffersAllocator : public SmallBuffersParams<BuffersPoolType> {
void releasePools() { this->bufferPools.clear(); }
bool isPoolBuffer(const BufferParentType *buffer) const;
void tryFreeFromPoolBuffer(BufferParentType *possiblePoolBuffer, size_t offset, size_t size);
uint32_t getPoolsCount() { return static_cast<uint32_t>(this->bufferPools.size()); }
protected:
inline bool isSizeWithinThreshold(size_t size) const { return smallBufferThreshold >= size; }