refactor: Switch host events and in order nodes to tagAllocation type
Motivation is to distinguish between host USM resources and internal driver resources allocated in host memory. Related-To: NEO-13847 Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
parent
71fb9c176b
commit
8bbba3fe5c
|
@ -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::bufferHostMemory;
|
||||
: NEO::AllocationType::tagBuffer;
|
||||
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::bufferHostMemory;
|
||||
NEO::AllocationType allocationType = NEO::AllocationType::tagBuffer;
|
||||
if (eventPool->isDeviceEventPoolAllocation) {
|
||||
allocationType = NEO::AllocationType::gpuTimestampDeviceBuffer;
|
||||
}
|
||||
|
|
|
@ -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::bufferHostMemory, immCmdList1->inOrderExecInfo->getHostCounterAllocation()->getAllocationType());
|
||||
EXPECT_EQ(AllocationType::tagBuffer, 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::bufferHostMemory, immCmdList2->inOrderExecInfo->getHostCounterAllocation()->getAllocationType());
|
||||
EXPECT_EQ(AllocationType::tagBuffer, immCmdList2->inOrderExecInfo->getHostCounterAllocation()->getAllocationType());
|
||||
EXPECT_EQ(immCmdList2->inOrderExecInfo->getBaseHostAddress(), ptrOffset(immCmdList2->inOrderExecInfo->getHostCounterAllocation()->getUnderlyingBuffer(), hostAllocOffset));
|
||||
EXPECT_FALSE(immCmdList2->inOrderExecInfo->getHostCounterAllocation()->isAllocatedInLocalMemoryPool());
|
||||
|
||||
|
|
|
@ -369,7 +369,7 @@ TEST_F(EventPoolCreate, GivenDeviceThenEventPoolIsCreated) {
|
|||
if (l0GfxCoreHelper.alwaysAllocateEventInLocalMem()) {
|
||||
EXPECT_EQ(NEO::AllocationType::gpuTimestampDeviceBuffer, eventPool->getAllocation().getAllocationType());
|
||||
} else {
|
||||
EXPECT_EQ(NEO::AllocationType::bufferHostMemory, eventPool->getAllocation().getAllocationType());
|
||||
EXPECT_EQ(NEO::AllocationType::tagBuffer, eventPool->getAllocation().getAllocationType());
|
||||
}
|
||||
eventPool->destroy();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2023-2024 Intel Corporation
|
||||
* Copyright (C) 2023-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -30,7 +30,7 @@ class DeviceAllocNodeType {
|
|||
|
||||
static constexpr size_t defaultAllocatorTagCount = 128;
|
||||
|
||||
static constexpr AllocationType getAllocationType() { return deviceAlloc ? NEO::AllocationType::timestampPacketTagBuffer : NEO::AllocationType::bufferHostMemory; }
|
||||
static constexpr AllocationType getAllocationType() { return deviceAlloc ? NEO::AllocationType::timestampPacketTagBuffer : NEO::AllocationType::tagBuffer; }
|
||||
|
||||
static constexpr TagNodeType getTagNodeType() { return TagNodeType::counter64b; }
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -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::bufferHostMemory, inOrderHostTag->getBaseGraphicsAllocation()->getAllocationType());
|
||||
EXPECT_EQ(AllocationType::tagBuffer, inOrderHostTag->getBaseGraphicsAllocation()->getAllocationType());
|
||||
}
|
||||
|
||||
TEST_F(TagAllocatorTest, givenMultipleRootDevicesWhenPopulatingTagsThenCreateMultiGraphicsAllocation) {
|
||||
|
|
Loading…
Reference in New Issue