mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Allow disabling statefull optimization in L0
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
1af75337a7
commit
905d59d7e3
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user