From 676334807fe31e21729454b91cbea671d5533622 Mon Sep 17 00:00:00 2001 From: Compute-Runtime-Validation Date: Mon, 27 Jan 2025 06:04:39 +0100 Subject: [PATCH] Revert "refactor: Switch host events and in order nodes to tagAllocation type" This reverts commit 8bbba3fe5ca36ea0abe367eb0076e8d50fbffce2. Signed-off-by: Compute-Runtime-Validation --- level_zero/core/source/event/event.cpp | 4 ++-- .../unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp | 4 ++-- level_zero/core/test/unit_tests/sources/event/test_event.cpp | 2 +- shared/source/helpers/in_order_cmd_helpers.h | 2 +- shared/test/unit_test/utilities/tag_allocator_tests.cpp | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/level_zero/core/source/event/event.cpp b/level_zero/core/source/event/event.cpp index 2a326e2f9d..9095e49bf8 100644 --- a/level_zero/core/source/event/event.cpp +++ b/level_zero/core/source/event/event.cpp @@ -101,7 +101,7 @@ ze_result_t EventPool::initialize(DriverHandle *driver, Context *context, uint32 initializeSizeParameters(numDevices, deviceHandles, *driverHandleImp, rootDeviceEnvironment); NEO::AllocationType allocationType = isEventPoolTimestampFlagSet() ? NEO::AllocationType::timestampPacketTagBuffer - : NEO::AllocationType::tagBuffer; + : NEO::AllocationType::bufferHostMemory; if (this->devices.size() > 1) { this->isDeviceEventPoolAllocation = false; } @@ -448,7 +448,7 @@ ze_result_t EventPool::openEventPoolIpcHandle(const ze_ipc_event_pool_handle_t & return ZE_RESULT_ERROR_INVALID_ARGUMENT; } - NEO::AllocationType allocationType = NEO::AllocationType::tagBuffer; + NEO::AllocationType allocationType = NEO::AllocationType::bufferHostMemory; if (eventPool->isDeviceEventPoolAllocation) { allocationType = NEO::AllocationType::gpuTimestampDeviceBuffer; } diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp index 5e0f070277..99ae5002a9 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp @@ -2412,7 +2412,7 @@ HWTEST2_F(InOrderCmdListTests, givenDebugFlagSetWhenDispatchingThenEnsureHostAll EXPECT_NE(nullptr, immCmdList2->inOrderExecInfo->getHostCounterAllocation()); EXPECT_NE(immCmdList2->inOrderExecInfo->getDeviceCounterAllocation(), immCmdList2->inOrderExecInfo->getHostCounterAllocation()); - EXPECT_EQ(AllocationType::tagBuffer, immCmdList1->inOrderExecInfo->getHostCounterAllocation()->getAllocationType()); + EXPECT_EQ(AllocationType::bufferHostMemory, immCmdList1->inOrderExecInfo->getHostCounterAllocation()->getAllocationType()); EXPECT_EQ(immCmdList1->inOrderExecInfo->getBaseHostAddress(), immCmdList1->inOrderExecInfo->getHostCounterAllocation()->getUnderlyingBuffer()); EXPECT_FALSE(immCmdList1->inOrderExecInfo->getHostCounterAllocation()->isAllocatedInLocalMemoryPool()); @@ -2421,7 +2421,7 @@ HWTEST2_F(InOrderCmdListTests, givenDebugFlagSetWhenDispatchingThenEnsureHostAll auto hostAllocOffset = ptrDiff(immCmdList2->inOrderExecInfo->getBaseHostAddress(), immCmdList1->inOrderExecInfo->getBaseHostAddress()); EXPECT_NE(0u, hostAllocOffset); - EXPECT_EQ(AllocationType::tagBuffer, immCmdList2->inOrderExecInfo->getHostCounterAllocation()->getAllocationType()); + EXPECT_EQ(AllocationType::bufferHostMemory, immCmdList2->inOrderExecInfo->getHostCounterAllocation()->getAllocationType()); EXPECT_EQ(immCmdList2->inOrderExecInfo->getBaseHostAddress(), ptrOffset(immCmdList2->inOrderExecInfo->getHostCounterAllocation()->getUnderlyingBuffer(), hostAllocOffset)); EXPECT_FALSE(immCmdList2->inOrderExecInfo->getHostCounterAllocation()->isAllocatedInLocalMemoryPool()); diff --git a/level_zero/core/test/unit_tests/sources/event/test_event.cpp b/level_zero/core/test/unit_tests/sources/event/test_event.cpp index a4919b3f06..c0c970a976 100644 --- a/level_zero/core/test/unit_tests/sources/event/test_event.cpp +++ b/level_zero/core/test/unit_tests/sources/event/test_event.cpp @@ -369,7 +369,7 @@ TEST_F(EventPoolCreate, GivenDeviceThenEventPoolIsCreated) { if (l0GfxCoreHelper.alwaysAllocateEventInLocalMem()) { EXPECT_EQ(NEO::AllocationType::gpuTimestampDeviceBuffer, eventPool->getAllocation().getAllocationType()); } else { - EXPECT_EQ(NEO::AllocationType::tagBuffer, eventPool->getAllocation().getAllocationType()); + EXPECT_EQ(NEO::AllocationType::bufferHostMemory, eventPool->getAllocation().getAllocationType()); } eventPool->destroy(); } diff --git a/shared/source/helpers/in_order_cmd_helpers.h b/shared/source/helpers/in_order_cmd_helpers.h index 9deb2348c3..36fd6a4c17 100644 --- a/shared/source/helpers/in_order_cmd_helpers.h +++ b/shared/source/helpers/in_order_cmd_helpers.h @@ -30,7 +30,7 @@ class DeviceAllocNodeType { static constexpr size_t defaultAllocatorTagCount = 128; - static constexpr AllocationType getAllocationType() { return deviceAlloc ? NEO::AllocationType::timestampPacketTagBuffer : NEO::AllocationType::tagBuffer; } + static constexpr AllocationType getAllocationType() { return deviceAlloc ? NEO::AllocationType::timestampPacketTagBuffer : NEO::AllocationType::bufferHostMemory; } static constexpr TagNodeType getTagNodeType() { return TagNodeType::counter64b; } diff --git a/shared/test/unit_test/utilities/tag_allocator_tests.cpp b/shared/test/unit_test/utilities/tag_allocator_tests.cpp index 6c9d429d27..778a7f8172 100644 --- a/shared/test/unit_test/utilities/tag_allocator_tests.cpp +++ b/shared/test/unit_test/utilities/tag_allocator_tests.cpp @@ -482,7 +482,7 @@ TEST_F(TagAllocatorTest, givenTagAllocatorWhenGraphicsAllocationIsCreatedThenSet EXPECT_EQ(AllocationType::profilingTagBuffer, hwTimeStampsTag->getBaseGraphicsAllocation()->getAllocationType()); EXPECT_EQ(AllocationType::profilingTagBuffer, hwPerfCounterTag->getBaseGraphicsAllocation()->getAllocationType()); EXPECT_EQ(AllocationType::timestampPacketTagBuffer, inOrderDeviceTag->getBaseGraphicsAllocation()->getAllocationType()); - EXPECT_EQ(AllocationType::tagBuffer, inOrderHostTag->getBaseGraphicsAllocation()->getAllocationType()); + EXPECT_EQ(AllocationType::bufferHostMemory, inOrderHostTag->getBaseGraphicsAllocation()->getAllocationType()); } TEST_F(TagAllocatorTest, givenMultipleRootDevicesWhenPopulatingTagsThenCreateMultiGraphicsAllocation) {