Files
compute-runtime/runtime/command_stream/scratch_space_controller.cpp
Dunajski, Bartosz 0f87e9aa1a Rename HardwareInfo members
Change-Id: I85f56b677bafdd75dd958b488522393fc18b68af
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
2019-05-09 09:13:55 +02:00

35 lines
1.2 KiB
C++

/*
* Copyright (C) 2018-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/command_stream/scratch_space_controller.h"
#include "runtime/execution_environment/execution_environment.h"
#include "runtime/helpers/hw_helper.h"
#include "runtime/memory_manager/graphics_allocation.h"
#include "runtime/memory_manager/internal_allocation_storage.h"
#include "runtime/memory_manager/memory_manager.h"
namespace NEO {
ScratchSpaceController::ScratchSpaceController(ExecutionEnvironment &environment, InternalAllocationStorage &allocationStorage)
: executionEnvironment(environment), csrAllocationStorage(allocationStorage) {
auto hwInfo = executionEnvironment.getHardwareInfo();
auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily);
computeUnitsUsedForScratch = hwHelper.getComputeUnitsUsedForScratch(hwInfo);
}
ScratchSpaceController::~ScratchSpaceController() {
if (scratchAllocation) {
getMemoryManager()->freeGraphicsMemory(scratchAllocation);
}
}
MemoryManager *ScratchSpaceController::getMemoryManager() const {
UNRECOVERABLE_IF(executionEnvironment.memoryManager.get() == nullptr);
return executionEnvironment.memoryManager.get();
}
} // namespace NEO