[4/n] Move Hardware Info to Execution Environment

- remove hwInfo from ScratchSpaceController, pass it by
ExecutionEnvironment

Change-Id: I4d83e581560b8a56a51e09d0e2b8397fee59dc22
Signed-off-by: Adam Stefanowski <adam.stefanowski@intel.com>
This commit is contained in:
Stefanowski, Adam
2019-03-29 00:49:23 +01:00
committed by sys_ocldev
parent 17493426c1
commit 73b8583759
6 changed files with 16 additions and 15 deletions

View File

@@ -7,6 +7,7 @@
#include "runtime/command_stream/scratch_space_controller_base.h"
#include "runtime/execution_environment/execution_environment.h"
#include "runtime/helpers/aligned_memory.h"
#include "runtime/helpers/hw_helper.h"
#include "runtime/helpers/preamble.h"
@@ -16,8 +17,8 @@
#include "runtime/memory_manager/memory_manager.h"
namespace NEO {
ScratchSpaceControllerBase::ScratchSpaceControllerBase(const HardwareInfo &info, ExecutionEnvironment &environment, InternalAllocationStorage &allocationStorage)
: ScratchSpaceController(info, environment, allocationStorage) {
ScratchSpaceControllerBase::ScratchSpaceControllerBase(ExecutionEnvironment &environment, InternalAllocationStorage &allocationStorage)
: ScratchSpaceController(environment, allocationStorage) {
}
void ScratchSpaceControllerBase::setRequiredScratchSpace(void *sshBaseAddress,
@@ -48,7 +49,7 @@ void ScratchSpaceControllerBase::createScratchSpaceAllocation() {
}
uint64_t ScratchSpaceControllerBase::calculateNewGSH() {
auto &hwHelper = HwHelper::get(hwInfo.pPlatform->eRenderCoreFamily);
auto &hwHelper = HwHelper::get(executionEnvironment.getHardwareInfo()->pPlatform->eRenderCoreFamily);
auto scratchSpaceOffsetFor64bit = hwHelper.getScratchSpaceOffsetFor64bit();
return scratchAllocation->getGpuAddress() - scratchSpaceOffsetFor64bit;
}
@@ -60,7 +61,7 @@ uint64_t ScratchSpaceControllerBase::getScratchPatchAddress() {
if (scratchAllocation) {
scratchAddress = scratchAllocation->getGpuAddressToPatch();
if (is64bit && !getMemoryManager()->peekForce32BitAllocations()) {
auto &hwHelper = HwHelper::get(hwInfo.pPlatform->eRenderCoreFamily);
auto &hwHelper = HwHelper::get(executionEnvironment.getHardwareInfo()->pPlatform->eRenderCoreFamily);
auto scratchSpaceOffsetFor64bit = hwHelper.getScratchSpaceOffsetFor64bit();
//this is to avoid scractch allocation offset "0"
scratchAddress = scratchSpaceOffsetFor64bit;