diff --git a/level_zero/core/source/module/module_imp.cpp b/level_zero/core/source/module/module_imp.cpp index eaf49d3724..52955feb18 100644 --- a/level_zero/core/source/module/module_imp.cpp +++ b/level_zero/core/source/module/module_imp.cpp @@ -32,6 +32,8 @@ namespace L0 { namespace BuildOptions { NEO::ConstStringRef optDisable = "-ze-opt-disable"; NEO::ConstStringRef greaterThan4GbRequired = "-ze-opt-greater-than-4GB-buffer-required"; +NEO::ConstStringRef hasBufferOffsetArg = "-ze-intel-has-buffer-offset-arg"; +NEO::ConstStringRef debugKernelEnable = "-ze-kernel-debug-enable"; } // namespace BuildOptions ModuleTranslationUnit::ModuleTranslationUnit(L0::Device *device) @@ -67,14 +69,14 @@ bool ModuleTranslationUnit::buildFromSpirV(const char *input, uint32_t inputSize UNRECOVERABLE_IF((nullptr == device) || (nullptr == device->getNEODevice())); std::string options = buildOptions; - std::string internalOptions = NEO::CompilerOptions::concatenate(internalBuildOptions, NEO::CompilerOptions::hasBufferOffsetArg); + std::string internalOptions = NEO::CompilerOptions::concatenate(internalBuildOptions, BuildOptions::hasBufferOffsetArg); if (device->getNEODevice()->getDeviceInfo().debuggerActive) { if (device->getSourceLevelDebugger()->isOptimizationDisabled()) { - NEO::CompilerOptions::concatenateAppend(options, NEO::CompilerOptions::optDisable); + NEO::CompilerOptions::concatenateAppend(options, BuildOptions::optDisable); } options = NEO::CompilerOptions::concatenate(options, NEO::CompilerOptions::generateDebugInfo); - internalOptions = NEO::CompilerOptions::concatenate(internalOptions, NEO::CompilerOptions::debugKernelEnable); + internalOptions = NEO::CompilerOptions::concatenate(internalOptions, BuildOptions::debugKernelEnable); } NEO::TranslationInput inputArgs = {IGC::CodeType::spirV, IGC::CodeType::oclGenBin}; diff --git a/level_zero/core/source/module/module_imp.h b/level_zero/core/source/module/module_imp.h index 7f7da68905..9e932211dc 100644 --- a/level_zero/core/source/module/module_imp.h +++ b/level_zero/core/source/module/module_imp.h @@ -22,6 +22,13 @@ namespace L0 { +namespace BuildOptions { +extern NEO::ConstStringRef optDisable; +extern NEO::ConstStringRef greaterThan4GbRequired; +extern NEO::ConstStringRef hasBufferOffsetArg; +extern NEO::ConstStringRef debugKernelEnable; +} // namespace BuildOptions + struct ModuleTranslationUnit { ModuleTranslationUnit(L0::Device *device); virtual ~ModuleTranslationUnit(); diff --git a/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp b/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp index d9dc57edf8..250f1b89a1 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp @@ -37,9 +37,9 @@ TEST_F(DeviceWithDebuggerEnabledTest, givenDebuggingEnabledWhenModuleIsCreatedTh ASSERT_NE(nullptr, module.get()); module->initialize(&moduleDesc, device); - EXPECT_TRUE(CompilerOptions::contains(cip->buildInternalOptions, NEO::CompilerOptions::debugKernelEnable)); + EXPECT_TRUE(CompilerOptions::contains(cip->buildInternalOptions, L0::BuildOptions::debugKernelEnable)); EXPECT_TRUE(CompilerOptions::contains(cip->buildOptions, NEO::CompilerOptions::generateDebugInfo)); - EXPECT_TRUE(CompilerOptions::contains(cip->buildOptions, NEO::CompilerOptions::optDisable)); + EXPECT_TRUE(CompilerOptions::contains(cip->buildOptions, L0::BuildOptions::optDisable)); }; TEST_F(DeviceWithDebuggerEnabledTest, GivenDebuggeableKernelWhenModuleIsInitializedThenDebugEnabledIsTrue) {