refactor: reorder members to reduce internal padding in structs

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2024-03-25 14:44:36 +00:00
committed by Compute-Runtime-Automation
parent 9b715c3ffc
commit 78a4a92b44
61 changed files with 288 additions and 266 deletions

View File

@@ -135,7 +135,7 @@ ze_result_t EventPool::initialize(DriverHandle *driver, Context *context, uint32
allocationProperties,
*eventPoolAllocations);
if (isIpcPoolFlagSet()) {
this->isShareableEventMemory = eventPoolAllocations->getDefaultGraphicsAllocation()->isShareableHostMemory;
this->isShareableEventMemory = eventPoolAllocations->getDefaultGraphicsAllocation()->isShareableHostMemory();
}
allocatedMemory = (nullptr != eventPoolPtr);
}

View File

@@ -381,7 +381,7 @@ class MemoryManagerEventPoolIpcMock : public NEO::MockMemoryManager {
MemoryManagerEventPoolIpcMock(NEO::ExecutionEnvironment &executionEnvironment) : NEO::MockMemoryManager(executionEnvironment) {}
void *createMultiGraphicsAllocationInSystemMemoryPool(RootDeviceIndicesContainer &rootDeviceIndices, AllocationProperties &properties, NEO::MultiGraphicsAllocation &multiGraphicsAllocation) override {
alloc = new EventPoolIpcMockGraphicsAllocation(&buffer, sizeof(buffer));
alloc->isShareableHostMemory = true;
alloc->setShareableHostMemory(true);
multiGraphicsAllocation.addAllocation(alloc);
return reinterpret_cast<void *>(alloc->getUnderlyingBuffer());
}
@@ -390,7 +390,7 @@ class MemoryManagerEventPoolIpcMock : public NEO::MockMemoryManager {
return NEO::MockMemoryManager::createGraphicsAllocationFromSharedHandle(handle, properties, requireSpecificBitness, isHostIpcAllocation, reuseSharedAllocation, mapPointer);
}
alloc = new EventPoolIpcMockGraphicsAllocation(&buffer, sizeof(buffer));
alloc->isShareableHostMemory = true;
alloc->setShareableHostMemory(true);
return alloc;
}
GraphicsAllocation *allocateGraphicsMemoryWithProperties(const AllocationProperties &properties) override {
@@ -398,7 +398,7 @@ class MemoryManagerEventPoolIpcMock : public NEO::MockMemoryManager {
return NEO::MockMemoryManager::allocateGraphicsMemoryWithProperties(properties);
}
alloc = new EventPoolIpcMockGraphicsAllocation(&buffer, sizeof(buffer));
alloc->isShareableHostMemory = true;
alloc->setShareableHostMemory(true);
return alloc;
}
char buffer[256];
@@ -820,7 +820,7 @@ TEST_F(EventPoolIPCHandleTests, GivenEventPoolWithIPCEventFlagAndHostMemoryThenS
uint32_t minAllocationSize = eventPool->getEventSize();
EXPECT_GE(allocation->getGraphicsAllocation(device->getNEODevice()->getRootDeviceIndex())->getUnderlyingBufferSize(),
minAllocationSize);
EXPECT_FALSE(allocation->getGraphicsAllocation(device->getNEODevice()->getRootDeviceIndex())->isShareableHostMemory);
EXPECT_FALSE(allocation->getGraphicsAllocation(device->getNEODevice()->getRootDeviceIndex())->isShareableHostMemory());
}
TEST_F(EventPoolIPCHandleTests, GivenIpcEventPoolWhenCreatingEventFromIpcPoolThenExpectIpcFlag) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022-2023 Intel Corporation
* Copyright (C) 2022-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -21,7 +21,7 @@ class MemoryManagerEventPoolIPCMockXeHpc : public NEO::MockMemoryManager {
MemoryManagerEventPoolIPCMockXeHpc(NEO::ExecutionEnvironment &executionEnvironment) : NEO::MockMemoryManager(executionEnvironment) {}
void *createMultiGraphicsAllocationInSystemMemoryPool(RootDeviceIndicesContainer &rootDeviceIndices, AllocationProperties &properties, NEO::MultiGraphicsAllocation &multiGraphicsAllocation) override {
alloc = new NEO::MockGraphicsAllocation(&buffer, sizeof(buffer));
alloc->isShareableHostMemory = true;
alloc->setShareableHostMemory(true);
multiGraphicsAllocation.addAllocation(alloc);
return reinterpret_cast<void *>(alloc->getUnderlyingBuffer());
};