Skip to content

Commit f5a9c84

Browse files
iwwuigcbot
authored andcommitted
Add OverrideHWGenerateLID
Add OverrideHWGenerateLID to configure the value.
1 parent eb2198f commit f5a9c84

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

IGC/Compiler/CISACodeGen/CSWalkOrder.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,20 @@ void IGC::overrideWalkOrderKeysInPass(
236236
{
237237
threadIDLayout = (ThreadIDLayout)IGC_IS_FLAG_ENABLED(OverrideCsTileLayout);
238238
}
239+
240+
const IGC::TriboolFlag overrideHWGenerateLID =
241+
static_cast<TriboolFlag>(IGC_GET_FLAG_VALUE(OverrideHWGenerateLID));
242+
switch (overrideHWGenerateLID)
243+
{
244+
case TriboolFlag::Enabled:
245+
enableHWGenerateLID = true;
246+
break;
247+
case TriboolFlag::Disabled:
248+
enableHWGenerateLID = false;
249+
break;
250+
default:
251+
break;
252+
}
239253
}
240254

241255
bool IGC::enableHWGenerateLIDInPass(

IGC/Compiler/CodeGenPublicEnums.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -327,12 +327,12 @@ namespace IGC
327327

328328

329329
enum class CS_WALK_ORDER : unsigned char {
330-
WO_XYZ = 0,
331-
WO_XZY = 1,
332-
WO_YXZ = 2,
333-
WO_ZXY = 3,
334-
WO_YZX = 4,
335-
WO_ZYX = 5
330+
WO_XYZ = 0, //012
331+
WO_XZY = 1, //021
332+
WO_YXZ = 2, //102
333+
WO_ZXY = 3, //201 - incorrect enum value, need to swap with next line
334+
WO_YZX = 4, //120 - incorrect enum value, need to swap with the line above
335+
WO_ZYX = 5 //210
336336
};
337337

338338
enum EMIT_LOCAL_MASK {

IGC/common/igc_flags.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,11 @@ DECLARE_IGC_REGKEY(bool, OverrideCsWalkOrderEnable, false, "Enable overriding c
920920
DECLARE_IGC_REGKEY(int, OverrideCsWalkOrder, 0, "Override compute walker walk order", true)
921921
DECLARE_IGC_REGKEY(bool, OverrideCsTileLayoutEnable, false, "Enable overriding compute walker tile layout", true)
922922
DECLARE_IGC_REGKEY(bool, OverrideCsTileLayout, 0, "Override compute walker tile layout. False is linear. True is TileY", true)
923+
DECLARE_IGC_REGKEY_ENUM(OverrideHWGenerateLID, -1, "Override HW Generate Local ID setting" \
924+
"-1 - default behavior," \
925+
" 0 - force disabled," \
926+
" 1 - force enabled", \
927+
TRIBOOL_OPTIONS, true)
923928
DECLARE_IGC_REGKEY(DWORD, MemCpyLoweringUnrollThreshold, 12, "Min number of mem instructions that require non-unrolled loop when lowering memcpy", false)
924929
DECLARE_IGC_REGKEY(DWORD, EnablePrivMemNewSOATranspose, 1, "0 : disable new algo; 1 and up : enable new algo. " \
925930
"1 : enable new algo just for array of struct; " \

0 commit comments

Comments
 (0)