Skip to content

Commit eba621f

Browse files
jgu222sys_zuul
authored andcommitted
vISA will use dispatch simdsize from attribute instead of figuring
out by scanning all instructions. 2nd try after fixing a bug. Change-Id: I0fd214995b91997e7ac09ead7a2d105b9aab3047
1 parent 24ccbc6 commit eba621f

File tree

1 file changed

+24
-17
lines changed

1 file changed

+24
-17
lines changed

visa/FlowGraph.cpp

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6140,30 +6140,37 @@ void G4_Kernel::calculateSimdSize()
61406140
return;
61416141
}
61426142

6143-
simdSize = 8;
6144-
6145-
for (auto bb : fg)
6143+
// First, get simdsize from attribute (0 : not given)
6144+
// If not 0|8|16|32, wrong value from attribute.
6145+
simdSize = m_kernelAttrs->getIntKernelAttribute(Attributes::ATTR_SimdSize);
6146+
if (simdSize != 8 && simdSize != 16 && simdSize != 32)
61466147
{
6147-
for (auto inst : *bb)
6148+
assert(simdSize == 0 && "vISA: wrong value for SimdSize attribute");
6149+
simdSize = 8;
6150+
6151+
for (auto bb : fg)
61486152
{
6149-
// do not consider send since for certain messages we have to set its execution size
6150-
// to 16 even in simd8 shaders
6151-
if (!inst->isLabel() && !inst->isSend())
6153+
for (auto inst : *bb)
61526154
{
6153-
uint32_t size = inst->getMaskOffset() + inst->getExecSize();
6154-
if (size > 16)
6155-
{
6156-
simdSize = 32;
6157-
break;
6158-
}
6159-
else if (size > 8)
6155+
// do not consider send since for certain messages we have to set its execution size
6156+
// to 16 even in simd8 shaders
6157+
if (!inst->isLabel() && !inst->isSend())
61606158
{
6161-
simdSize = 16;
6159+
uint32_t size = inst->getMaskOffset() + inst->getExecSize();
6160+
if (size > 16)
6161+
{
6162+
simdSize = 32;
6163+
break;
6164+
}
6165+
else if (size > 8)
6166+
{
6167+
simdSize = 16;
6168+
}
61626169
}
61636170
}
6171+
if (simdSize == 32)
6172+
break;
61646173
}
6165-
if (simdSize == 32)
6166-
break;
61676174
}
61686175

61696176
if(GlobalRA::useGenericAugAlign())

0 commit comments

Comments
 (0)