Add debug flag to override platform used by compiler

Change-Id: I6fc4254f928158d0cb07f53436d1ddd09fcef7d5
This commit is contained in:
Zdanowicz, Zbigniew
2018-06-07 16:18:53 +02:00
committed by sys_ocldev
parent bbe4eddf9c
commit c1782b802a
8 changed files with 117 additions and 13 deletions

View File

@@ -83,14 +83,7 @@ bool getDevicesImpl(HardwareInfo **hwInfo, size_t &numDevicesReturned) {
case CSR_TBX_WITH_AUB:
auto productFamily = DebugManager.flags.ProductFamilyOverride.get();
auto hwInfoConst = *platformDevices;
for (int j = 0; j < IGFX_MAX_PRODUCT; j++) {
if (hardwarePrefix[j] == nullptr)
continue;
if (strcmp(hardwarePrefix[j], productFamily.c_str()) == 0) {
hwInfoConst = hardwareInfoTable[j];
break;
}
}
getHwInfoForPlatformString(productFamily.c_str(), hwInfoConst);
*hwInfo = const_cast<HardwareInfo *>(hwInfoConst);
hardwareInfoSetupGt[hwInfoConst->pPlatform->eProductFamily](const_cast<GT_SYSTEM_INFO *>(hwInfo[0]->pSysInfo));
numDevicesReturned = 1;

View File

@@ -30,7 +30,9 @@
#include "runtime/compiler_interface/binary_cache.h"
#include "runtime/compiler_interface/compiler_interface.h"
#include "runtime/compiler_interface/compiler_interface.inl"
#include "runtime/helpers/hw_info.h"
#include "runtime/program/program.h"
#include "runtime/os_interface/debug_settings_manager.h"
#include "runtime/os_interface/os_inc_base.h"
#include <fstream>
@@ -426,9 +428,13 @@ CIF::RAII::UPtr_t<IGC::IgcOclTranslationCtxTagOCL> CompilerInterface::createIgcT
DEBUG_BREAK_IF(true); // could not acquire handles to device descriptors
return nullptr;
}
IGC::PlatformHelper::PopulateInterfaceWith(*igcPlatform, *device.getHardwareInfo().pPlatform);
IGC::GtSysInfoHelper::PopulateInterfaceWith(*igcGtSystemInfo, *device.getHardwareInfo().pSysInfo);
const HardwareInfo *hwInfo = &device.getHardwareInfo();
auto productFamily = DebugManager.flags.ForceCompilerUsePlatform.get();
if (productFamily != "unk") {
getHwInfoForPlatformString(productFamily.c_str(), hwInfo);
}
IGC::PlatformHelper::PopulateInterfaceWith(*igcPlatform, *hwInfo->pPlatform);
IGC::GtSysInfoHelper::PopulateInterfaceWith(*igcGtSystemInfo, *hwInfo->pSysInfo);
igcFeWa.get()->SetFtrDesktop(device.getHardwareInfo().pSkuTable->ftrDesktop);
igcFeWa.get()->SetFtrChannelSwizzlingXOREnabled(device.getHardwareInfo().pSkuTable->ftrChannelSwizzlingXOREnabled);

View File

@@ -60,4 +60,18 @@ const char *getPlatformType(const HardwareInfo &hwInfo) {
}
return "lp";
}
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;
}
} // namespace OCLRT

View File

@@ -117,5 +117,5 @@ struct EnableGfxFamilyHw {
};
const char *getPlatformType(const HardwareInfo &hwInfo);
bool getHwInfoForPlatformString(const char *str, const HardwareInfo *&hwInfoIn);
} // namespace OCLRT

View File

@@ -95,3 +95,4 @@ DECLARE_DEBUG_VARIABLE(int32_t, OverrideThreadArbitrationPolicy, -1, "-1 (dont o
DECLARE_DEBUG_VARIABLE(bool, HwQueueSupported, false, "Windows only. Pass flag to KMD during Wddm Context creation")
DECLARE_DEBUG_VARIABLE(bool, UseMaxSimdSizeToDeduceMaxWorkgroupSize, false, "With this flag on, max workgroup size is deduced using SIMD32 instead of SIMD8, this causes the max wkg size to be 4 times bigger")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideAubDeviceId, -1, "-1 dont override, any other: use this value for AUB generation device id")
DECLARE_DEBUG_VARIABLE(std::string, ForceCompilerUsePlatform, std::string("unk"), "Specify product for use in compiler interface")