mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
Make small buffer allocations lockable
Allocations of buffers <= 64KB will be lockable, to allow copying through locked pointer. Related-To: NEO-7332 Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
3b97ca8709
commit
9b9b0f10ef
@ -50,6 +50,8 @@ class Context : public BaseObject<_cl_context> {
|
||||
static constexpr auto startingOffset = chunkAlignment;
|
||||
|
||||
static_assert(aggregatedSmallBuffersPoolSize > smallBufferThreshold, "Largest allowed buffer needs to fit in pool");
|
||||
static_assert(aggregatedSmallBuffersPoolSize <= GraphicsAllocation::largestLockableBufferSize, "Pool buffer should be lockable");
|
||||
|
||||
Buffer *allocateBufferFromPool(const MemoryProperties &memoryProperties,
|
||||
cl_mem_flags flags,
|
||||
cl_mem_flags_intel flagsIntel,
|
||||
|
@ -84,6 +84,12 @@ TEST_F(aggregatedSmallBuffersDisabledTest, givenAggregatedSmallBuffersDisabledWh
|
||||
|
||||
using aggregatedSmallBuffersEnabledTest = AggregatedSmallBuffersTestTemplate<1>;
|
||||
|
||||
TEST_F(aggregatedSmallBuffersEnabledTest, givenAggregatedSmallBuffersEnabledWhenCheckingMainStorageAllocationStorageInfoThenItIsLockable) {
|
||||
ASSERT_TRUE(poolAllocator->isAggregatedSmallBuffersEnabled());
|
||||
ASSERT_NE(poolAllocator->mainStorage, nullptr);
|
||||
EXPECT_TRUE(poolAllocator->mainStorage->getGraphicsAllocation(mockRootDeviceIndex)->isAllocationLockable());
|
||||
}
|
||||
|
||||
TEST_F(aggregatedSmallBuffersEnabledTest, givenAggregatedSmallBuffersEnabledAndSizeLargerThanThresholdWhenBufferCreateCalledThenDoNotUsePool) {
|
||||
ASSERT_TRUE(poolAllocator->isAggregatedSmallBuffersEnabled());
|
||||
ASSERT_NE(poolAllocator->mainStorage, nullptr);
|
||||
|
Reference in New Issue
Block a user