From 2a69b1ed78884c2f52bdb2476f60f356585bd880 Mon Sep 17 00:00:00 2001 From: Bartosz Dunajski Date: Tue, 22 Sep 2020 15:48:24 +0200 Subject: [PATCH] Select correct heap base address for ISA Change-Id: I400f965faa4615519729756daa78350a46c46ff2 Signed-off-by: Bartosz Dunajski --- .../core/source/cmdqueue/cmdqueue_hw_base.inl | 4 +++ .../sources/cmdqueue/test_cmdqueue.cpp | 33 ++++++++++++++++--- .../enqueue_copy_buffer_rect_tests.cpp | 8 +++++ .../enqueue_copy_buffer_tests.cpp | 4 +++ .../enqueue_copy_buffer_to_image_tests.cpp | 4 +++ .../enqueue_copy_image_tests.cpp | 4 +++ .../enqueue_copy_image_to_buffer_tests.cpp | 4 +++ .../enqueue_fill_buffer_tests.cpp | 4 +++ .../enqueue_fill_image_tests.cpp | 4 +++ .../command_queue/enqueue_kernel_2_tests.cpp | 4 +++ .../enqueue_read_buffer_rect_tests.cpp | 4 +++ .../enqueue_read_buffer_tests.cpp | 4 +++ .../enqueue_read_image_tests.cpp | 4 +++ .../enqueue_write_buffer_rect_tests.cpp | 4 +++ .../enqueue_write_buffer_tests.cpp | 4 +++ .../enqueue_write_image_tests.cpp | 4 +++ ...and_stream_receiver_flush_task_1_tests.cpp | 5 ++- ...and_stream_receiver_flush_task_2_tests.cpp | 9 +++-- .../gen_commands_common_validation.h | 6 ++-- .../unit_test/helpers/hw_helper_tests.cpp | 6 +++- ...nager_allocate_in_preferred_pool_tests.inl | 2 +- .../source/command_container/cmdcontainer.cpp | 6 +++- .../source/command_container/cmdcontainer.h | 3 ++ .../command_encoder_base.inl | 1 + .../command_stream_receiver_hw_base.inl | 4 ++- shared/source/helpers/hw_helper_base.inl | 2 +- shared/source/helpers/state_base_address.h | 5 +-- .../helpers/state_base_address_base.inl | 7 ++-- .../source/helpers/state_base_address_bdw.inl | 2 +- .../helpers/state_base_address_skl_plus.inl | 2 +- .../command_container_tests.cpp | 12 +++++-- .../helpers/state_base_address_tests.cpp | 1 + 32 files changed, 146 insertions(+), 24 deletions(-) diff --git a/level_zero/core/source/cmdqueue/cmdqueue_hw_base.inl b/level_zero/core/source/cmdqueue/cmdqueue_hw_base.inl index 1a353a6901..74862bf4fd 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue_hw_base.inl +++ b/level_zero/core/source/cmdqueue/cmdqueue_hw_base.inl @@ -43,6 +43,9 @@ void CommandQueueHw::programGeneralStateBaseAddress(uint64_t gsba *pcCmd = cmd; NEO::Device *neoDevice = device->getNEODevice(); + auto &hwInfo = neoDevice->getHardwareInfo(); + auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily); + NEO::EncodeWA::encodeAdditionalPipelineSelect(*neoDevice, commandStream, true); auto pSbaCmd = static_cast(commandStream.getSpace(sizeof(STATE_BASE_ADDRESS))); @@ -56,6 +59,7 @@ void CommandQueueHw::programGeneralStateBaseAddress(uint64_t gsba true, (device->getMOCS(true, false) >> 1), neoDevice->getMemoryManager()->getInternalHeapBaseAddress(device->getRootDeviceIndex(), useLocalMemoryForIndirectHeap), + neoDevice->getMemoryManager()->getInternalHeapBaseAddress(device->getRootDeviceIndex(), !hwHelper.useSystemMemoryPlacementForISA(hwInfo)), true, neoDevice->getGmmHelper(), false); diff --git a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue.cpp b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue.cpp index 5ca1fd1ca6..af3766c38f 100644 --- a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue.cpp @@ -108,13 +108,38 @@ HWTEST2_F(CommandQueueProgramSBATest, whenCreatingCommandQueueThenItIsInitialize uint32_t alignedSize = 4096u; NEO::LinearStream child(commandQueue->commandStream->getSpace(alignedSize), alignedSize); - EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, true)) - .Times(1); + auto &hwHelper = HwHelper::get(neoDevice->getHardwareInfo().platform.eRenderCoreFamily); + bool isaInLocalMemory = !hwHelper.useSystemMemoryPlacementForISA(neoDevice->getHardwareInfo()); + + if (isaInLocalMemory) { + EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, true)) + .Times(2); + + EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, false)) + .Times(0); + } else { + EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, true)) + .Times(1); // IOH + + EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, false)) + .Times(1); // instruction heap + } commandQueue->programGeneralStateBaseAddress(0u, true, child); - EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, false)) - .Times(1); + if (isaInLocalMemory) { + EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, false)) + .Times(1); // IOH + + EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, true)) + .Times(1); // instruction heap + } else { + EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, true)) + .Times(0); + + EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, false)) + .Times(2); + } commandQueue->programGeneralStateBaseAddress(0u, false, child); diff --git a/opencl/test/unit_test/command_queue/enqueue_copy_buffer_rect_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_copy_buffer_rect_tests.cpp index b281a65280..09d6537970 100644 --- a/opencl/test/unit_test/command_queue/enqueue_copy_buffer_rect_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_copy_buffer_rect_tests.cpp @@ -223,7 +223,11 @@ HWTEST_F(EnqueueCopyBufferRectTest, WhenCopyingBufferRect2DThenL3ProgrammingIsCo HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyBufferRectTest, When2DEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) { enqueueCopyBufferRect2D(); auto &ultCsr = this->pDevice->getUltCommandStreamReceiver(); + + auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); + validateStateBaseAddress(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()), + ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())), pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu); } @@ -343,7 +347,11 @@ HWTEST_F(EnqueueCopyBufferRectTest, WhenCopyingBufferRect3DThenL3ProgrammingIsCo HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyBufferRectTest, When3DEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) { enqueueCopyBufferRect3D(); auto &ultCsr = this->pDevice->getUltCommandStreamReceiver(); + + auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); + validateStateBaseAddress(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()), + ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())), pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu); } diff --git a/opencl/test/unit_test/command_queue/enqueue_copy_buffer_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_copy_buffer_tests.cpp index f41e64f5a6..506609f7d5 100644 --- a/opencl/test/unit_test/command_queue/enqueue_copy_buffer_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_copy_buffer_tests.cpp @@ -192,7 +192,11 @@ HWTEST_F(EnqueueCopyBufferTest, WhenCopyingBufferThenL3ProgrammingIsCorrect) { HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyBufferTest, WhenEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) { enqueueCopyBufferAndParse(); auto &ultCsr = this->pDevice->getUltCommandStreamReceiver(); + + auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); + validateStateBaseAddress(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()), + ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())), pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu); } diff --git a/opencl/test/unit_test/command_queue/enqueue_copy_buffer_to_image_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_copy_buffer_to_image_tests.cpp index 1364f35018..f566c7f7ae 100644 --- a/opencl/test/unit_test/command_queue/enqueue_copy_buffer_to_image_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_copy_buffer_to_image_tests.cpp @@ -96,7 +96,11 @@ HWTEST_F(EnqueueCopyBufferToImageTest, WhenCopyingBufferToImageThenL3Programming HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyBufferToImageTest, WhenEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) { enqueueCopyBufferToImage(); auto &ultCsr = this->pDevice->getUltCommandStreamReceiver(); + + auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); + validateStateBaseAddress(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()), + ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())), pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu); } diff --git a/opencl/test/unit_test/command_queue/enqueue_copy_image_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_copy_image_tests.cpp index 65940b687d..57a104ac1a 100644 --- a/opencl/test/unit_test/command_queue/enqueue_copy_image_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_copy_image_tests.cpp @@ -98,7 +98,11 @@ HWTEST_F(EnqueueCopyImageTest, WhenCopyingImageThenL3ProgrammingIsCorrect) { HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyImageTest, WhenEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) { enqueueCopyImage(); auto &ultCsr = this->pDevice->getUltCommandStreamReceiver(); + + auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); + validateStateBaseAddress(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()), + ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())), pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu); } diff --git a/opencl/test/unit_test/command_queue/enqueue_copy_image_to_buffer_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_copy_image_to_buffer_tests.cpp index c0b09807ea..502dd1a9ca 100644 --- a/opencl/test/unit_test/command_queue/enqueue_copy_image_to_buffer_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_copy_image_to_buffer_tests.cpp @@ -97,7 +97,11 @@ HWTEST_F(EnqueueCopyImageToBufferTest, WhenCopyingImageToBufferThenL3Programming HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyImageToBufferTest, WhenEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) { enqueueCopyImageToBuffer(); auto &ultCsr = this->pDevice->getUltCommandStreamReceiver(); + + auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); + validateStateBaseAddress(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()), + ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())), pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu); } diff --git a/opencl/test/unit_test/command_queue/enqueue_fill_buffer_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_fill_buffer_tests.cpp index 4490984893..596ffc654d 100644 --- a/opencl/test/unit_test/command_queue/enqueue_fill_buffer_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_fill_buffer_tests.cpp @@ -213,7 +213,11 @@ HWTEST_F(EnqueueFillBufferCmdTests, WhenFillingBufferThenL3ProgrammingIsCorrect) HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueFillBufferCmdTests, WhenEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) { enqueueFillBuffer(); auto &ultCsr = this->pDevice->getUltCommandStreamReceiver(); + + auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); + validateStateBaseAddress(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()), + ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())), pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu); } diff --git a/opencl/test/unit_test/command_queue/enqueue_fill_image_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_fill_image_tests.cpp index 052176d745..f42e8dbeee 100644 --- a/opencl/test/unit_test/command_queue/enqueue_fill_image_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_fill_image_tests.cpp @@ -105,7 +105,11 @@ HWTEST_F(EnqueueFillImageTest, WhenFillingImageThenL3ProgrammingIsCorrect) { HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueFillImageTest, WhenEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) { enqueueFillImage(); auto &ultCsr = this->pDevice->getUltCommandStreamReceiver(); + + auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); + validateStateBaseAddress(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()), + ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())), pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu); } diff --git a/opencl/test/unit_test/command_queue/enqueue_kernel_2_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_kernel_2_tests.cpp index 392ea92ff7..2a09317557 100644 --- a/opencl/test/unit_test/command_queue/enqueue_kernel_2_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_kernel_2_tests.cpp @@ -186,7 +186,11 @@ HWCMDTEST_P(IGFX_GEN8_CORE, EnqueueWorkItemTestsWithLimitedParamSet, LoadRegiste HWCMDTEST_P(IGFX_GEN8_CORE, EnqueueWorkItemTestsWithLimitedParamSet, WhenEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) { enqueueKernel(); auto &ultCsr = this->pDevice->getUltCommandStreamReceiver(); + + auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); + validateStateBaseAddress(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()), + ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())), pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, context->getMemoryManager()->peekForce32BitAllocations() ? context->getMemoryManager()->getExternalHeapBaseAddress(ultCsr.rootDeviceIndex, false) : 0llu); } diff --git a/opencl/test/unit_test/command_queue/enqueue_read_buffer_rect_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_read_buffer_rect_tests.cpp index 7a1250041b..8d49ce66ee 100644 --- a/opencl/test/unit_test/command_queue/enqueue_read_buffer_rect_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_read_buffer_rect_tests.cpp @@ -209,7 +209,11 @@ HWTEST_F(EnqueueReadBufferRectTest, WhenReadingBufferThenL3ProgrammingIsCorrect) HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueReadBufferRectTest, When2DEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) { enqueueReadBufferRect2D(); auto &ultCsr = this->pDevice->getUltCommandStreamReceiver(); + + auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); + validateStateBaseAddress(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()), + ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())), pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu); } diff --git a/opencl/test/unit_test/command_queue/enqueue_read_buffer_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_read_buffer_tests.cpp index 7287c9e898..c0d033a502 100644 --- a/opencl/test/unit_test/command_queue/enqueue_read_buffer_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_read_buffer_tests.cpp @@ -173,7 +173,11 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueReadBufferTypeTest, WhenEnqueueIsDoneThenStat srcBuffer->forceDisallowCPUCopy = true; enqueueReadBuffer(); auto &ultCsr = this->pDevice->getUltCommandStreamReceiver(); + + auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); + validateStateBaseAddress(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()), + ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())), pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu); } diff --git a/opencl/test/unit_test/command_queue/enqueue_read_image_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_read_image_tests.cpp index c327a11ae0..5d4a3a4cbf 100644 --- a/opencl/test/unit_test/command_queue/enqueue_read_image_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_read_image_tests.cpp @@ -108,7 +108,11 @@ HWTEST_F(EnqueueReadImageTest, WhenReadingImageThenL3ProgrammingIsCorrect) { HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueReadImageTest, WhenEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) { enqueueReadImage(); auto &ultCsr = this->pDevice->getUltCommandStreamReceiver(); + + auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); + validateStateBaseAddress(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()), + ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())), pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu); } diff --git a/opencl/test/unit_test/command_queue/enqueue_write_buffer_rect_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_write_buffer_rect_tests.cpp index be87dcdab2..334ae711e6 100644 --- a/opencl/test/unit_test/command_queue/enqueue_write_buffer_rect_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_write_buffer_rect_tests.cpp @@ -183,7 +183,11 @@ HWTEST_F(EnqueueWriteBufferRectTest, WhenWritingBufferThenL3ProgrammingIsCorrect HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueWriteBufferRectTest, When2DEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) { enqueueWriteBufferRect2D(); auto &ultCsr = this->pDevice->getUltCommandStreamReceiver(); + + auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); + validateStateBaseAddress(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()), + ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())), pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu); } diff --git a/opencl/test/unit_test/command_queue/enqueue_write_buffer_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_write_buffer_tests.cpp index 76a86e3d65..aa9a8f22d9 100644 --- a/opencl/test/unit_test/command_queue/enqueue_write_buffer_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_write_buffer_tests.cpp @@ -171,7 +171,11 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueWriteBufferTypeTest, WhenEnqueueIsDoneThenSta srcBuffer->forceDisallowCPUCopy = true; enqueueWriteBuffer(); auto &ultCsr = this->pDevice->getUltCommandStreamReceiver(); + + auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); + validateStateBaseAddress(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()), + ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())), pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu); } diff --git a/opencl/test/unit_test/command_queue/enqueue_write_image_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_write_image_tests.cpp index 7dcb436341..e5e2d3a0eb 100644 --- a/opencl/test/unit_test/command_queue/enqueue_write_image_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_write_image_tests.cpp @@ -108,7 +108,11 @@ HWTEST_F(EnqueueWriteImageTest, WhenWritingImageThenL3ProgrammingIsCorrect) { HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueWriteImageTest, WhenEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) { enqueueWriteImage(); auto &ultCsr = this->pDevice->getUltCommandStreamReceiver(); + + auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); + validateStateBaseAddress(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()), + ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())), pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu); } diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp index 95173583c4..509b1897df 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp @@ -517,8 +517,11 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, stateBaseAddres ASSERT_NE(nullptr, cmdStateBaseAddress); auto &cmd = *reinterpret_cast(cmdStateBaseAddress); + auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); + auto instructionHeapBaseAddress = commandStreamReceiver.getMemoryManager()->getInternalHeapBaseAddress(commandStreamReceiver.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())); + EXPECT_EQ(dsh.getCpuBase(), reinterpret_cast(cmd.getDynamicStateBaseAddress())); - EXPECT_EQ(commandStreamReceiver.getMemoryManager()->getInternalHeapBaseAddress(commandStreamReceiver.rootDeviceIndex, ioh.getGraphicsAllocation()->isAllocatedInLocalMemoryPool()), cmd.getInstructionBaseAddress()); + EXPECT_EQ(instructionHeapBaseAddress, cmd.getInstructionBaseAddress()); EXPECT_EQ(ioh.getCpuBase(), reinterpret_cast(cmd.getIndirectObjectBaseAddress())); EXPECT_EQ(ssh.getCpuBase(), reinterpret_cast(cmd.getSurfaceStateBaseAddress())); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp index f988edbf84..1e4f7a8c7a 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp @@ -1134,7 +1134,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenCsrInNonDi EXPECT_EQ(0u, surfacesForResidency.size()); } -HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrWhenGeneralStateBaseAddressIsProgrammedThenDecanonizedAddressIsWritten) { +HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenCsrWhenGeneralStateBaseAddressIsProgrammedThenDecanonizedAddressIsWritten) { uint64_t generalStateBaseAddress = 0xffff800400010000ull; DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags(); @@ -1147,6 +1147,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrWhenGeneralStateBaseAddres generalStateBaseAddress, true, 0, + 0, generalStateBaseAddress, true, pDevice->getGmmHelper(), @@ -1167,6 +1168,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenNonZeroGeneralStateBaseAddres generalStateBaseAddress, false, 0, + 0, generalStateBaseAddress, true, pDevice->getGmmHelper(), @@ -1190,6 +1192,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenNonZeroInternalHeapBaseAddres true, 0, internalHeapBaseAddress, + 0, false, pDevice->getGmmHelper(), false); @@ -1205,6 +1208,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenSbaProgram DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags(); uint64_t internalHeapBase = 0x10000; + uint64_t instructionHeapBase = 0x10000; uint64_t generalStateBase = 0x30000; typename FamilyType::STATE_BASE_ADDRESS sbaCmd; @@ -1216,6 +1220,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenSbaProgram true, 0, internalHeapBase, + instructionHeapBase, true, pDevice->getGmmHelper(), false); @@ -1234,7 +1239,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenSbaProgram EXPECT_EQ(0u, sbaCmd.getSurfaceStateBaseAddress()); EXPECT_TRUE(sbaCmd.getInstructionBaseAddressModifyEnable()); - EXPECT_EQ(internalHeapBase, sbaCmd.getInstructionBaseAddress()); + EXPECT_EQ(instructionHeapBase, sbaCmd.getInstructionBaseAddress()); EXPECT_TRUE(sbaCmd.getInstructionBufferSizeModifyEnable()); EXPECT_EQ(MemoryConstants::sizeOf4GBinPageEntities, sbaCmd.getInstructionBufferSize()); diff --git a/opencl/test/unit_test/gen_common/gen_commands_common_validation.h b/opencl/test/unit_test/gen_common/gen_commands_common_validation.h index efae1b1bbc..43c816e884 100644 --- a/opencl/test/unit_test/gen_common/gen_commands_common_validation.h +++ b/opencl/test/unit_test/gen_common/gen_commands_common_validation.h @@ -19,7 +19,9 @@ namespace NEO { template -void validateStateBaseAddress(uint64_t internalHeapBase, IndirectHeap *pDSH, +void validateStateBaseAddress(uint64_t indirectObjectHeapBase, + uint64_t instructionHeapBaseAddress, + IndirectHeap *pDSH, IndirectHeap *pIOH, IndirectHeap *pSSH, GenCmdList::iterator &startCommand, @@ -45,7 +47,7 @@ void validateStateBaseAddress(uint64_t internalHeapBase, IndirectHeap *pDSH, EXPECT_EQ(expectedGeneralStateHeapBaseAddress, cmd->getGeneralStateBaseAddress()); EXPECT_EQ(pSSH->getGraphicsAllocation()->getGpuAddress(), cmd->getSurfaceStateBaseAddress()); EXPECT_EQ(pIOH->getGraphicsAllocation()->getGpuBaseAddress(), cmd->getIndirectObjectBaseAddress()); - EXPECT_EQ(internalHeapBase, cmd->getInstructionBaseAddress()); + EXPECT_EQ(instructionHeapBaseAddress, cmd->getInstructionBaseAddress()); // Verify all sizes are getting programmed EXPECT_TRUE(cmd->getDynamicStateBufferSizeModifyEnable()); diff --git a/opencl/test/unit_test/helpers/hw_helper_tests.cpp b/opencl/test/unit_test/helpers/hw_helper_tests.cpp index 3bcc580582..88f0e52d13 100644 --- a/opencl/test/unit_test/helpers/hw_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hw_helper_tests.cpp @@ -994,10 +994,14 @@ TEST(HwInfoConfigCommonHelperTest, givenBlitterPreferenceWhenEnablingBlitterOper EXPECT_EQ(expectedBlitterSupport, hardwareInfo.capabilityTable.blitterOperationsSupported); } -HWTEST_F(HwHelperTest, givenHwHelperWhenAskingForIsaSystemMemoryPlacementThenReturnFalse) { +HWTEST_F(HwHelperTest, givenHwHelperWhenAskingForIsaSystemMemoryPlacementThenReturnFalseIfLocalMemorySupported) { HwHelper &hwHelper = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily); + hardwareInfo.featureTable.ftrLocalMemory = true; EXPECT_FALSE(hwHelper.useSystemMemoryPlacementForISA(hardwareInfo)); + + hardwareInfo.featureTable.ftrLocalMemory = false; + EXPECT_TRUE(hwHelper.useSystemMemoryPlacementForISA(hardwareInfo)); } TEST(HwInfoConfigCommonHelperTest, givenDebugFlagSetWhenEnablingBlitterOperationsSupportThenHonorTheFlag) { diff --git a/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.inl b/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.inl index 8b4616e9c3..e468e9995c 100644 --- a/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.inl +++ b/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.inl @@ -633,7 +633,7 @@ HWTEST_F(GetAllocationDataTestHw, givenKernelIsaTypeWhenGetAllocationDataIsCalle MockMemoryManager mockMemoryManager; AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::KERNEL_ISA, mockDeviceBitfield}; mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties)); - EXPECT_FALSE(allocData.flags.useSystemMemory); + EXPECT_NE(defaultHwInfo->featureTable.ftrLocalMemory, allocData.flags.useSystemMemory); } HWTEST_F(GetAllocationDataTestHw, givenLinearStreamWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) { diff --git a/shared/source/command_container/cmdcontainer.cpp b/shared/source/command_container/cmdcontainer.cpp index e87703ac59..9343d35e19 100644 --- a/shared/source/command_container/cmdcontainer.cpp +++ b/shared/source/command_container/cmdcontainer.cpp @@ -87,7 +87,11 @@ ErrorCode CommandContainer::initialize(Device *device) { indirectHeaps[i] = std::make_unique(allocationIndirectHeaps[i], requireInternalHeap); } - instructionHeapBaseAddress = device->getMemoryManager()->getInternalHeapBaseAddress(device->getRootDeviceIndex(), allocationIndirectHeaps[IndirectHeap::Type::INDIRECT_OBJECT]->isAllocatedInLocalMemoryPool()); + auto &hwHelper = HwHelper::get(getDevice()->getHardwareInfo().platform.eRenderCoreFamily); + + indirectObjectHeapBaseAddress = device->getMemoryManager()->getInternalHeapBaseAddress(device->getRootDeviceIndex(), allocationIndirectHeaps[IndirectHeap::Type::INDIRECT_OBJECT]->isAllocatedInLocalMemoryPool()); + + instructionHeapBaseAddress = device->getMemoryManager()->getInternalHeapBaseAddress(device->getRootDeviceIndex(), !hwHelper.useSystemMemoryPlacementForISA(getDevice()->getHardwareInfo())); reserveBindlessOffsets(*indirectHeaps[IndirectHeap::Type::SURFACE_STATE]); diff --git a/shared/source/command_container/cmdcontainer.h b/shared/source/command_container/cmdcontainer.h index 10f08bb152..763d13e6a0 100644 --- a/shared/source/command_container/cmdcontainer.h +++ b/shared/source/command_container/cmdcontainer.h @@ -74,6 +74,8 @@ class CommandContainer : public NonCopyableOrMovableClass { uint64_t getInstructionHeapBaseAddress() const { return instructionHeapBaseAddress; } + uint64_t getIndirectObjectHeapBaseAddress() const { return indirectObjectHeapBaseAddress; } + void *getHeapSpaceAllowGrow(HeapType heapType, size_t size); ErrorCode initialize(Device *device); @@ -108,6 +110,7 @@ class CommandContainer : public NonCopyableOrMovableClass { CmdBufferContainer cmdBufferAllocations; GraphicsAllocation *allocationIndirectHeaps[HeapType::NUM_TYPES] = {}; uint64_t instructionHeapBaseAddress = 0u; + uint64_t indirectObjectHeapBaseAddress = 0u; uint32_t dirtyHeaps = std::numeric_limits::max(); uint32_t numIddsPerBlock = 64; diff --git a/shared/source/command_container/command_encoder_base.inl b/shared/source/command_container/command_encoder_base.inl index cf5a6457b3..7a876eacc3 100644 --- a/shared/source/command_container/command_encoder_base.inl +++ b/shared/source/command_container/command_encoder_base.inl @@ -351,6 +351,7 @@ void EncodeStateBaseAddress::encode(CommandContainer &container, STATE_B 0, false, (gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1), + container.getIndirectObjectHeapBaseAddress(), container.getInstructionHeapBaseAddress(), false, gmmHelper, diff --git a/shared/source/command_stream/command_stream_receiver_hw_base.inl b/shared/source/command_stream/command_stream_receiver_hw_base.inl index 889dd9c872..91f7ec42ee 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_base.inl @@ -342,9 +342,9 @@ CompletionStamp CommandStreamReceiverHw::flushTask( auto isStateBaseAddressDirty = dshDirty || iohDirty || sshDirty || stateBaseAddressDirty; auto mocsIndex = latestSentStatelessMocsConfig; + auto &hwHelper = HwHelper::get(peekHwInfo().platform.eRenderCoreFamily); if (dispatchFlags.l3CacheSettings != L3CachingSettings::NotApplicable) { - auto &hwHelper = HwHelper::get(peekHwInfo().platform.eRenderCoreFamily); auto l3On = dispatchFlags.l3CacheSettings != L3CachingSettings::l3CacheOff; auto l1On = dispatchFlags.l3CacheSettings == L3CachingSettings::l3AndL1On; mocsIndex = hwHelper.getMocsIndex(*device.getGmmHelper(), l3On, l1On); @@ -375,6 +375,7 @@ CompletionStamp CommandStreamReceiverHw::flushTask( auto stateBaseAddressCmdOffset = commandStreamCSR.getUsed(); auto pCmd = static_cast(commandStreamCSR.getSpace(sizeof(STATE_BASE_ADDRESS))); STATE_BASE_ADDRESS cmd; + auto instructionHeapBaseAddress = getMemoryManager()->getInternalHeapBaseAddress(rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(peekHwInfo())); StateBaseAddressHelper::programStateBaseAddress( &cmd, &dsh, @@ -384,6 +385,7 @@ CompletionStamp CommandStreamReceiverHw::flushTask( true, mocsIndex, getMemoryManager()->getInternalHeapBaseAddress(rootDeviceIndex, ioh.getGraphicsAllocation()->isAllocatedInLocalMemoryPool()), + instructionHeapBaseAddress, true, device.getGmmHelper(), isMultiOsContextCapable()); diff --git a/shared/source/helpers/hw_helper_base.inl b/shared/source/helpers/hw_helper_base.inl index d96717c045..43b0ae0593 100644 --- a/shared/source/helpers/hw_helper_base.inl +++ b/shared/source/helpers/hw_helper_base.inl @@ -494,6 +494,6 @@ bool HwHelperHw::useOnlyGlobalTimestamps() const { template bool HwHelperHw::useSystemMemoryPlacementForISA(const HardwareInfo &hwInfo) const { - return false; + return !hwInfo.featureTable.ftrLocalMemory; } } // namespace NEO diff --git a/shared/source/helpers/state_base_address.h b/shared/source/helpers/state_base_address.h index 624e2025f1..6fbba53f19 100644 --- a/shared/source/helpers/state_base_address.h +++ b/shared/source/helpers/state_base_address.h @@ -28,7 +28,8 @@ struct StateBaseAddressHelper { uint64_t generalStateBase, bool setGeneralStateBaseAddress, uint32_t statelessMocsIndex, - uint64_t internalHeapBase, + uint64_t indirectObjectHeapBaseAddress, + uint64_t instructionHeapBaseAddress, bool setInstructionStateBaseAddress, GmmHelper *gmmHelper, bool isMultiOsContextCapable); @@ -37,7 +38,7 @@ struct StateBaseAddressHelper { STATE_BASE_ADDRESS *stateBaseAddress, const IndirectHeap *ssh, bool setGeneralStateBaseAddress, - uint64_t internalHeapBase, + uint64_t indirectObjectHeapBaseAddress, GmmHelper *gmmHelper, bool isMultiOsContextCapable); diff --git a/shared/source/helpers/state_base_address_base.inl b/shared/source/helpers/state_base_address_base.inl index 7ef0685602..bdab67a794 100644 --- a/shared/source/helpers/state_base_address_base.inl +++ b/shared/source/helpers/state_base_address_base.inl @@ -23,7 +23,8 @@ void StateBaseAddressHelper::programStateBaseAddress( uint64_t generalStateBase, bool setGeneralStateBaseAddress, uint32_t statelessMocsIndex, - uint64_t internalHeapBase, + uint64_t indirectObjectHeapBaseAddress, + uint64_t instructionHeapBaseAddress, bool setInstructionStateBaseAddress, GmmHelper *gmmHelper, bool isMultiOsContextCapable) { @@ -51,7 +52,7 @@ void StateBaseAddressHelper::programStateBaseAddress( if (setInstructionStateBaseAddress) { stateBaseAddress->setInstructionBaseAddressModifyEnable(true); - stateBaseAddress->setInstructionBaseAddress(internalHeapBase); + stateBaseAddress->setInstructionBaseAddress(instructionHeapBaseAddress); stateBaseAddress->setInstructionBufferSizeModifyEnable(true); stateBaseAddress->setInstructionBufferSize(MemoryConstants::sizeOf4GBinPageEntities); stateBaseAddress->setInstructionMemoryObjectControlState(gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER)); @@ -73,7 +74,7 @@ void StateBaseAddressHelper::programStateBaseAddress( stateBaseAddress->setStatelessDataPortAccessMemoryObjectControlState(statelessMocsIndex); - appendStateBaseAddressParameters(stateBaseAddress, ssh, setGeneralStateBaseAddress, internalHeapBase, gmmHelper, isMultiOsContextCapable); + appendStateBaseAddressParameters(stateBaseAddress, ssh, setGeneralStateBaseAddress, indirectObjectHeapBaseAddress, gmmHelper, isMultiOsContextCapable); } } // namespace NEO diff --git a/shared/source/helpers/state_base_address_bdw.inl b/shared/source/helpers/state_base_address_bdw.inl index 62f7abc0f1..9eef7ecef4 100644 --- a/shared/source/helpers/state_base_address_bdw.inl +++ b/shared/source/helpers/state_base_address_bdw.inl @@ -14,7 +14,7 @@ void StateBaseAddressHelper::appendStateBaseAddressParameters( STATE_BASE_ADDRESS *stateBaseAddress, const IndirectHeap *ssh, bool setGeneralStateBaseAddress, - uint64_t internalHeapBase, + uint64_t indirectObjectHeapBaseAddress, GmmHelper *gmmHelper, bool isMultiOsContextCapable) { } diff --git a/shared/source/helpers/state_base_address_skl_plus.inl b/shared/source/helpers/state_base_address_skl_plus.inl index 4578090595..eb8c299c7f 100644 --- a/shared/source/helpers/state_base_address_skl_plus.inl +++ b/shared/source/helpers/state_base_address_skl_plus.inl @@ -14,7 +14,7 @@ void StateBaseAddressHelper::appendStateBaseAddressParameters( STATE_BASE_ADDRESS *stateBaseAddress, const IndirectHeap *ssh, bool setGeneralStateBaseAddress, - uint64_t internalHeapBase, + uint64_t indirectObjectHeapBaseAddress, GmmHelper *gmmHelper, bool isMultiOsContextCapable) { diff --git a/shared/test/unit_test/command_container/command_container_tests.cpp b/shared/test/unit_test/command_container/command_container_tests.cpp index ff2144a767..b722b5accb 100644 --- a/shared/test/unit_test/command_container/command_container_tests.cpp +++ b/shared/test/unit_test/command_container/command_container_tests.cpp @@ -127,8 +127,11 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeThenEverythingIs auto heapAllocation = cmdContainer.getIndirectHeapAllocation(static_cast(i)); EXPECT_EQ(indirectHeap->getGraphicsAllocation(), heapAllocation); } + + auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); + EXPECT_EQ(cmdContainer.getInstructionHeapBaseAddress(), - pDevice->getMemoryManager()->getInternalHeapBaseAddress(0, cmdContainer.getIndirectHeap(HeapType::INDIRECT_OBJECT)->getGraphicsAllocation()->isAllocatedInLocalMemoryPool())); + pDevice->getMemoryManager()->getInternalHeapBaseAddress(0, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo()))); } TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeWithoutDeviceThenReturnedFalse) { @@ -497,15 +500,18 @@ TEST_F(CommandContainerHeaps, givenCommandContainerForDifferentRootDevicesThenIn auto device0 = std::unique_ptr(Device::create(executionEnvironment, 0u)); auto device1 = std::unique_ptr(Device::create(executionEnvironment, 1u)); + auto &hwHelper0 = HwHelper::get(device0->getHardwareInfo().platform.eRenderCoreFamily); + auto &hwHelper1 = HwHelper::get(device1->getHardwareInfo().platform.eRenderCoreFamily); + CommandContainer cmdContainer0; cmdContainer0.initialize(device0.get()); - bool useLocalMemory0 = cmdContainer0.getIndirectHeap(HeapType::INDIRECT_OBJECT)->getGraphicsAllocation()->isAllocatedInLocalMemoryPool(); + bool useLocalMemory0 = !hwHelper0.useSystemMemoryPlacementForISA(device0->getHardwareInfo()); uint64_t baseAddressHeapDevice0 = device0.get()->getMemoryManager()->getInternalHeapBaseAddress(device0->getRootDeviceIndex(), useLocalMemory0); EXPECT_EQ(cmdContainer0.getInstructionHeapBaseAddress(), baseAddressHeapDevice0); CommandContainer cmdContainer1; cmdContainer1.initialize(device1.get()); - bool useLocalMemory1 = cmdContainer0.getIndirectHeap(HeapType::INDIRECT_OBJECT)->getGraphicsAllocation()->isAllocatedInLocalMemoryPool(); + bool useLocalMemory1 = !hwHelper1.useSystemMemoryPlacementForISA(device0->getHardwareInfo()); uint64_t baseAddressHeapDevice1 = device1.get()->getMemoryManager()->getInternalHeapBaseAddress(device1->getRootDeviceIndex(), useLocalMemory1); EXPECT_EQ(cmdContainer1.getInstructionHeapBaseAddress(), baseAddressHeapDevice1); } diff --git a/shared/test/unit_test/helpers/state_base_address_tests.cpp b/shared/test/unit_test/helpers/state_base_address_tests.cpp index a7ea12a7cc..6986bc8fc7 100644 --- a/shared/test/unit_test/helpers/state_base_address_tests.cpp +++ b/shared/test/unit_test/helpers/state_base_address_tests.cpp @@ -55,6 +55,7 @@ HWTEST2_F(SBATest, WhenProgramStateBaseAddressParametersIsCalledThenSBACmdHasBin false, 0, 0, + 0, false, pDevice->getGmmHelper(), true);