[33/n] Internal 4GB allocator.

- Move indirect heap to internal allocator domain.
- Add logic in getIndirectHeap to allocate with proper API depending on
heap type
- Add State base Address programming, reflecting that now Indirect Object
Heap is placed in 4GB domain.
- For AddPatchInfoCommentsForAUBDump mode , keep all heaps in non 4GB mode.

Change-Id: I6862f6a249e444d0d6cfe7e499a10d43f284553e
This commit is contained in:
Mrozek, Michal
2018-04-18 12:42:08 +02:00
committed by sys_ocldev
parent 81362d5b7d
commit d900bdffc6
15 changed files with 104 additions and 46 deletions

View File

@@ -419,6 +419,18 @@ TEST_P(CommandQueueIndirectHeapTest, IndirectHeapIsProvidedByDevice) {
EXPECT_NE(nullptr, &indirectHeap);
}
TEST_P(CommandQueueIndirectHeapTest, givenIndirectObjectHeapWhenItIsQueriedForInternalAllocationThenTrueIsReturned) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
CommandQueue cmdQ(context.get(), pDevice, props);
auto &indirectHeap = cmdQ.getIndirectHeap(this->GetParam(), 8192);
if (this->GetParam() == IndirectHeap::INDIRECT_OBJECT) {
EXPECT_TRUE(indirectHeap.getGraphicsAllocation()->is32BitAllocation);
} else {
EXPECT_FALSE(indirectHeap.getGraphicsAllocation()->is32BitAllocation);
}
}
TEST_P(CommandQueueIndirectHeapTest, IndirectHeapContainsAtLeast64KB) {
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
CommandQueue cmdQ(context.get(), pDevice, props);
@@ -482,7 +494,14 @@ TEST_P(CommandQueueIndirectHeapTest, MemoryManagerWithReusableAllocationsWhenAsk
auto memoryManager = pDevice->getMemoryManager();
auto allocationSize = defaultHeapSize * 2;
auto allocation = memoryManager->allocateGraphicsMemory(allocationSize);
GraphicsAllocation *allocation = nullptr;
if (this->GetParam() == IndirectHeap::INDIRECT_OBJECT) {
allocation = memoryManager->createInternalGraphicsAllocation(nullptr, allocationSize);
} else {
allocation = memoryManager->allocateGraphicsMemory(allocationSize);
}
memoryManager->storeAllocation(std::unique_ptr<GraphicsAllocation>(allocation), REUSABLE_ALLOCATION);
EXPECT_FALSE(memoryManager->allocationsForReuse.peekIsEmpty());

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (c) 2017 - 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -281,7 +281,7 @@ HWTEST_F(EnqueueCopyBufferTest, argumentZeroShouldMatchSourceAddress) {
ASSERT_NE(nullptr, kernel);
// Determine where the argument is
auto pArgument = (void **)getStatelessArgumentPointer<FamilyType>(*kernel, 0u);
auto pArgument = (void **)getStatelessArgumentPointer<FamilyType>(*kernel, 0u, pCmdQ->getIndirectHeap(IndirectHeap::INDIRECT_OBJECT, 0));
EXPECT_EQ((void *)((uintptr_t)srcBuffer->getGraphicsAllocation()->getGpuAddress()), *pArgument);
}
@@ -308,7 +308,7 @@ HWTEST_F(EnqueueCopyBufferTest, argumentOneShouldMatchDestAddress) {
ASSERT_NE(nullptr, kernel);
// Determine where the argument is
auto pArgument = (void **)getStatelessArgumentPointer<FamilyType>(*kernel, 1);
auto pArgument = (void **)getStatelessArgumentPointer<FamilyType>(*kernel, 1u, pCmdQ->getIndirectHeap(IndirectHeap::INDIRECT_OBJECT, 0));
EXPECT_EQ((void *)((uintptr_t)dstBuffer->getGraphicsAllocation()->getGpuAddress()), *pArgument);
}

View File

@@ -334,7 +334,7 @@ HWTEST_F(EnqueueFillBufferCmdTests, argumentZeroShouldMatchDestAddress) {
ASSERT_NE(nullptr, kernel);
// Determine where the argument is
auto pArgument = (void **)getStatelessArgumentPointer<FamilyType>(*kernel, 0);
auto pArgument = (void **)getStatelessArgumentPointer<FamilyType>(*kernel, 0u, pCmdQ->getIndirectHeap(IndirectHeap::INDIRECT_OBJECT, 0));
EXPECT_EQ((void *)((uintptr_t)buffer->getGraphicsAllocation()->getGpuAddress()), *pArgument);
@@ -369,7 +369,7 @@ HWTEST_F(EnqueueFillBufferCmdTests, DISABLED_argumentOneShouldMatchOffset) {
ASSERT_NE(nullptr, kernel);
// Determine where the argument is
auto pArgument = (uint32_t *)getStatelessArgumentPointer<FamilyType>(*kernel, 1);
auto pArgument = (uint32_t *)getStatelessArgumentPointer<FamilyType>(*kernel, 1u, pCmdQ->getIndirectHeap(IndirectHeap::INDIRECT_OBJECT, 0));
ASSERT_NE(nullptr, pArgument);
EXPECT_EQ(0u, *pArgument);
@@ -401,7 +401,7 @@ HWTEST_F(EnqueueFillBufferCmdTests, argumentTwoShouldMatchPatternPtr) {
ASSERT_NE(nullptr, kernel);
// Determine where the argument is
auto pArgument = (void **)getStatelessArgumentPointer<FamilyType>(*kernel, 2);
auto pArgument = (void **)getStatelessArgumentPointer<FamilyType>(*kernel, 2u, pCmdQ->getIndirectHeap(IndirectHeap::INDIRECT_OBJECT, 0));
EXPECT_NE(nullptr, *pArgument);
context.getMemoryManager()->freeGraphicsMemory(patternAllocation);