Calculate a maxOsContextCount variable

Change-Id: I7b2f7733be74abf4ae299396d616b249b67de58e
Signed-off-by: Jobczyk, Lukasz <lukasz.jobczyk@intel.com>
This commit is contained in:
Jobczyk, Lukasz
2019-12-17 08:11:16 +01:00
committed by sys_ocldev
parent 1021d8c6d2
commit eac48002ab
30 changed files with 110 additions and 64 deletions

View File

@@ -30,6 +30,8 @@
#include <algorithm>
namespace NEO {
uint32_t MemoryManager::maxOsContextCount = 0u;
MemoryManager::MemoryManager(ExecutionEnvironment &executionEnvironment) : executionEnvironment(executionEnvironment), hostPtrManager(std::make_unique<HostPtrManager>()),
multiContextResourceDestructor(std::make_unique<DeferredDeleter>()) {
auto hwInfo = executionEnvironment.getHardwareInfo();

View File

@@ -158,6 +158,8 @@ class MemoryManager {
void *getReservedMemory(size_t size, size_t alignment);
GfxPartition *getGfxPartition(uint32_t rootDeviceIndex) { return gfxPartitions.at(rootDeviceIndex).get(); }
static uint32_t maxOsContextCount;
protected:
struct AllocationData {
union {

View File

@@ -15,6 +15,7 @@
#include "core/helpers/options.h"
#include "core/helpers/ptr_math.h"
#include "core/memory_manager/host_ptr_manager.h"
#include "core/memory_manager/residency.h"
#include "core/os_interface/os_memory.h"
#include "runtime/aub/aub_center.h"
#include "runtime/execution_environment/execution_environment.h"
@@ -188,7 +189,7 @@ void OsAgnosticMemoryManager::removeAllocationFromHostPtrManager(GraphicsAllocat
}
void OsAgnosticMemoryManager::freeGraphicsMemoryImpl(GraphicsAllocation *gfxAllocation) {
for (auto handleId = 0u; handleId < maxHandleCount; handleId++) {
for (auto handleId = 0u; handleId < EngineLimits::maxHandleCount; handleId++) {
delete gfxAllocation->getGmm(handleId);
}