Skip to content

Commit 0b4c663

Browse files
DianaChenigcbot
authored andcommitted
vISA: Set iga::SWSB_ENCODE_MODE to ThreeDistPipeDPMath for MTL
IGA doesn't distinguish MTL from other XE_HPG platforms in its models. Set the correct SWSB_ENCODE_MODE from vISA when MTL is used to avoid swsb verifier errors. Add function BinaryEncodingIGA::getIGASWSBEncodeMode to unify SWSBEncodeMode getter
1 parent 1b83ff2 commit 0b4c663

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

visa/BinaryEncodingIGA.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ class BinaryEncodingIGA {
9494
static Region::Width getIGAWidth(int width);
9595
static Region::Horz getIGAHorz(int hstride);
9696
static Region getIGARegion(G4_SrcRegRegion *srcRegion, int srcPos);
97+
SWSB_ENCODE_MODE getIGASWSBEncodeMode() const;
9798

9899
MathMacroExt getIGAImplAcc(G4_AccRegSel accSel) const {
99100
switch (accSel) {
@@ -384,6 +385,14 @@ BinaryEncodingIGA::BinaryEncodingIGA(vISA::G4_Kernel &k, std::string fname)
384385
IGAKernel = new Kernel(*platformModel);
385386
}
386387

388+
SWSB_ENCODE_MODE BinaryEncodingIGA::getIGASWSBEncodeMode() const {
389+
390+
if (platform == TARGET_PLATFORM::Xe_MTL)
391+
return SWSB_ENCODE_MODE::ThreeDistPipeDPMath;
392+
393+
return platformModel->getSWSBEncodeMode();
394+
}
395+
387396
InstOptSet BinaryEncodingIGA::getIGAInstOptSet(G4_INST *inst) const {
388397
InstOptSet options;
389398

@@ -986,8 +995,7 @@ void BinaryEncodingIGA::SetSWSB(G4_INST *inst, SWSB &sw) {
986995
// This workaround can be removed once vISA doesn't produce such SWSB.
987996
// Currently this could happen only on EOT send.
988997
if (inst->isSend() && !sw.hasBothDistAndToken() &&
989-
!sw.verify(IGAKernel->getModel().getSWSBEncodeMode(),
990-
SWSB::InstType::SEND)) {
998+
!sw.verify(getIGASWSBEncodeMode(), SWSB::InstType::SEND)) {
991999
sw.tokenType = SWSB::TokenType::SET;
9921000
if (sw.hasDist()) {
9931001
// if the distance type cannot be combined with SBID.set, force
@@ -1105,7 +1113,7 @@ void BinaryEncodingIGA::Encode() {
11051113
std::list<std::pair<Instruction *, G4_INST *>> encodedInsts;
11061114
Block *bbNew = nullptr;
11071115

1108-
SWSB_ENCODE_MODE swsbEncodeMode = IGAKernel->getModel().getSWSBEncodeMode();
1116+
SWSB_ENCODE_MODE swsbEncodeMode = getIGASWSBEncodeMode();
11091117

11101118
for (auto bb : this->kernel.fg) {
11111119
for (auto inst : *bb) {

0 commit comments

Comments
 (0)