Revert "Allocate all event pools in local memory"

This reverts commit 8aa87a6f8109223d61c5d41214331ffc12659295.

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek 2022-09-09 14:46:31 +00:00 committed by Compute-Runtime-Automation
parent 5b8284d162
commit 48a3cf4b75
2 changed files with 14 additions and 28 deletions

View File

@ -76,8 +76,6 @@ ze_result_t EventPoolImp::initialize(DriverHandle *driver, Context *context, uin
auto &hwHelper = devices[0]->getHwHelper();
useDeviceAlloc |= !NEO::HwInfoConfig::get(devices[0]->getHwInfo().platform.eProductFamily)->isDcFlushAllowed();
eventAlignment = static_cast<uint32_t>(hwHelper.getTimestampPacketAllocatorAlignment());
eventSize = static_cast<uint32_t>(alignUp(EventPacketsCount::eventPackets * hwHelper.getSingleTimestampPacketSize(), eventAlignment));

View File

@ -272,11 +272,6 @@ TEST_F(EventPoolCreate, GivenDeviceThenEventPoolIsCreated) {
auto eventPool = EventPool::create(driverHandle.get(), context, 1, &deviceHandle, &eventPoolDesc, result);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
ASSERT_NE(nullptr, eventPool);
if (NEO::HwInfoConfig::get(device->getHwInfo().platform.eProductFamily)->isDcFlushAllowed()) {
EXPECT_EQ(NEO::AllocationType::BUFFER_HOST_MEMORY, eventPool->getAllocation().getAllocationType());
} else {
EXPECT_EQ(NEO::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, eventPool->getAllocation().getAllocationType());
}
eventPool->destroy();
}
@ -289,6 +284,12 @@ class MemoryManagerEventPoolIPCMock : public NEO::MockMemoryManager {
multiGraphicsAllocation.addAllocation(alloc);
return reinterpret_cast<void *>(alloc->getUnderlyingBuffer());
};
void freeGraphicsMemoryImpl(NEO::GraphicsAllocation *gfxAllocation) override {
delete gfxAllocation;
};
void freeGraphicsMemoryImpl(GraphicsAllocation *gfxAllocation, bool isImportedAllocation) override {
delete gfxAllocation;
};
char buffer[64];
NEO::MockGraphicsAllocation *alloc;
};
@ -330,9 +331,7 @@ TEST_F(EventPoolIPCHandleTests, whenGettingIpcHandleForEventPoolThenHandleAndNum
driverHandle->setMemoryManager(curMemoryManager);
}
using EventPoolCreateMultiDevice = Test<MultiDeviceFixture>;
TEST_F(EventPoolCreateMultiDevice, whenGettingIpcHandleForEventPoolWhenHostShareableMemoryIsFalseThenUnsuportedIsReturned) {
TEST_F(EventPoolIPCHandleTests, whenGettingIpcHandleForEventPoolWhenHostShareableMemoryIsFalseThenUnsuportedIsReturned) {
uint32_t numEvents = 4;
ze_event_pool_desc_t eventPoolDesc = {
ZE_STRUCTURE_TYPE_EVENT_POOL_DESC,
@ -340,16 +339,9 @@ TEST_F(EventPoolCreateMultiDevice, whenGettingIpcHandleForEventPoolWhenHostShare
ZE_EVENT_POOL_FLAG_HOST_VISIBLE | ZE_EVENT_POOL_FLAG_IPC,
numEvents};
uint32_t deviceCount = 0;
ze_result_t result = zeDeviceGet(driverHandle.get(), &deviceCount, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(deviceCount, numRootDevices);
ze_device_handle_t *devices = new ze_device_handle_t[deviceCount];
result = zeDeviceGet(driverHandle.get(), &deviceCount, devices);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
auto eventPool = EventPool::create(driverHandle.get(), context, deviceCount, devices, &eventPoolDesc, result);
auto deviceHandle = device->toHandle();
ze_result_t result = ZE_RESULT_SUCCESS;
auto eventPool = EventPool::create(driverHandle.get(), context, 1, &deviceHandle, &eventPoolDesc, result);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_NE(nullptr, eventPool);
@ -359,7 +351,6 @@ TEST_F(EventPoolCreateMultiDevice, whenGettingIpcHandleForEventPoolWhenHostShare
res = eventPool->destroy();
EXPECT_EQ(res, ZE_RESULT_SUCCESS);
delete[] devices;
}
TEST_F(EventPoolIPCHandleTests, whenOpeningIpcHandleForEventPoolThenEventPoolIsCreatedAndEventSizesAreTheSame) {
@ -1200,15 +1191,11 @@ TEST_F(TimestampEventCreate, givenSingleTimestampEventThenAllocationSizeCreatedF
minTimestampEventAllocation);
}
TEST_F(TimestampEventCreate, givenTimestampEventThenAllocationsIsDependentOfDcFlushAllowed) {
TEST_F(TimestampEventCreate, givenTimestampEventThenAllocationsIsOfPacketTagBufferType) {
auto allocation = &eventPool->getAllocation();
ASSERT_NE(nullptr, allocation);
if (NEO::HwInfoConfig::get(device->getHwInfo().platform.eProductFamily)->isDcFlushAllowed()) {
EXPECT_EQ(NEO::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, allocation->getAllocationType());
} else {
EXPECT_EQ(NEO::AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER, allocation->getAllocationType());
}
EXPECT_EQ(NEO::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER, allocation->getAllocationType());
}
TEST_F(TimestampEventCreate, givenEventTimestampWhenPacketCountIsSetThenCorrectOffsetIsReturned) {
@ -1596,6 +1583,8 @@ TEST_F(TimestampEventCreate, givenEventWhenQueryKernelTimestampThenNotReadyRetur
EXPECT_EQ(0u, resultTimestamp.global.kernelEnd);
}
using EventPoolCreateMultiDevice = Test<MultiDeviceFixture>;
TEST_F(EventPoolCreateMultiDevice, givenReturnSubDevicesAsApiDevicesWhenCallZeGetDevicesThenSubDevicesAreReturnedAsSeparateDevices) {
DebugManagerStateRestore restorer;
NEO::DebugManager.flags.ReturnSubDevicesAsApiDevices.set(1);
@ -1733,7 +1722,6 @@ TEST_F(EventPoolCreateMultiDevice, whenCreatingEventPoolWithNoDevicesThenEventPo
EXPECT_NE(nullptr, allocation);
EXPECT_EQ(allocation->getGraphicsAllocations().size(), numRootDevices);
EXPECT_EQ(NEO::AllocationType::BUFFER_HOST_MEMORY, allocation->getAllocationType());
}
using EventPoolCreateSingleDevice = Test<DeviceFixture>;