Add new allocation type
Related-To: NEO-5244 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
parent
464e4fd1b1
commit
3e4be8d78e
|
@ -1659,13 +1659,15 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendQueryKernelTimestamps(
|
|||
}
|
||||
|
||||
size_t alignedSize = alignUp<size_t>(sizeof(EventData) * numEvents, MemoryConstants::pageSize64k);
|
||||
NEO::GraphicsAllocation::AllocationType allocationType = NEO::GraphicsAllocation::AllocationType::BUFFER;
|
||||
NEO::GraphicsAllocation::AllocationType allocationType = NEO::GraphicsAllocation::AllocationType::GPU_TIMESTAMP_TAG_BUFFER;
|
||||
auto devices = device->getNEODevice()->getDeviceBitfield();
|
||||
NEO::AllocationProperties allocationProperties{device->getRootDeviceIndex(),
|
||||
true,
|
||||
alignedSize,
|
||||
allocationType,
|
||||
devices.count() > 1,
|
||||
false,
|
||||
device->getNEODevice()->getDeviceBitfield()};
|
||||
devices};
|
||||
|
||||
NEO::GraphicsAllocation *timestampsGPUAddress = device->getDriverHandle()->getMemoryManager()->allocateGraphicsMemoryWithProperties(allocationProperties);
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ ze_result_t EventPoolImp::initialize(DriverHandle *driver, uint32_t numDevices,
|
|||
auto deviceBitfield = devices[0]->getNEODevice()->getDeviceBitfield();
|
||||
auto allocationType = isEventPoolUsedForTimestamp ? NEO::GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER : NEO::GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY;
|
||||
if (this->allocOnDevice) {
|
||||
allocationType = NEO::GraphicsAllocation::AllocationType::BUFFER;
|
||||
allocationType = NEO::GraphicsAllocation::AllocationType::GPU_TIMESTAMP_TAG_BUFFER;
|
||||
}
|
||||
|
||||
NEO::AllocationProperties eventPoolAllocationProperties{rootDeviceIndex,
|
||||
|
@ -98,7 +98,7 @@ ze_result_t EventPoolImp::initialize(DriverHandle *driver, uint32_t numDevices,
|
|||
alignUp<size_t>(numEvents * eventSize, MemoryConstants::pageSize64k),
|
||||
allocationType,
|
||||
deviceBitfield.count() > 1,
|
||||
deviceBitfield.count() > 1,
|
||||
false,
|
||||
deviceBitfield};
|
||||
eventPoolAllocationProperties.alignment = MemoryConstants::cacheLineSize;
|
||||
|
||||
|
|
|
@ -624,14 +624,22 @@ HWTEST2_F(AppendQueryKernelTimestamps, givenCommandListWhenAppendQueryKernelTime
|
|||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
bool containsDstPtr = false;
|
||||
|
||||
for (auto &a : commandList.cmdListHelper.residencyContainer) {
|
||||
if (a != nullptr && a->getGpuAddress() == reinterpret_cast<uint64_t>(alloc)) {
|
||||
bool gpuTimeStampAlloc = false;
|
||||
for (auto &residentGfxAlloc : commandList.cmdListHelper.residencyContainer) {
|
||||
if (residentGfxAlloc != nullptr) {
|
||||
if (residentGfxAlloc->getGpuAddress() ==
|
||||
reinterpret_cast<uint64_t>(alloc)) {
|
||||
containsDstPtr = true;
|
||||
}
|
||||
if (residentGfxAlloc->getAllocationType() ==
|
||||
NEO::GraphicsAllocation::AllocationType::GPU_TIMESTAMP_TAG_BUFFER) {
|
||||
gpuTimeStampAlloc = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EXPECT_TRUE(containsDstPtr);
|
||||
EXPECT_TRUE(gpuTimeStampAlloc);
|
||||
|
||||
EXPECT_EQ(testDevice->getBuiltinFunctionsLib()->getFunction(Builtin::QueryKernelTimestamps)->getIsaAllocation()->getGpuAddress(), commandList.cmdListHelper.isaAllocation->getGpuAddress());
|
||||
EXPECT_EQ(2u, commandList.cmdListHelper.groupSize[0]);
|
||||
|
|
|
@ -154,7 +154,7 @@ TEST_F(EventPoolCreate, whenHostVisibleFlagNotSetThenEventAllocationIsOnDevice)
|
|||
|
||||
ASSERT_NE(nullptr, eventPool);
|
||||
|
||||
EXPECT_EQ(NEO::GraphicsAllocation::AllocationType::BUFFER, eventPool->getAllocation().getAllocationType());
|
||||
EXPECT_EQ(NEO::GraphicsAllocation::AllocationType::GPU_TIMESTAMP_TAG_BUFFER, eventPool->getAllocation().getAllocationType());
|
||||
eventPool->destroy();
|
||||
}
|
||||
|
||||
|
|
|
@ -98,6 +98,7 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
|
|||
DEBUG_MODULE_AREA,
|
||||
UNIFIED_SHARED_MEMORY,
|
||||
WORK_PARTITION_SURFACE,
|
||||
GPU_TIMESTAMP_TAG_BUFFER
|
||||
};
|
||||
|
||||
~GraphicsAllocation() override;
|
||||
|
|
|
@ -297,6 +297,7 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo
|
|||
switch (properties.allocationType) {
|
||||
case GraphicsAllocation::AllocationType::SVM_GPU:
|
||||
case GraphicsAllocation::AllocationType::SVM_ZERO_COPY:
|
||||
case GraphicsAllocation::AllocationType::GPU_TIMESTAMP_TAG_BUFFER:
|
||||
allow64KbPages = true;
|
||||
default:
|
||||
break;
|
||||
|
@ -380,6 +381,7 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo
|
|||
case GraphicsAllocation::AllocationType::SURFACE_STATE_HEAP:
|
||||
case GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER:
|
||||
case GraphicsAllocation::AllocationType::DEBUG_MODULE_AREA:
|
||||
case GraphicsAllocation::AllocationType::GPU_TIMESTAMP_TAG_BUFFER:
|
||||
allocationData.flags.resource48Bit = true;
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue