mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Pass root device index to Kernel's methods
Related-To: NEO-5001 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
cbde74650a
commit
b85a8ace68
@ -1675,7 +1675,7 @@ HWTEST_F(KernelResidencyTest, givenKernelWhenMakeResidentIsCalledThenExportedFun
|
||||
|
||||
// check getResidency as well
|
||||
std::vector<NEO::Surface *> residencySurfaces;
|
||||
pKernel->getResidency(residencySurfaces);
|
||||
pKernel->getResidency(residencySurfaces, rootDeviceIndex);
|
||||
std::unique_ptr<NEO::ExecutionEnvironment> mockCsrExecEnv;
|
||||
{
|
||||
CommandStreamReceiverMock csrMock;
|
||||
@ -1711,7 +1711,7 @@ HWTEST_F(KernelResidencyTest, givenKernelWhenMakeResidentIsCalledThenGlobalBuffe
|
||||
EXPECT_TRUE(commandStreamReceiver.isMadeResident(program.buildInfos[pDevice->getRootDeviceIndex()].globalSurface));
|
||||
|
||||
std::vector<NEO::Surface *> residencySurfaces;
|
||||
pKernel->getResidency(residencySurfaces);
|
||||
pKernel->getResidency(residencySurfaces, rootDeviceIndex);
|
||||
std::unique_ptr<NEO::ExecutionEnvironment> mockCsrExecEnv;
|
||||
{
|
||||
CommandStreamReceiverMock csrMock;
|
||||
@ -3059,6 +3059,7 @@ TEST(KernelTest, GivenDifferentValuesWhenSetKernelExecutionTypeIsCalledThenCorre
|
||||
|
||||
TEST(KernelTest, givenKernelLocalIdGenerationByRuntimeFalseWhenGettingStartOffsetThenOffsetToSkipPerThreadDataLoadIsAdded) {
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
||||
auto rootDeviceIndex = device->getRootDeviceIndex();
|
||||
|
||||
MockKernelWithInternals mockKernel(*device);
|
||||
SPatchThreadPayload threadPayload = {};
|
||||
@ -3070,13 +3071,14 @@ TEST(KernelTest, givenKernelLocalIdGenerationByRuntimeFalseWhenGettingStartOffse
|
||||
auto allocationOffset = mockKernel.kernelInfo.getGraphicsAllocation()->getGpuAddressToPatch();
|
||||
|
||||
mockKernel.mockKernel->setStartOffset(128);
|
||||
auto offset = mockKernel.mockKernel->getKernelStartOffset(false, true, false);
|
||||
auto offset = mockKernel.mockKernel->getKernelStartOffset(false, true, false, rootDeviceIndex);
|
||||
EXPECT_EQ(allocationOffset + 256u, offset);
|
||||
device->getMemoryManager()->freeGraphicsMemory(mockKernel.kernelInfo.getGraphicsAllocation());
|
||||
}
|
||||
|
||||
TEST(KernelTest, givenKernelLocalIdGenerationByRuntimeTrueAndLocalIdsUsedWhenGettingStartOffsetThenOffsetToSkipPerThreadDataLoadIsNotAdded) {
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
||||
auto rootDeviceIndex = device->getRootDeviceIndex();
|
||||
|
||||
MockKernelWithInternals mockKernel(*device);
|
||||
SPatchThreadPayload threadPayload = {};
|
||||
@ -3088,13 +3090,14 @@ TEST(KernelTest, givenKernelLocalIdGenerationByRuntimeTrueAndLocalIdsUsedWhenGet
|
||||
auto allocationOffset = mockKernel.kernelInfo.getGraphicsAllocation()->getGpuAddressToPatch();
|
||||
|
||||
mockKernel.mockKernel->setStartOffset(128);
|
||||
auto offset = mockKernel.mockKernel->getKernelStartOffset(true, true, false);
|
||||
auto offset = mockKernel.mockKernel->getKernelStartOffset(true, true, false, rootDeviceIndex);
|
||||
EXPECT_EQ(allocationOffset + 128u, offset);
|
||||
device->getMemoryManager()->freeGraphicsMemory(mockKernel.kernelInfo.getGraphicsAllocation());
|
||||
}
|
||||
|
||||
TEST(KernelTest, givenKernelLocalIdGenerationByRuntimeFalseAndLocalIdsNotUsedWhenGettingStartOffsetThenOffsetToSkipPerThreadDataLoadIsNotAdded) {
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
||||
auto rootDeviceIndex = device->getRootDeviceIndex();
|
||||
|
||||
MockKernelWithInternals mockKernel(*device);
|
||||
SPatchThreadPayload threadPayload = {};
|
||||
@ -3106,7 +3109,7 @@ TEST(KernelTest, givenKernelLocalIdGenerationByRuntimeFalseAndLocalIdsNotUsedWhe
|
||||
auto allocationOffset = mockKernel.kernelInfo.getGraphicsAllocation()->getGpuAddressToPatch();
|
||||
|
||||
mockKernel.mockKernel->setStartOffset(128);
|
||||
auto offset = mockKernel.mockKernel->getKernelStartOffset(false, false, false);
|
||||
auto offset = mockKernel.mockKernel->getKernelStartOffset(false, false, false, rootDeviceIndex);
|
||||
EXPECT_EQ(allocationOffset + 128u, offset);
|
||||
device->getMemoryManager()->freeGraphicsMemory(mockKernel.kernelInfo.getGraphicsAllocation());
|
||||
}
|
||||
|
Reference in New Issue
Block a user