Change memory interface makeResident call to accept multiple allocations

Change-Id: I5434e30b5200d89d9912aeb7a06b230220ec1de4
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2020-01-09 17:21:52 +01:00
committed by sys_ocldev
parent eedf063d86
commit 5e4ade58f8
12 changed files with 146 additions and 38 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 Intel Corporation
* Copyright (C) 2019-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -18,14 +18,21 @@ AubMemoryOperationsHandler::AubMemoryOperationsHandler(aub_stream::AubManager *a
this->aubManager = aubManager;
}
MemoryOperationsStatus AubMemoryOperationsHandler::makeResident(GraphicsAllocation &gfxAllocation) {
MemoryOperationsStatus AubMemoryOperationsHandler::makeResident(ArrayRef<GraphicsAllocation *> gfxAllocations) {
if (!aubManager) {
return MemoryOperationsStatus::DEVICE_UNINITIALIZED;
}
auto lock = acquireLock(resourcesLock);
int hint = AubMemDump::DataTypeHintValues::TraceNotype;
aubManager->writeMemory(gfxAllocation.getGpuAddress(), gfxAllocation.getUnderlyingBuffer(), gfxAllocation.getUnderlyingBufferSize(), gfxAllocation.storageInfo.getMemoryBanks(), hint, gfxAllocation.getUsedPageSize());
residentAllocations.push_back(&gfxAllocation);
for (const auto &allocation : gfxAllocations) {
aubManager->writeMemory(allocation->getGpuAddress(),
allocation->getUnderlyingBuffer(),
allocation->getUnderlyingBufferSize(),
allocation->storageInfo.getMemoryBanks(),
hint,
allocation->getUsedPageSize());
residentAllocations.push_back(allocation);
}
return MemoryOperationsStatus::SUCCESS;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 Intel Corporation
* Copyright (C) 2019-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -21,7 +21,7 @@ class AubMemoryOperationsHandler : public MemoryOperationsHandler {
AubMemoryOperationsHandler(aub_stream::AubManager *aubManager);
~AubMemoryOperationsHandler() override = default;
MemoryOperationsStatus makeResident(GraphicsAllocation &gfxAllocation) override;
MemoryOperationsStatus makeResident(ArrayRef<GraphicsAllocation *> gfxAllocations) override;
MemoryOperationsStatus evict(GraphicsAllocation &gfxAllocation) override;
MemoryOperationsStatus isResident(GraphicsAllocation &gfxAllocation) override;
void setAubManager(aub_stream::AubManager *aubManager);