Skip to content

Commit d3ca4a5

Browse files
igorban-inteligcbot
authored andcommitted
Add -vc-codegen option handling for VLD
.
1 parent b799e7c commit d3ca4a5

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

IGC/AdaptorOCL/dllInterfaceCompute.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,15 @@ bool ProcessElfInput(STB_TranslateInputArgs &InputArgs, STB_TranslateOutputArgs
611611
return false;
612612
}
613613

614+
#if defined(IGC_VC_ENABLED)
615+
bool hasVCCodegenOpt = false;
616+
if (InputArgs.pOptions) {
617+
std::string options(InputArgs.pOptions, InputArgs.OptionsSize);
618+
hasVCCodegenOpt = (options.find("-vc-codegen") != std::string::npos);
619+
}
620+
hasVISALinking &= !hasVCCodegenOpt;
621+
#endif
622+
614623
if (!hasVISALinking) {
615624
for (auto &SpvPair : SPIRVToLink) {
616625
llvm::Module *pKernelModule = nullptr;

IGC/VISALinkerDriver/VLD.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,20 @@ bool TranslateBuildSPMDAndESIMD(const TC::STB_TranslateInputArgs *pInputArgs, TC
300300

301301
IGC_ASSERT(inputDataFormatTemp == TB_DATA_FORMAT_SPIR_V);
302302

303+
#if defined(IGC_VC_ENABLED)
304+
// Check if -vc-codegen option is present - if so, use VC backend directly
305+
bool hasVCCodegenOpt = false;
306+
if (pInputArgs->pOptions) {
307+
std::string options(pInputArgs->pOptions, pInputArgs->OptionsSize);
308+
hasVCCodegenOpt = (options.find("-vc-codegen") != std::string::npos);
309+
}
310+
311+
if (hasVCCodegenOpt) {
312+
return TranslateBuildVC(pInputArgs, pOutputArgs, inputDataFormatTemp, IGCPlatform, profilingTimerResolution,
313+
inputShHash);
314+
}
315+
#endif
316+
303317
// Split ESIMD and SPMD code.
304318
auto spmd_esimd_programs_or_err = VLD::SplitSPMDAndESIMD(pInputArgs->pInput, pInputArgs->InputSize);
305319

0 commit comments

Comments
 (0)