@@ -93,6 +93,7 @@ class BinaryEncodingIGA {
93
93
static Region::Width getIGAWidth (int width);
94
94
static Region::Horz getIGAHorz (int hstride);
95
95
static Region getIGARegion (G4_SrcRegRegion *srcRegion, int srcPos);
96
+ SWSB_ENCODE_MODE getIGASWSBEncodeMode () const ;
96
97
97
98
MathMacroExt getIGAImplAcc (G4_AccRegSel accSel) const {
98
99
switch (accSel) {
@@ -379,6 +380,14 @@ BinaryEncodingIGA::BinaryEncodingIGA(vISA::G4_Kernel &k, std::string fname)
379
380
IGAKernel = new Kernel (*platformModel);
380
381
}
381
382
383
+ SWSB_ENCODE_MODE BinaryEncodingIGA::getIGASWSBEncodeMode () const {
384
+
385
+ if (platform == TARGET_PLATFORM::Xe_MTL)
386
+ return SWSB_ENCODE_MODE::ThreeDistPipeDPMath;
387
+
388
+ return platformModel->getSWSBEncodeMode ();
389
+ }
390
+
382
391
InstOptSet BinaryEncodingIGA::getIGAInstOptSet (G4_INST *inst) const {
383
392
InstOptSet options;
384
393
@@ -982,8 +991,7 @@ void BinaryEncodingIGA::SetSWSB(G4_INST *inst, SWSB &sw) {
982
991
// This workaround can be removed once vISA doesn't produce such SWSB.
983
992
// Currently this could happen only on EOT send.
984
993
if (inst->isSend () && !sw.hasBothDistAndToken () &&
985
- !sw.verify (IGAKernel->getModel ().getSWSBEncodeMode (),
986
- SWSB::InstType::SEND)) {
994
+ !sw.verify (getIGASWSBEncodeMode (), SWSB::InstType::SEND)) {
987
995
sw.tokenType = SWSB::TokenType::SET;
988
996
if (sw.hasDist ()) {
989
997
// if the distance type cannot be combined with SBID.set, force
@@ -1100,6 +1108,9 @@ void BinaryEncodingIGA::Encode() {
1100
1108
auto platformGen = kernel.getPlatformGeneration ();
1101
1109
std::list<std::pair<Instruction *, G4_INST *>> encodedInsts;
1102
1110
Block *bbNew = nullptr ;
1111
+
1112
+ SWSB_ENCODE_MODE swsbEncodeMode = getIGASWSBEncodeMode ();
1113
+
1103
1114
for (auto bb : this ->kernel .fg ) {
1104
1115
for (auto inst : *bb) {
1105
1116
bbNew = nullptr ;
@@ -1136,7 +1147,7 @@ void BinaryEncodingIGA::Encode() {
1136
1147
instTy = SWSB::InstType::OTHERS;
1137
1148
1138
1149
// Verify if swsb is in encode-able dist and token combination
1139
- if (!sw.verify (IGAKernel-> getModel (). getSWSBEncodeMode () , instTy))
1150
+ if (!sw.verify (swsbEncodeMode , instTy))
1140
1151
IGA_ASSERT_FALSE (" Invalid swsb dist and token combination" );
1141
1152
igaInst->setSWSB (sw);
1142
1153
}
@@ -1176,7 +1187,7 @@ void BinaryEncodingIGA::Encode() {
1176
1187
autoCompact = false ; // PVC-A0 compaction is off (IGA only does B0+)
1177
1188
1178
1189
KernelEncoder encoder (IGAKernel, autoCompact);
1179
- encoder.setSWSBEncodingMode (IGAKernel-> getModel (). getSWSBEncodeMode () );
1190
+ encoder.setSWSBEncodingMode (swsbEncodeMode );
1180
1191
1181
1192
if (kernel.getOption (vISA_EnableIGASWSB)) {
1182
1193
encoder.enableIGAAutoDeps ();
0 commit comments