From 646f5960577f57846f9e551a8e848d16152b2a06 Mon Sep 17 00:00:00 2001 From: Compute-Runtime-Validation Date: Sun, 21 May 2023 11:39:43 +0200 Subject: [PATCH] Revert "fix: add missing host ptr assignment increment" This reverts commit bb86dba152f198c2431d34aab0941a1b1a3d5bfe. Signed-off-by: Compute-Runtime-Validation --- level_zero/core/source/cmdlist/cmdlist.cpp | 1 - level_zero/core/source/cmdqueue/cmdqueue.cpp | 1 - .../test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp | 2 -- .../test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp | 1 - .../test/unit_tests/sources/cmdlist/test_cmdlist_6.cpp | 9 ++------- .../sources/cmdlist/test_cmdlist_append_memory.cpp | 3 --- .../cmdlist/test_cmdlist_append_wait_on_events.cpp | 5 ----- .../core/test/unit_tests/sources/memory/test_memory.cpp | 3 --- 8 files changed, 2 insertions(+), 23 deletions(-) diff --git a/level_zero/core/source/cmdlist/cmdlist.cpp b/level_zero/core/source/cmdlist/cmdlist.cpp index 8767cbbf26..45de31b80d 100644 --- a/level_zero/core/source/cmdlist/cmdlist.cpp +++ b/level_zero/core/source/cmdlist/cmdlist.cpp @@ -107,7 +107,6 @@ NEO::GraphicsAllocation *CommandList::getHostPtrAlloc(const void *buffer, uint64 return nullptr; } if (this->storeExternalPtrAsTemporary()) { - alloc->hostPtrTaskCountAssignment++; this->csr->getInternalAllocationStorage()->storeAllocationWithTaskCount(std::unique_ptr(alloc), NEO::AllocationUsage::TEMPORARY_ALLOCATION, this->csr->peekTaskCount()); } else if (alloc->getAllocationType() == NEO::AllocationType::EXTERNAL_HOST_PTR) { hostPtrMap.insert(std::make_pair(buffer, alloc)); diff --git a/level_zero/core/source/cmdqueue/cmdqueue.cpp b/level_zero/core/source/cmdqueue/cmdqueue.cpp index 0d95d72d2b..04a29ac856 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue.cpp +++ b/level_zero/core/source/cmdqueue/cmdqueue.cpp @@ -335,7 +335,6 @@ void CommandQueueImp::handleIndirectAllocationResidency(UnifiedMemoryControls un void CommandQueueImp::makeResidentAndMigrate(bool performMigration, const NEO::ResidencyContainer &residencyContainer) { for (auto alloc : residencyContainer) { - alloc->prepareHostPtrForResidency(csr); csr->makeResident(*alloc); if (performMigration && (alloc->getAllocationType() == NEO::AllocationType::SVM_GPU || diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp index 99c1c0b3d5..601508953f 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp @@ -8,7 +8,6 @@ #include "shared/source/command_stream/wait_status.h" #include "shared/source/gmm_helper/gmm_helper.h" #include "shared/source/indirect_heap/indirect_heap.h" -#include "shared/source/memory_manager/internal_allocation_storage.h" #include "shared/test/common/cmd_parse/gen_cmd_parse.h" #include "shared/test/common/helpers/relaxed_ordering_commands_helper.h" #include "shared/test/common/helpers/unit_test_helper.h" @@ -1513,7 +1512,6 @@ TEST_F(CommandListCreate, givenImmediateCommandListWhenThereIsNoEnoughSpaceForIm auto result = commandList->appendMemoryCopy(dstPtr, srcPtr, 8, nullptr, 0, nullptr, false); ASSERT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_EQ(1U, commandList->getCmdContainer().getCmdBufferAllocations().size()); - whiteBoxCmdList->csr->getInternalAllocationStorage()->getTemporaryAllocations().freeAllGraphicsAllocations(device->getNEODevice()); } HWTEST2_F(CommandListCreate, GivenGpuHangOnSynchronizingWhenCreatingImmediateCommandListAndWaitingOnEventsThenDeviceLostIsReturned, IsSKL) { diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp index 5bea25f21e..dcb9cada62 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp @@ -1489,7 +1489,6 @@ HWTEST2_F(CommandListCreateWithBcs, givenHostPtrAllocAllocAndImmediateCmdListWhe EXPECT_FALSE(commandList->csr->getInternalAllocationStorage()->getTemporaryAllocations().peekIsEmpty()); EXPECT_EQ(alloc, commandList->csr->getInternalAllocationStorage()->getTemporaryAllocations().peekHead()); EXPECT_EQ(commandList->csr->peekTaskCount(), commandList->csr->getInternalAllocationStorage()->getTemporaryAllocations().peekHead()->getTaskCount(commandList->csr->getOsContext().getContextId())); - EXPECT_EQ(1u, commandList->csr->getInternalAllocationStorage()->getTemporaryAllocations().peekHead()->hostPtrTaskCountAssignment); } HWTEST2_F(CommandListCreate, givenGetAlignedAllocationWhenInternalMemWithinDifferentAllocThenReturnNewAlloc, IsAtLeastSkl) { diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_6.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_6.cpp index 1747d7d860..c4beeeb039 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_6.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_6.cpp @@ -11,7 +11,6 @@ #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/indirect_heap/indirect_heap.h" #include "shared/source/kernel/kernel_descriptor.h" -#include "shared/source/memory_manager/internal_allocation_storage.h" #include "shared/test/common/helpers/unit_test_helper.h" #include "shared/test/common/libult/ult_command_stream_receiver.h" #include "shared/test/common/mocks/mock_command_stream_receiver.h" @@ -228,14 +227,12 @@ HWTEST2_F(CommandListTest, givenCopyCommandListWhenAppendCopyWithDependenciesThe eventDesc.index = 0; auto event = std::unique_ptr(L0::Event::create(eventPool.get(), &eventDesc, device)); void *srcPtr = reinterpret_cast(0x1234); - void *dstPtr = reinterpret_cast(0x5678); + void *dstPtr = reinterpret_cast(0x1234); auto zeEvent = event->toHandle(); cmdList.appendMemoryCopy(dstPtr, srcPtr, sizeof(uint32_t), nullptr, 1, &zeEvent, false); EXPECT_EQ(device->getNEODevice()->getDefaultEngine().commandStreamReceiver->peekBarrierCount(), 0u); - - cmdList.csr->getInternalAllocationStorage()->getTemporaryAllocations().freeAllGraphicsAllocations(device->getNEODevice()); } HWTEST2_F(CommandListTest, givenCopyCommandListWhenAppendCopyRegionWithDependenciesThenDoNotTrackDependencies, IsAtLeastSkl) { @@ -255,15 +252,13 @@ HWTEST2_F(CommandListTest, givenCopyCommandListWhenAppendCopyRegionWithDependenc eventDesc.index = 0; auto event = std::unique_ptr(L0::Event::create(eventPool.get(), &eventDesc, device)); void *srcPtr = reinterpret_cast(0x1234); - void *dstPtr = reinterpret_cast(0x5678); + void *dstPtr = reinterpret_cast(0x1234); auto zeEvent = event->toHandle(); ze_copy_region_t region = {}; cmdList.appendMemoryCopyRegion(dstPtr, ®ion, 0, 0, srcPtr, ®ion, 0, 0, nullptr, 1, &zeEvent, false); EXPECT_EQ(device->getNEODevice()->getDefaultEngine().commandStreamReceiver->peekBarrierCount(), 0u); - - cmdList.csr->getInternalAllocationStorage()->getTemporaryAllocations().freeAllGraphicsAllocations(device->getNEODevice()); } HWTEST2_F(CommandListTest, givenCopyCommandListWhenAppendFillWithDependenciesThenDoNotTrackDependencies, IsAtLeastSkl) { diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_memory.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_memory.cpp index 8b2714da0c..496ffd744c 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_memory.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_memory.cpp @@ -7,7 +7,6 @@ #include "shared/source/command_container/encode_surface_state.h" #include "shared/source/helpers/gfx_core_helper.h" -#include "shared/source/memory_manager/internal_allocation_storage.h" #include "shared/test/common/cmd_parse/gen_cmd_parse.h" #include "shared/test/common/test_macros/hw_test.h" @@ -390,7 +389,6 @@ HWTEST2_F(AppendMemoryCopy, givenAsyncImmediateCommandListWhenAppendingMemoryCop EXPECT_EQ(0u, cmdQueue.synchronizeCalled); EXPECT_EQ(0u, commandList->commandContainer.getResidencyContainer().size()); commandList->cmdQImmediate = nullptr; - commandList->csr->getInternalAllocationStorage()->getTemporaryAllocations().freeAllGraphicsAllocations(device->getNEODevice()); } HWTEST2_F(AppendMemoryCopy, givenAsyncImmediateCommandListWhenAppendingMemoryCopyWithCopyEngineThenProgramCmdStreamWithFlushTask, IsAtLeastSkl) { @@ -604,7 +602,6 @@ HWTEST2_F(AppendMemoryCopy, givenSyncModeImmediateCommandListWhenAppendingMemory EXPECT_EQ(1u, cmdQueue.synchronizeCalled); commandList->cmdQImmediate = nullptr; - commandList->csr->getInternalAllocationStorage()->getTemporaryAllocations().freeAllGraphicsAllocations(device->getNEODevice()); } HWTEST2_F(AppendMemoryCopy, givenCommandListAndHostPointersWhenMemoryCopyCalledThenPipeControlWithDcFlushAdded, IsAtLeastSkl) { diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_wait_on_events.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_wait_on_events.cpp index 9bf9ad716c..9a2b57227b 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_wait_on_events.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_wait_on_events.cpp @@ -7,7 +7,6 @@ #include "shared/source/command_container/command_encoder.h" #include "shared/source/helpers/gfx_core_helper.h" -#include "shared/source/memory_manager/internal_allocation_storage.h" #include "shared/test/common/cmd_parse/gen_cmd_parse.h" #include "shared/test/common/helpers/unit_test_helper.h" #include "shared/test/common/libult/ult_command_stream_receiver.h" @@ -708,7 +707,6 @@ HWTEST_TEMPLATED_F(TbxImmediateCommandListTest, givenTbxModeOnFlushTaskImmediate commandListImmediate->appendMemoryCopy(dstPtr, srcPtr, 8, nullptr, 1, &eventHandle, false); EXPECT_TRUE(ultCsr.downloadAllocationsCalled); - ultCsr.getInternalAllocationStorage()->getTemporaryAllocations().freeAllGraphicsAllocations(neoDevice); } HWTEST_TEMPLATED_F(TbxImmediateCommandListTest, givenTbxModeOnFlushTaskImmediateAsyncCommandListWhenAppendMemoryCopyRegionThenExpectDownloadAllocations) { @@ -722,7 +720,6 @@ HWTEST_TEMPLATED_F(TbxImmediateCommandListTest, givenTbxModeOnFlushTaskImmediate commandListImmediate->appendMemoryCopyRegion(dstPtr, &dstRegion, 0, 0, srcPtr, &srcRegion, 0, 0, nullptr, 1, &eventHandle, false); EXPECT_TRUE(ultCsr.downloadAllocationsCalled); - ultCsr.getInternalAllocationStorage()->getTemporaryAllocations().freeAllGraphicsAllocations(neoDevice); } HWTEST_TEMPLATED_F(TbxImmediateCommandListTest, givenTbxModeOnFlushTaskImmediateAsyncCommandListWhenAppendMemoryFillThenExpectDownloadAllocations) { @@ -814,7 +811,6 @@ HWTEST_TEMPLATED_F(TbxImmediateCommandListTest, givenTbxModeOnFlushTaskImmediate commandListImmediate->appendImageCopyFromMemory(imagePtr->toHandle(), ptr, nullptr, nullptr, 1, &eventHandle, false); EXPECT_TRUE(ultCsr.downloadAllocationsCalled); - ultCsr.getInternalAllocationStorage()->getTemporaryAllocations().freeAllGraphicsAllocations(neoDevice); } HWTEST_TEMPLATED_F(TbxImmediateCommandListTest, givenTbxModeOnFlushTaskImmediateAsyncCommandListWhenAppendImageCopyToMemoryThenExpectDownloadAllocations) { @@ -840,7 +836,6 @@ HWTEST_TEMPLATED_F(TbxImmediateCommandListTest, givenTbxModeOnFlushTaskImmediate commandListImmediate->appendImageCopyToMemory(ptr, imagePtr->toHandle(), nullptr, nullptr, 1, &eventHandle, false); EXPECT_TRUE(ultCsr.downloadAllocationsCalled); - ultCsr.getInternalAllocationStorage()->getTemporaryAllocations().freeAllGraphicsAllocations(neoDevice); } HWTEST_TEMPLATED_F(TbxImmediateCommandListTest, givenTbxModeOnFlushTaskImmediateAsyncCommandListWhenAppendMemoryRangesBarrierThenExpectDownloadAllocations) { diff --git a/level_zero/core/test/unit_tests/sources/memory/test_memory.cpp b/level_zero/core/test/unit_tests/sources/memory/test_memory.cpp index 1c9660fde8..ce6cfe4f04 100644 --- a/level_zero/core/test/unit_tests/sources/memory/test_memory.cpp +++ b/level_zero/core/test/unit_tests/sources/memory/test_memory.cpp @@ -11,7 +11,6 @@ #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/helpers/string.h" #include "shared/source/memory_manager/graphics_allocation.h" -#include "shared/source/memory_manager/internal_allocation_storage.h" #include "shared/source/memory_manager/memory_operations_status.h" #include "shared/source/os_interface/device_factory.h" #include "shared/source/os_interface/os_context.h" @@ -5289,8 +5288,6 @@ HWTEST2_F(MultipleDevicePeerImageTest, ASSERT_EQ(result, ZE_RESULT_SUCCESS); result = image1Dst->destroy(); ASSERT_EQ(result, ZE_RESULT_SUCCESS); - - static_cast(commandList0.get())->csr->getInternalAllocationStorage()->getTemporaryAllocations().freeAllGraphicsAllocations(device0->getNEODevice()); } HWTEST2_F(MultipleDevicePeerImageTest,