Skip to content

Commit

Permalink
vISA: Set iga::SWSB_ENCODE_MODE to ThreeDistPipeDPMath for MTL
Browse files Browse the repository at this point in the history
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
  • Loading branch information
DianaChen authored and igcbot committed Nov 17, 2023
1 parent 1b83ff2 commit 0b4c663
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions visa/BinaryEncodingIGA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class BinaryEncodingIGA {
static Region::Width getIGAWidth(int width);
static Region::Horz getIGAHorz(int hstride);
static Region getIGARegion(G4_SrcRegRegion *srcRegion, int srcPos);
SWSB_ENCODE_MODE getIGASWSBEncodeMode() const;

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

SWSB_ENCODE_MODE BinaryEncodingIGA::getIGASWSBEncodeMode() const {

if (platform == TARGET_PLATFORM::Xe_MTL)
return SWSB_ENCODE_MODE::ThreeDistPipeDPMath;

return platformModel->getSWSBEncodeMode();
}

InstOptSet BinaryEncodingIGA::getIGAInstOptSet(G4_INST *inst) const {
InstOptSet options;

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

SWSB_ENCODE_MODE swsbEncodeMode = IGAKernel->getModel().getSWSBEncodeMode();
SWSB_ENCODE_MODE swsbEncodeMode = getIGASWSBEncodeMode();

for (auto bb : this->kernel.fg) {
for (auto inst : *bb) {
Expand Down

0 comments on commit 0b4c663

Please sign in to comment.