Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d817528

Browse files
weiyu-chensys_zuul
authored and
sys_zuul
committedNov 8, 2019
Refactor code for retrieving the number of accumulators so it returns correct value for TGL.
Change-Id: I629799518e5317712239f73a21069a3eb74a3f63
1 parent 695f6bb commit d817528

File tree

5 files changed

+9
-19
lines changed

5 files changed

+9
-19
lines changed
 

‎visa/FlowGraph.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3094,7 +3094,7 @@ void G4_Kernel::setKernelParameters()
30943094
}
30953095

30963096

3097-
// Set the number of Acc
3097+
// Set the number of Acc. They are in the unit of GRFs (i.e., 1 accumulator is the same size as 1 GRF)
30983098
unsigned overrideNumAcc = m_options->getuInt32Option(vISA_numGeneralAcc);
30993099
if (overrideNumAcc > 0)
31003100
{
@@ -3110,10 +3110,7 @@ void G4_Kernel::setKernelParameters()
31103110
numAcc = 2;
31113111
}
31123112

3113-
if (numRegTotal == 256)
3114-
{
3115-
numAcc *= 2;
3116-
}
3113+
31173114
}
31183115
}
31193116

‎visa/FlowGraph.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1471,7 +1471,6 @@ class G4_Kernel
14711471
void setNumSWSBTokens(int nSWSBs) { numSWSBTokens = nSWSBs; }
14721472
uint32_t getNumSWSBTokens() const { return numSWSBTokens; }
14731473

1474-
void setNumAcc(int nAcc) { numAcc = nAcc; }
14751474
uint32_t getNumAcc() const { return numAcc; }
14761475

14771476
void setAsmCount(int count) { asmInstCount = count; }

‎visa/HWCapsOpen.inc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -357,12 +357,6 @@
357357
return getGenxPlatform() >= GENX_TGLLP;
358358
}
359359

360-
// 1 means one SIMD16 float accumulator
361-
uint32_t getNumACC() const
362-
{
363-
return 1;
364-
}
365-
366360
bool fuseURBMessage() const
367361
{
368362
return isGen12LP();

‎visa/HWConformity.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4657,7 +4657,7 @@ struct AccAssignment
46574657

46584658
void HWConformity::multiAccSubstitution(G4_BB* bb)
46594659
{
4660-
int numGeneralAcc = builder.getNumACC();
4660+
int numGeneralAcc = kernel.getNumAcc();
46614661

46624662
std::vector<AccInterval*> intervals;
46634663

‎visa/LocalScheduler/SWSB_G4IR.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ SBFootprint* G4_BB_SB::getFootprintForFlag(G4_Operand* opnd,
325325
LB = (unsigned short)(opnd->getLeftBound() + subRegOff * 16) * bitToBytes;
326326
RB = (unsigned short)(opnd->getRightBound() + subRegOff * 16) * bitToBytes;
327327

328-
LB += (builder.kernel.getNumRegTotal() + builder.getNumACC()) * G4_GRF_REG_NBYTES;
329-
RB += (builder.kernel.getNumRegTotal() + builder.getNumACC()) * G4_GRF_REG_NBYTES;
328+
LB += (builder.kernel.getNumRegTotal() + builder.kernel.getNumAcc()) * G4_GRF_REG_NBYTES;
329+
RB += (builder.kernel.getNumRegTotal() + builder.kernel.getNumAcc()) * G4_GRF_REG_NBYTES;
330330

331331
void* allocedMem = mem.alloc(sizeof(SBFootprint));
332332
SBFootprint* footprint = nullptr;
@@ -1008,8 +1008,8 @@ void SWSB::SWSBGenerator()
10081008
}
10091009

10101010
//Note that getNumFlagRegisters() treat each 16 bits as a flag register
1011-
LiveGRFBuckets LB(mem, kernel.getNumRegTotal() + fg.builder->getNumACC() + fg.builder->getNumFlagRegisters(), kernel);
1012-
LiveGRFBuckets globalSendsLB(mem, kernel.getNumRegTotal() + fg.builder->getNumACC() + fg.builder->getNumFlagRegisters(), kernel);
1011+
LiveGRFBuckets LB(mem, kernel.getNumRegTotal() + kernel.getNumAcc() + fg.builder->getNumFlagRegisters(), kernel);
1012+
LiveGRFBuckets globalSendsLB(mem, kernel.getNumRegTotal() + kernel.getNumAcc() + fg.builder->getNumFlagRegisters(), kernel);
10131013

10141014
SWSBDepDistanceGenerator(p, LB, globalSendsLB);
10151015

@@ -4110,8 +4110,8 @@ void G4_BB_SB::getLiveBucketsFromFootprint(SBFootprint* firstFootprint, SBBucket
41104110
}
41114111
else if (footprint->fType == FLAG_T)
41124112
{
4113-
startBucket = footprint->LeftB + aregOffset + builder.getNumACC();
4114-
endBucket = footprint->RightB + aregOffset + builder.getNumACC();
4113+
startBucket = footprint->LeftB + aregOffset + builder.kernel.getNumAcc();
4114+
endBucket = footprint->RightB + aregOffset + builder.kernel.getNumAcc();
41154115
}
41164116

41174117
for (int j = startBucket; j < endBucket + 1; j++)

0 commit comments

Comments
 (0)
Please sign in to comment.