Revert "Implement deferrable allocation deletion"

This reverts commit d961bd8354.

Change-Id: Ie7d772d57199ea2897e238b2ac289bd60a89e6c6
This commit is contained in:
Mateusz Jablonski
2018-11-23 13:39:04 +01:00
committed by sys_ocldev
parent 6714fe84b8
commit f877d4254b
7 changed files with 0 additions and 169 deletions

View File

@@ -9,8 +9,6 @@ set(RUNTIME_SRCS_MEMORY_MANAGER
${CMAKE_CURRENT_SOURCE_DIR}/address_mapper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/address_mapper.h
${CMAKE_CURRENT_SOURCE_DIR}/allocations_list.h
${CMAKE_CURRENT_SOURCE_DIR}/deferrable_allocation_deletion.h
${CMAKE_CURRENT_SOURCE_DIR}/deferrable_allocation_deletion.cpp
${CMAKE_CURRENT_SOURCE_DIR}/deferrable_deletion.h
${CMAKE_CURRENT_SOURCE_DIR}/deferred_deleter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/deferred_deleter.h

View File

@@ -1,30 +0,0 @@
/*
* Copyright (C) 2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/command_stream/command_stream_receiver.h"
#include "runtime/memory_manager/deferrable_allocation_deletion.h"
#include "runtime/memory_manager/memory_manager.h"
namespace OCLRT {
DeferrableAllocationDeletion::DeferrableAllocationDeletion(MemoryManager &memoryManager, GraphicsAllocation &graphicsAllocation) : memoryManager(memoryManager),
graphicsAllocation(graphicsAllocation) {}
void DeferrableAllocationDeletion::apply() {
while (graphicsAllocation.isUsed()) {
for (auto contextId = 0u; contextId < memoryManager.getOsContextCount(); contextId++) {
if (graphicsAllocation.isUsedByContext(contextId)) {
auto currentContextTaskCount = *memoryManager.getCommandStreamReceiver(contextId)->getTagAddress();
if (graphicsAllocation.getTaskCount(contextId) <= currentContextTaskCount) {
graphicsAllocation.resetTaskCount(contextId);
}
}
}
}
memoryManager.freeGraphicsMemory(&graphicsAllocation);
}
} // namespace OCLRT

View File

@@ -1,25 +0,0 @@
/*
* Copyright (C) 2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "runtime/memory_manager/deferrable_deletion.h"
namespace OCLRT {
class GraphicsAllocation;
class MemoryManager;
class DeferrableAllocationDeletion : public DeferrableDeletion {
public:
DeferrableAllocationDeletion(MemoryManager &memoryManager, GraphicsAllocation &graphicsAllocation);
void apply() override;
protected:
MemoryManager &memoryManager;
GraphicsAllocation &graphicsAllocation;
};
} // namespace OCLRT

View File

@@ -120,10 +120,8 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
return memoryPool;
}
bool isUsed() const { return registeredContextsNum > 0; }
bool isUsedByContext(uint32_t contextId) const { return objectNotUsed != getTaskCount(contextId); }
void updateTaskCount(uint32_t newTaskCount, uint32_t contextId);
uint32_t getTaskCount(uint32_t contextId) const { return usageInfos[contextId].taskCount; }
void resetTaskCount(uint32_t contextId) { updateTaskCount(objectNotUsed, contextId); }
void updateResidencyTaskCount(uint32_t newTaskCount, uint32_t contextId) { usageInfos[contextId].residencyTaskCount = newTaskCount; }
uint32_t getResidencyTaskCount(uint32_t contextId) const { return usageInfos[contextId].residencyTaskCount; }