2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2018-09-18 15:11:08 +08:00
|
|
|
* Copyright (C) 2017-2018 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"
|
|
|
|
#include "hw_cmds.h"
|
2018-10-02 04:36:15 +08:00
|
|
|
#include "runtime/os_interface/debug_settings_manager.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
namespace OCLRT {
|
2018-06-12 15:42:47 +08:00
|
|
|
HardwareInfo::HardwareInfo(const PLATFORM *platform, const FeatureTable *skuTable, const WorkaroundTable *waTable,
|
2018-07-02 19:42:23 +08:00
|
|
|
const GT_SYSTEM_INFO *sysInfo, const RuntimeCapabilityTable &capabilityTable)
|
2018-06-12 15:42:47 +08:00
|
|
|
: pPlatform(platform), pSkuTable(skuTable), pWaTable(waTable), pSysInfo(sysInfo), capabilityTable(capabilityTable) {
|
|
|
|
}
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
const HardwareInfo *hardwareInfoTable[IGFX_MAX_PRODUCT] = {};
|
2018-10-04 18:44:49 +08:00
|
|
|
void (*hardwareInfoSetup[IGFX_MAX_PRODUCT])(GT_SYSTEM_INFO *, FeatureTable *, bool, const std::string &) = {
|
2017-12-21 07:45:38 +08:00
|
|
|
nullptr,
|
|
|
|
};
|
|
|
|
|
|
|
|
const FeatureTable emptySkuTable = {};
|
|
|
|
const WorkaroundTable emptyWaTable = {};
|
|
|
|
|
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
|
|
|
|
|
|
|
EngineType getChosenEngineType(const HardwareInfo &hwInfo) {
|
|
|
|
return DebugManager.flags.NodeOrdinal.get() == -1
|
|
|
|
? hwInfo.capabilityTable.defaultEngineType
|
|
|
|
: static_cast<EngineType>(DebugManager.flags.NodeOrdinal.get());
|
|
|
|
}
|
2017-12-21 07:45:38 +08:00
|
|
|
} // namespace OCLRT
|