Add additional create buffer arguments

Allow to: disable performance hints, make allocation lockable

Used in BufferPoolAllocator

Related-To: NEO-7332

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
Dominik Dabek
2022-11-21 11:03:05 +00:00
committed by Compute-Runtime-Automation
parent 50df7f430e
commit 67bfebb25e
12 changed files with 125 additions and 26 deletions

View File

@@ -475,10 +475,14 @@ bool Context::isSingleDeviceContext() {
void Context::BufferPoolAllocator::initAggregatedSmallBuffers(Context *context) {
static constexpr cl_mem_flags flags{};
[[maybe_unused]] cl_int errcodeRet{};
Buffer::AdditionalBufferCreateArgs bufferCreateArgs{};
bufferCreateArgs.doNotProvidePerformanceHints = true;
bufferCreateArgs.makeAllocationLockable = true;
this->mainStorage = Buffer::create(context,
flags,
BufferPoolAllocator::aggregatedSmallBuffersPoolSize,
nullptr,
bufferCreateArgs,
errcodeRet);
if (this->mainStorage) {
this->chunkAllocator.reset(new HeapAllocator(BufferPoolAllocator::startingOffset,

View File

@@ -50,6 +50,7 @@ class Context : public BaseObject<_cl_context> {
static constexpr auto startingOffset = chunkAlignment;
static_assert(aggregatedSmallBuffersPoolSize > smallBufferThreshold, "Largest allowed buffer needs to fit in pool");
Buffer *allocateBufferFromPool(const MemoryProperties &memoryProperties,
cl_mem_flags flags,
cl_mem_flags_intel flagsIntel,