mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-06 10:26:29 +08:00
refactor: reorder members to reduce internal padding in structs
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
9b715c3ffc
commit
78a4a92b44
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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());
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user