diff --git a/level_zero/core/source/module/module_imp.cpp b/level_zero/core/source/module/module_imp.cpp index 39c0e5f9ac..dd8769f3bd 100644 --- a/level_zero/core/source/module/module_imp.cpp +++ b/level_zero/core/source/module/module_imp.cpp @@ -8,6 +8,7 @@ #include "level_zero/core/source/module/module_imp.h" #include "shared/source/compiler_interface/compiler_options.h" +#include "shared/source/compiler_interface/compiler_options_extra.h" #include "shared/source/compiler_interface/compiler_warnings/compiler_warnings.h" #include "shared/source/compiler_interface/external_functions.h" #include "shared/source/compiler_interface/intermediate_representations.h" @@ -150,6 +151,8 @@ std::string ModuleTranslationUnit::generateCompilerOptions(const char *buildOpti } bool isDebuggerActive = neoDevice.getDebugger() != nullptr; NEO::CompilerOptions::concatenateAppend(internalOptions, compilerProductHelper.getCachingPolicyOptions(isDebuggerActive)); + + NEO::CompilerOptions::applyExtraInternalOptions(internalOptions, compilerProductHelper); return internalOptions; } diff --git a/shared/source/compiler_interface/CMakeLists.txt b/shared/source/compiler_interface/CMakeLists.txt index 45440281ac..8f88d23d2d 100644 --- a/shared/source/compiler_interface/CMakeLists.txt +++ b/shared/source/compiler_interface/CMakeLists.txt @@ -13,6 +13,8 @@ set(NEO_CORE_COMPILER_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/compiler_interface.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_options.h ${CMAKE_CURRENT_SOURCE_DIR}/compiler_options.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/compiler_options_extra.h + ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}compiler_options_extra.cpp ${CMAKE_CURRENT_SOURCE_DIR}/compiler_warnings/compiler_warnings.h ${CMAKE_CURRENT_SOURCE_DIR}/create_main.cpp ${CMAKE_CURRENT_SOURCE_DIR}/default_cache_config.h diff --git a/shared/source/compiler_interface/compiler_options_extra.cpp b/shared/source/compiler_interface/compiler_options_extra.cpp new file mode 100644 index 0000000000..9a2693fd11 --- /dev/null +++ b/shared/source/compiler_interface/compiler_options_extra.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/compiler_interface/compiler_options_extra.h" + +namespace NEO { +namespace CompilerOptions { +void applyExtraInternalOptions(std::string &internalOptions, const CompilerProductHelper &compilerProductHelper) { +} + +} // namespace CompilerOptions +} // namespace NEO diff --git a/shared/source/compiler_interface/compiler_options_extra.h b/shared/source/compiler_interface/compiler_options_extra.h new file mode 100644 index 0000000000..79b56a20ec --- /dev/null +++ b/shared/source/compiler_interface/compiler_options_extra.h @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once + +#include + +namespace NEO { +class CompilerProductHelper; + +namespace CompilerOptions { + +void applyExtraInternalOptions(std::string &internalOptions, const CompilerProductHelper &compilerProductHelper); + +} // namespace CompilerOptions +} // namespace NEO diff --git a/shared/source/helpers/compiler_product_helper.h b/shared/source/helpers/compiler_product_helper.h index 06c357c236..a9879f4b7d 100644 --- a/shared/source/helpers/compiler_product_helper.h +++ b/shared/source/helpers/compiler_product_helper.h @@ -57,6 +57,7 @@ class CompilerProductHelper { virtual uint32_t matchRevisionIdWithProductConfig(HardwareIpVersion ipVersion, uint32_t revisionID) const = 0; virtual std::string getDeviceExtensions(const HardwareInfo &hwInfo, const ReleaseHelper *releaseHelper) const = 0; virtual void adjustHwInfoForIgc(HardwareInfo &hwInfo) const = 0; + virtual bool isHeaplessModeEnabled() const = 0; virtual ~CompilerProductHelper() = default; uint32_t getHwIpVersion(const HardwareInfo &hwInfo) const; @@ -97,6 +98,7 @@ class CompilerProductHelperHw : public CompilerProductHelper { uint32_t matchRevisionIdWithProductConfig(HardwareIpVersion ipVersion, uint32_t revisionID) const override; std::string getDeviceExtensions(const HardwareInfo &hwInfo, const ReleaseHelper *releaseHelper) const override; void adjustHwInfoForIgc(HardwareInfo &hwInfo) const override; + bool isHeaplessModeEnabled() const override; ~CompilerProductHelperHw() override = default; diff --git a/shared/source/helpers/compiler_product_helper_base.inl b/shared/source/helpers/compiler_product_helper_base.inl index 8b7ea97fd3..6102c42579 100644 --- a/shared/source/helpers/compiler_product_helper_base.inl +++ b/shared/source/helpers/compiler_product_helper_base.inl @@ -203,6 +203,11 @@ std::string CompilerProductHelperHw::getDeviceExtensions(const Hardw return extensions; } +template +bool CompilerProductHelperHw::isHeaplessModeEnabled() const { + return false; +} + template uint32_t CompilerProductHelperHw::matchRevisionIdWithProductConfig(HardwareIpVersion ipVersion, uint32_t revisionID) const { return ipVersion.value; diff --git a/shared/test/unit_test/helpers/compiler_product_helper_tests.cpp b/shared/test/unit_test/helpers/compiler_product_helper_tests.cpp index 7f6d9e93fc..66057a74a5 100644 --- a/shared/test/unit_test/helpers/compiler_product_helper_tests.cpp +++ b/shared/test/unit_test/helpers/compiler_product_helper_tests.cpp @@ -309,3 +309,8 @@ HWTEST_F(CompilerProductHelperFixture, givenProductHelperWhenGetAndOverrideHwIpV hwInfo.ipVersion.value = 0x5678; EXPECT_EQ(compilerProductHelper.getHwIpVersion(hwInfo), config); } + +HWTEST_F(CompilerProductHelperFixture, givenCompilerProductHelperWhenIsHeaplessModeEnabledThenFalseIsReturned) { + auto &compilerProductHelper = pDevice->getCompilerProductHelper(); + EXPECT_FALSE(compilerProductHelper.isHeaplessModeEnabled()); +}