Allow disabling statefull optimization in L0

Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
Jaime Arteaga
2020-11-18 09:56:42 +00:00
committed by Compute-Runtime-Automation
parent 1af75337a7
commit 905d59d7e3
2 changed files with 25 additions and 0 deletions

View File

@@ -82,6 +82,10 @@ bool ModuleTranslationUnit::buildFromSpirV(const char *input, uint32_t inputSize
internalOptions = NEO::CompilerOptions::concatenate(internalOptions, BuildOptions::debugKernelEnable);
}
if (NEO::DebugManager.flags.DisableStatelessToStatefulOptimization.get()) {
internalOptions = NEO::CompilerOptions::concatenate(internalOptions, NEO::CompilerOptions::greaterThan4gbBuffersRequired);
}
NEO::TranslationInput inputArgs = {IGC::CodeType::spirV, IGC::CodeType::oclGenBin};
if (pConstants) {

View File

@@ -607,6 +607,27 @@ HWTEST_F(ModuleTranslationUnitTest, WhenBuildOptionsAreNullThenReuseExistingOpti
EXPECT_STREQ("abcd", mockCompilerInterface.receivedApiOptions.c_str());
}
HWTEST_F(ModuleTranslationUnitTest, WhenBuildOptionsAreNullThenReuseExistingOptions2) {
struct MockCompilerInterface : CompilerInterface {
TranslationOutput::ErrorCode build(const NEO::Device &device,
const TranslationInput &input,
TranslationOutput &output) override {
inputInternalOptions = input.internalOptions.begin();
return TranslationOutput::ErrorCode::Success;
}
std::string inputInternalOptions;
} mockCompilerInterface;
DebugManagerStateRestore restorer;
DebugManager.flags.DisableStatelessToStatefulOptimization.set(1);
MockModuleTranslationUnit moduleTu(this->device);
this->neoDevice->mockCompilerInterface = &mockCompilerInterface;
auto ret = moduleTu.buildFromSpirV("", 0U, nullptr, "", nullptr);
EXPECT_TRUE(ret);
EXPECT_NE(mockCompilerInterface.inputInternalOptions.find("cl-intel-greater-than-4GB-buffer-required"), std::string::npos);
}
TEST(BuildOptions, givenNoSrcOptionNameInSrcNamesWhenMovingBuildOptionsThenFalseIsReturned) {
std::string srcNames = NEO::CompilerOptions::concatenate(NEO::CompilerOptions::fastRelaxedMath, NEO::CompilerOptions::finiteMathOnly);
std::string dstNames;