Skip to content

Commit 67bb9dc

Browse files
dmitryryintelsys_zuul
authored andcommitted
start using SKernelProgram::simd1 for SIMD1 dispatch
Change-Id: Ifee45d0d521d0577b583cd19004394fbb60e1cfd
1 parent 484de8a commit 67bb9dc

File tree

3 files changed

+37
-25
lines changed

3 files changed

+37
-25
lines changed

IGC/AdaptorOCL/OCL/sp/sp_g8.cpp

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2187,13 +2187,18 @@ RETVAL CGen8OpenCLStateProcessor::CreatePatchList(
21872187
size = program->simd16.m_funcSymbolTableSize;
21882188
entries = program->simd16.m_funcSymbolTableEntries;
21892189
}
2190-
else if (annotations.m_executionEnivronment.CompiledSIMDSize == 32 ||
2191-
annotations.m_executionEnivronment.CompiledSIMDSize == 1)
2190+
else if (annotations.m_executionEnivronment.CompiledSIMDSize == 32)
21922191
{
21932192
buffer = program->simd32.m_funcSymbolTable;
21942193
size = program->simd32.m_funcSymbolTableSize;
21952194
entries = program->simd32.m_funcSymbolTableEntries;
21962195
}
2196+
else if (annotations.m_executionEnivronment.CompiledSIMDSize == 1)
2197+
{
2198+
buffer = program->simd1.m_funcSymbolTable;
2199+
size = program->simd1.m_funcSymbolTableSize;
2200+
entries = program->simd1.m_funcSymbolTableEntries;
2201+
}
21972202

21982203
if (size > 0)
21992204
{
@@ -2242,15 +2247,20 @@ RETVAL CGen8OpenCLStateProcessor::CreatePatchList(
22422247
size = program->simd16.m_funcRelocationTableSize;
22432248
entries = program->simd16.m_funcRelocationTableEntries;
22442249
}
2245-
// CM kernels are dispatched with CompiledSIMDSize == 1, this is just a contract
2246-
// between igcmc and patch token generator, shouldn't break existing scenarios for IGC
2247-
else if (annotations.m_executionEnivronment.CompiledSIMDSize == 32 ||
2248-
annotations.m_executionEnivronment.CompiledSIMDSize == 1)
2250+
else if (annotations.m_executionEnivronment.CompiledSIMDSize == 32)
22492251
{
22502252
buffer = program->simd32.m_funcRelocationTable;
22512253
size = program->simd32.m_funcRelocationTableSize;
22522254
entries = program->simd32.m_funcRelocationTableEntries;
22532255
}
2256+
// CM kernels are dispatched with CompiledSIMDSize == 1, this is just a contract
2257+
// between igcmc and patch token generator, shouldn't break existing scenarios for IGC
2258+
else if (annotations.m_executionEnivronment.CompiledSIMDSize == 1)
2259+
{
2260+
buffer = program->simd1.m_funcRelocationTable;
2261+
size = program->simd1.m_funcRelocationTableSize;
2262+
entries = program->simd1.m_funcRelocationTableEntries;
2263+
}
22542264

22552265
if (size > 0)
22562266
{

IGC/AdaptorOCL/cmc.cpp

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,22 @@ const char* cmc::getPlatformStr(PLATFORM platform)
410410
return "SKL";
411411
}
412412

413+
static void generateSymbols(const cmc_kernel_info_v2 &info,
414+
IGC::SProgramOutput &kernelProgram)
415+
{
416+
if (info.RelocationTable.Size > 0) {
417+
kernelProgram.m_funcRelocationTable = info.RelocationTable.Buf;
418+
kernelProgram.m_funcRelocationTableSize = info.RelocationTable.Size;
419+
kernelProgram.m_funcRelocationTableEntries =
420+
info.RelocationTable.NumEntries;
421+
}
422+
if (info.SymbolTable.Size > 0) {
423+
kernelProgram.m_funcSymbolTable = info.SymbolTable.Buf;
424+
kernelProgram.m_funcSymbolTableSize = info.SymbolTable.Size;
425+
kernelProgram.m_funcSymbolTableEntries = info.SymbolTable.NumEntries;
426+
}
427+
}
428+
413429
static void generatePatchTokens_v2(const cmc_kernel_info_v2 *info,
414430
CMKernel& kernel)
415431
{
@@ -514,25 +530,10 @@ static void generatePatchTokens_v2(const cmc_kernel_info_v2 *info,
514530
ConstantBufferLength = iSTD::Align(ConstantBufferLength, info->GRFByteSize) / info->GRFByteSize;
515531
kernel.m_kernelInfo.m_kernelProgram.ConstantBufferLength = ConstantBufferLength;
516532

517-
IGC::SProgramOutput *kernelProgram = nullptr;
518-
if (info->CompiledSIMDSize == 8)
519-
kernelProgram = &kernel.m_kernelInfo.m_kernelProgram.simd8;
520-
else if (info->CompiledSIMDSize == 16)
521-
kernelProgram = &kernel.m_kernelInfo.m_kernelProgram.simd16;
522-
else if (info->CompiledSIMDSize == 32 || info->CompiledSIMDSize == 1)
523-
kernelProgram = &kernel.m_kernelInfo.m_kernelProgram.simd32;
524-
IGC_ASSERT(kernelProgram);
525-
if (info->RelocationTable.Size > 0) {
526-
kernelProgram->m_funcRelocationTable = info->RelocationTable.Buf;
527-
kernelProgram->m_funcRelocationTableSize = info->RelocationTable.Size;
528-
kernelProgram->m_funcRelocationTableEntries =
529-
info->RelocationTable.NumEntries;
530-
}
531-
if (info->SymbolTable.Size > 0) {
532-
kernelProgram->m_funcSymbolTable = info->SymbolTable.Buf;
533-
kernelProgram->m_funcSymbolTableSize = info->SymbolTable.Size;
534-
kernelProgram->m_funcSymbolTableEntries = info->SymbolTable.NumEntries;
535-
}
533+
IGC_ASSERT_MESSAGE(info->CompiledSIMDSize == 1, "CM code must be dispatched in SIMD1 mode");
534+
IGC::SProgramOutput &kernelProgram = kernel.m_kernelInfo.m_kernelProgram.simd1;
535+
536+
generateSymbols(*info, kernelProgram);
536537

537538
}
538539

IGC/Compiler/CodeGenPublic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ namespace IGC
321321

322322
struct SKernelProgram
323323
{
324+
SProgramOutput simd1;
324325
SProgramOutput simd8;
325326
SProgramOutput simd16;
326327
SProgramOutput simd32;

0 commit comments

Comments
 (0)