mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
WA for integer divide emulation on DG1
Resolves: NEO-5003 Change-Id: I2f0d6730cab53335f34ebd8e335a9517030d6441 Signed-off-by: Pawel Wilma <pawel.wilma@intel.com>
This commit is contained in:
@ -96,3 +96,18 @@ DG1TEST_F(HwHelperTestDg1, givenDg1WhenPatchingCPUInaccessibleGlobalBuffersThenU
|
||||
HwHelper &hwHelper = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily);
|
||||
EXPECT_TRUE(hwHelper.forceBlitterUseForGlobalBuffers(hardwareInfo, &mockAllocation));
|
||||
}
|
||||
|
||||
DG1TEST_F(HwHelperTestDg1, givenDg1WhenSteppingA0ThenIntegerDivisionEmulationIsEnabled) {
|
||||
HwHelper &hwHelper = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily);
|
||||
uint32_t stepping = REVISION_A0;
|
||||
hardwareInfo.platform.usRevId = hwHelper.getHwRevIdFromStepping(stepping, hardwareInfo);
|
||||
auto &helper = HwHelper::get(renderCoreFamily);
|
||||
EXPECT_TRUE(helper.isForceEmuInt32DivRemSPWARequired(hardwareInfo));
|
||||
}
|
||||
|
||||
DG1TEST_F(HwHelperTestDg1, givenDg1WhenSteppingB0ThenIntegerDivisionEmulationIsNotEnabled) {
|
||||
HwHelper &hwHelper = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily);
|
||||
hardwareInfo.platform.usRevId = hwHelper.getHwRevIdFromStepping(REVISION_B, hardwareInfo);
|
||||
auto &helper = HwHelper::get(renderCoreFamily);
|
||||
EXPECT_FALSE(helper.isForceEmuInt32DivRemSPWARequired(hardwareInfo));
|
||||
}
|
||||
|
@ -1226,4 +1226,35 @@ TEST(OfflineCompilerTest, givenNoRevisionIdWhenCompilerIsInitializedThenHwInfoHa
|
||||
EXPECT_EQ(SUCCESS, retVal);
|
||||
EXPECT_EQ(mockOfflineCompiler->hwInfo.platform.usRevId, revId);
|
||||
}
|
||||
|
||||
struct WorkaroundApplicableForDevice {
|
||||
const char *deviceName;
|
||||
bool applicable;
|
||||
};
|
||||
|
||||
using OfflineCompilerTestWithParams = testing::TestWithParam<WorkaroundApplicableForDevice>;
|
||||
|
||||
TEST_P(OfflineCompilerTestWithParams, givenRklWhenExtraSettingsResolvedThenForceEmuInt32DivRemSPIsApplied) {
|
||||
WorkaroundApplicableForDevice params = GetParam();
|
||||
MockOfflineCompiler mockOfflineCompiler;
|
||||
mockOfflineCompiler.deviceName = params.deviceName;
|
||||
|
||||
mockOfflineCompiler.parseDebugSettings();
|
||||
|
||||
std::string internalOptions = mockOfflineCompiler.internalOptions;
|
||||
size_t found = internalOptions.find(NEO::CompilerOptions::forceEmuInt32DivRemSP.data());
|
||||
if (params.applicable) {
|
||||
EXPECT_NE(std::string::npos, found);
|
||||
} else {
|
||||
EXPECT_EQ(std::string::npos, found);
|
||||
}
|
||||
}
|
||||
|
||||
WorkaroundApplicableForDevice workaroundApplicableForDeviceArray[] = {{"rkl", true}, {"dg1", false}, {"tgllp", false}};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
WorkaroundApplicable,
|
||||
OfflineCompilerTestWithParams,
|
||||
testing::ValuesIn(workaroundApplicableForDeviceArray));
|
||||
|
||||
} // namespace NEO
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
namespace NEO {
|
||||
void OfflineCompiler::resolveExtraSettings() {
|
||||
if (deviceName == "tgllp" || deviceName == "rkl") {
|
||||
if (deviceName == "rkl") {
|
||||
CompilerOptions::concatenateAppend(internalOptions, CompilerOptions::forceEmuInt32DivRemSP);
|
||||
}
|
||||
}
|
||||
|
@ -82,6 +82,7 @@ bool isOffsetToSkipSetFFIDGPWARequired(const HardwareInfo &hwInfo) {
|
||||
bool isForceEmuInt32DivRemSPWARequired(const HardwareInfo &hwInfo) {
|
||||
HwHelper &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
||||
return (((hwInfo.platform.eProductFamily == IGFX_TIGERLAKE_LP) & (hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_B, hwInfo))) ||
|
||||
((hwInfo.platform.eProductFamily == IGFX_DG1) & (hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_B, hwInfo))) ||
|
||||
((hwInfo.platform.eProductFamily == IGFX_ROCKETLAKE) & (hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_C, hwInfo))));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user