2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2019-02-27 18:39:32 +08:00
|
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "hw_info.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2018-10-02 04:36:15 +08:00
|
|
|
#include "runtime/os_interface/debug_settings_manager.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-02-27 18:39:32 +08:00
|
|
|
#include "hw_cmds.h"
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2019-05-08 22:00:24 +08:00
|
|
|
HardwareInfo::HardwareInfo(const PLATFORM *platform, const FeatureTable *featureTable, const WorkaroundTable *workaroundTable,
|
|
|
|
const GT_SYSTEM_INFO *gtSystemInfo, const RuntimeCapabilityTable &capabilityTable)
|
|
|
|
: platform(*platform), featureTable(*featureTable), workaroundTable(*workaroundTable), gtSystemInfo(*gtSystemInfo), capabilityTable(capabilityTable) {
|
2018-06-12 15:42:47 +08:00
|
|
|
}
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
const HardwareInfo *hardwareInfoTable[IGFX_MAX_PRODUCT] = {};
|
2019-03-28 22:34:26 +08:00
|
|
|
void (*hardwareInfoSetup[IGFX_MAX_PRODUCT])(HardwareInfo *, bool, const std::string &) = {
|
2017-12-21 07:45:38 +08:00
|
|
|
nullptr,
|
|
|
|
};
|
|
|
|
|
2018-04-18 00:11:50 +08:00
|
|
|
const char *getPlatformType(const HardwareInfo &hwInfo) {
|
2018-04-27 15:42:32 +08:00
|
|
|
if (hwInfo.capabilityTable.isCore) {
|
2018-04-18 00:11:50 +08:00
|
|
|
return "core";
|
|
|
|
}
|
|
|
|
return "lp";
|
|
|
|
}
|
2018-06-07 22:18:53 +08:00
|
|
|
|
|
|
|
bool getHwInfoForPlatformString(const char *str, const HardwareInfo *&hwInfoIn) {
|
|
|
|
bool ret = false;
|
|
|
|
for (int j = 0; j < IGFX_MAX_PRODUCT; j++) {
|
|
|
|
if (hardwarePrefix[j] == nullptr)
|
|
|
|
continue;
|
|
|
|
if (strcmp(hardwarePrefix[j], str) == 0) {
|
|
|
|
hwInfoIn = hardwareInfoTable[j];
|
|
|
|
ret = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
2018-10-02 04:36:15 +08:00
|
|
|
|
2019-03-27 17:06:29 +08:00
|
|
|
aub_stream::EngineType getChosenEngineType(const HardwareInfo &hwInfo) {
|
2018-10-02 04:36:15 +08:00
|
|
|
return DebugManager.flags.NodeOrdinal.get() == -1
|
|
|
|
? hwInfo.capabilityTable.defaultEngineType
|
2019-03-27 17:06:29 +08:00
|
|
|
: static_cast<aub_stream::EngineType>(DebugManager.flags.NodeOrdinal.get());
|
2018-10-02 04:36:15 +08:00
|
|
|
}
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|