Pass root device environment to AubCenter

Related-To: NEO-6853
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2022-11-25 07:58:15 +00:00
committed by Compute-Runtime-Automation
parent 7b195d6b8e
commit 7d4d592381
20 changed files with 57 additions and 178 deletions

View File

@@ -7,6 +7,7 @@
#include "shared/source/aub/aub_center.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/aub/aub_helper.h"
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "shared/source/helpers/hw_helper.h"
@@ -20,10 +21,11 @@
namespace NEO {
extern aub_stream::AubManager *createAubManager(const aub_stream::AubManagerOptions &options);
AubCenter::AubCenter(const HardwareInfo *pHwInfo, const GmmHelper &gmmHelper, bool localMemoryEnabled, const std::string &aubFileName, CommandStreamReceiverType csrType) {
AubCenter::AubCenter(const RootDeviceEnvironment &rootDeviceEnvironment, bool localMemoryEnabled, const std::string &aubFileName, CommandStreamReceiverType csrType) {
if (DebugManager.flags.UseAubStream.get()) {
auto devicesCount = HwHelper::getSubDevicesCount(pHwInfo);
auto memoryBankSize = AubHelper::getPerTileLocalMemorySize(pHwInfo);
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
auto devicesCount = HwHelper::getSubDevicesCount(hwInfo);
auto memoryBankSize = AubHelper::getPerTileLocalMemorySize(hwInfo);
CommandStreamReceiverType type = csrType;
if (DebugManager.flags.SetCommandStreamReceiver.get() >= CommandStreamReceiverType::CSR_HW) {
type = static_cast<CommandStreamReceiverType>(DebugManager.flags.SetCommandStreamReceiver.get());
@@ -31,14 +33,15 @@ AubCenter::AubCenter(const HardwareInfo *pHwInfo, const GmmHelper &gmmHelper, bo
aubStreamMode = getAubStreamMode(aubFileName, type);
auto &hwHelper = HwHelper::get(pHwInfo->platform.eRenderCoreFamily);
const auto &hwInfoConfig = *HwInfoConfig::get(pHwInfo->platform.eProductFamily);
auto &coreHelper = rootDeviceEnvironment.getHelper<CoreHelper>();
const auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
auto aubStreamProductFamily = hwInfoConfig.getAubStreamProductFamily();
auto aubStreamProductFamily = productHelper.getAubStreamProductFamily();
stepping = hwInfoConfig.getAubStreamSteppingFromHwRevId(*pHwInfo);
stepping = productHelper.getAubStreamSteppingFromHwRevId(*hwInfo);
aub_stream::MMIOList extraMmioList = hwHelper.getExtraMmioList(*pHwInfo, gmmHelper);
auto gmmHelper = rootDeviceEnvironment.getGmmHelper();
aub_stream::MMIOList extraMmioList = coreHelper.getExtraMmioList(*hwInfo, *gmmHelper);
aub_stream::MMIOList debugMmioList = AubHelper::getAdditionalMmioList();
extraMmioList.insert(extraMmioList.end(), debugMmioList.begin(), debugMmioList.end());
@@ -55,7 +58,7 @@ AubCenter::AubCenter(const HardwareInfo *pHwInfo, const GmmHelper &gmmHelper, bo
options.stepping = stepping;
options.localMemorySupported = localMemoryEnabled;
options.mode = aubStreamMode;
options.gpuAddressSpace = pHwInfo->capabilityTable.gpuAddressSpace;
options.gpuAddressSpace = hwInfo->capabilityTable.gpuAddressSpace;
aubManager.reset(createAubManager(options));
}

View File

@@ -15,12 +15,11 @@
#include "aubstream/aub_manager.h"
namespace NEO {
struct HardwareInfo;
class GmmHelper;
struct RootDeviceEnvironment;
class AubCenter {
public:
AubCenter(const HardwareInfo *pHwInfo, const GmmHelper &gmmHelper, bool localMemoryEnabled, const std::string &aubFileName, CommandStreamReceiverType csrType);
AubCenter(const RootDeviceEnvironment &rootDeviceEnvironment, bool localMemoryEnabled, const std::string &aubFileName, CommandStreamReceiverType csrType);
AubCenter();
virtual ~AubCenter() = default;

View File

@@ -40,7 +40,7 @@ RootDeviceEnvironment::~RootDeviceEnvironment() = default;
void RootDeviceEnvironment::initAubCenter(bool localMemoryEnabled, const std::string &aubFileName, CommandStreamReceiverType csrType) {
if (!aubCenter) {
UNRECOVERABLE_IF(!getGmmHelper());
aubCenter.reset(new AubCenter(getHardwareInfo(), *gmmHelper, localMemoryEnabled, aubFileName, csrType));
aubCenter.reset(new AubCenter(*this, localMemoryEnabled, aubFileName, csrType));
}
}