mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 21:42:53 +08:00
Fix for spirv regression - preserve IR type
Preserve IR type during Program::compile when program is created from IR Change-Id: I9ee12b27e52fa72a1abbfa070895caf0ac3e32fb
This commit is contained in:
committed by
sys_ocldev
parent
2561ff6cb4
commit
44589b79b4
@@ -222,7 +222,7 @@ cl_int CompilerInterface::compile(
|
||||
char *pOutput;
|
||||
uint32_t OutputSize;
|
||||
program.getSource(pOutput, OutputSize);
|
||||
program.storeIrBinary(pOutput, OutputSize, outType == IGC::CodeType::spirV);
|
||||
program.storeIrBinary(pOutput, OutputSize, program.getIsSpirV());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -288,6 +288,26 @@ TEST_F(CompilerInterfaceTest, CompileClToIr) {
|
||||
gEnvironment->fclPopDebugVars();
|
||||
}
|
||||
|
||||
TEST_F(CompilerInterfaceTest, GivenProgramCreatedFromIrWhenCompileIsCalledThenIrFormatIsPreserved) {
|
||||
struct MockProgram : Program {
|
||||
using Program::isSpirV;
|
||||
using Program::pDevice;
|
||||
using Program::programBinaryType;
|
||||
};
|
||||
MockProgram prog;
|
||||
prog.programBinaryType = CL_PROGRAM_BINARY_TYPE_INTERMEDIATE;
|
||||
prog.pDevice = pContext->getDevice(0);
|
||||
prog.isSpirV = true;
|
||||
retVal = pCompilerInterface->compile(prog, inputArgs);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_TRUE(prog.isSpirV);
|
||||
|
||||
prog.isSpirV = false;
|
||||
retVal = pCompilerInterface->compile(prog, inputArgs);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_FALSE(prog.isSpirV);
|
||||
}
|
||||
|
||||
TEST_F(CompilerInterfaceTest, WhenCompileIsInvokedThenFclReceivesListOfExtensionsInInternalOptions) {
|
||||
std::string receivedInternalOptions;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user