Allocate RTDispatchGlobals as unboxed array

Previously we used an array-of-pointers approach, but using an
array-of-structures is in some ways simpler.

We also split out the RTStack as a separate allocation.

Related-To: LOCI-2966

Signed-off-by: Jim Snow <jim.m.snow@intel.com>
This commit is contained in:
Jim Snow
2022-09-09 03:26:48 +00:00
committed by Compute-Runtime-Automation
parent 519d62d9a1
commit eaa4965ae8
8 changed files with 94 additions and 68 deletions

View File

@@ -98,6 +98,26 @@ TEST_F(DeviceTest, whenAllocateRTDispatchGlobalsIsCalledThenRTDispatchGlobalsIsA
EXPECT_NE(nullptr, pDevice->getRTDispatchGlobals(3));
}
HWTEST2_F(DeviceTest, whenAllocateRTDispatchGlobalsIsCalledAndRTStackAllocationFailsRTDispatchGlobalsIsNotAllocated, IsPVC) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.CreateMultipleSubDevices.set(2);
pDevice->deviceBitfield = 3;
pDevice->subdevices.push_back(new SubDevice(pDevice->executionEnvironment, 0, *pDevice));
pDevice->subdevices.push_back(new SubDevice(pDevice->executionEnvironment, 1, *pDevice));
std::unique_ptr<NEO::MemoryManager> otherMemoryManager;
otherMemoryManager = std::make_unique<NEO::MockMemoryManagerWithCapacity>(*pDevice->executionEnvironment);
static_cast<NEO::MockMemoryManagerWithCapacity &>(*otherMemoryManager).capacity = 25000000;
pDevice->executionEnvironment->memoryManager.swap(otherMemoryManager);
pDevice->initializeRayTracing(5);
EXPECT_EQ(nullptr, pDevice->getRTDispatchGlobals(3));
pDevice->executionEnvironment->memoryManager.swap(otherMemoryManager);
}
TEST_F(DeviceTest, givenDispatchGlobalsAllocationFailsThenRTDispatchGlobalsInfoIsNull) {
std::unique_ptr<NEO::MemoryManager> otherMemoryManager;
otherMemoryManager = std::make_unique<NEO::FailMemoryManager>(1, *pDevice->getExecutionEnvironment());
@@ -624,4 +644,4 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenNonDebuggableOsContextWhenDeviceC
auto device = deviceFactory.rootDevices[0];
auto csr = device->allEngines[device->defaultEngineIndex].commandStreamReceiver;
EXPECT_EQ(0u, csr->peekLatestSentTaskCount());
}
}