mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
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:
committed by
Compute-Runtime-Automation
parent
50df7f430e
commit
67bfebb25e
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user