From a9226a9113eda5a7b47790b8feed398a5b754c29 Mon Sep 17 00:00:00 2001 From: Filip Hazubski Date: Mon, 23 Aug 2021 14:26:21 +0000 Subject: [PATCH] Add HwHelper::getExtraExtensions Signed-off-by: Filip Hazubski --- opencl/source/cl_device/cl_device_caps.cpp | 2 +- shared/source/gen11/hw_helper_gen11.cpp | 4 +++- shared/source/gen12lp/hw_helper_gen12lp.cpp | 3 ++- shared/source/gen8/hw_helper_gen8.cpp | 2 ++ shared/source/gen9/hw_helper_gen9.cpp | 2 ++ shared/source/helpers/CMakeLists.txt | 5 +++-- .../helpers/definitions/hw_helper_extra.inl | 17 +++++++++++++++++ shared/source/helpers/hw_helper.h | 7 +++++-- .../source/helpers/hw_helper_bdw_and_later.inl | 2 +- .../source/xe_hp_core/hw_helper_xe_hp_core.cpp | 6 +++++- 10 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 shared/source/helpers/definitions/hw_helper_extra.inl diff --git a/opencl/source/cl_device/cl_device_caps.cpp b/opencl/source/cl_device/cl_device_caps.cpp index 0d32d422b5..f8856eda16 100644 --- a/opencl/source/cl_device/cl_device_caps.cpp +++ b/opencl/source/cl_device/cl_device_caps.cpp @@ -217,7 +217,7 @@ void ClDevice::initializeCaps() { deviceExtensions += "cl_khr_pci_bus_info "; } - deviceExtensions += hwHelper.getExtensions(); + deviceExtensions += hwHelper.getExtensions(hwInfo); deviceInfo.deviceExtensions = deviceExtensions.c_str(); std::vector exposedBuiltinKernelsVector; diff --git a/shared/source/gen11/hw_helper_gen11.cpp b/shared/source/gen11/hw_helper_gen11.cpp index 1b488fd67c..68c2abe74a 100644 --- a/shared/source/gen11/hw_helper_gen11.cpp +++ b/shared/source/gen11/hw_helper_gen11.cpp @@ -11,6 +11,8 @@ #include "shared/source/helpers/hw_helper_bdw_and_later.inl" #include "shared/source/helpers/hw_helper_bdw_to_icllp.inl" +#include "hw_helper_extra.inl" + namespace NEO { typedef ICLFamily Family; @@ -20,7 +22,7 @@ uint32_t HwHelperHw::getComputeUnitsUsedForScratch(const HardwareInfo *p } template <> -std::string HwHelperHw::getExtensions() const { +std::string HwHelperHw::getExtensions(const HardwareInfo &hwInfo) const { return "cl_intel_subgroup_local_block_io "; } diff --git a/shared/source/gen12lp/hw_helper_gen12lp.cpp b/shared/source/gen12lp/hw_helper_gen12lp.cpp index d16492b75c..a22e151c44 100644 --- a/shared/source/gen12lp/hw_helper_gen12lp.cpp +++ b/shared/source/gen12lp/hw_helper_gen12lp.cpp @@ -18,6 +18,7 @@ using Family = NEO::TGLLPFamily; #include "shared/source/os_interface/hw_info_config.h" #include "engine_node.h" +#include "hw_helper_extra.inl" namespace NEO { @@ -193,7 +194,7 @@ void MemorySynchronizationCommands::addPipeControlWA(LinearStream &comma } template <> -std::string HwHelperHw::getExtensions() const { +std::string HwHelperHw::getExtensions(const HardwareInfo &hwInfo) const { return "cl_intel_subgroup_local_block_io "; } diff --git a/shared/source/gen8/hw_helper_gen8.cpp b/shared/source/gen8/hw_helper_gen8.cpp index 7327fe9d81..241b0bd56f 100644 --- a/shared/source/gen8/hw_helper_gen8.cpp +++ b/shared/source/gen8/hw_helper_gen8.cpp @@ -12,6 +12,8 @@ #include "shared/source/helpers/hw_helper_bdw_and_later.inl" #include "shared/source/helpers/hw_helper_bdw_to_icllp.inl" +#include "hw_helper_extra.inl" + namespace NEO { typedef BDWFamily Family; diff --git a/shared/source/gen9/hw_helper_gen9.cpp b/shared/source/gen9/hw_helper_gen9.cpp index 83e4237474..2efe9293e6 100644 --- a/shared/source/gen9/hw_helper_gen9.cpp +++ b/shared/source/gen9/hw_helper_gen9.cpp @@ -11,6 +11,8 @@ #include "shared/source/helpers/hw_helper_bdw_and_later.inl" #include "shared/source/helpers/hw_helper_bdw_to_icllp.inl" +#include "hw_helper_extra.inl" + #include namespace NEO { diff --git a/shared/source/helpers/CMakeLists.txt b/shared/source/helpers/CMakeLists.txt index a3abb15c46..a9c56231ac 100644 --- a/shared/source/helpers/CMakeLists.txt +++ b/shared/source/helpers/CMakeLists.txt @@ -110,8 +110,9 @@ set(NEO_CORE_HELPERS ${CMAKE_CURRENT_SOURCE_DIR}/uint16_avx2.h ${CMAKE_CURRENT_SOURCE_DIR}/uint16_sse4.h ${CMAKE_CURRENT_SOURCE_DIR}/vec.h - ${CMAKE_CURRENT_SOURCE_DIR}/definitions/${BRANCH_DIR_SUFFIX}/hw_cmds.h - ${CMAKE_CURRENT_SOURCE_DIR}/definitions/${BRANCH_DIR_SUFFIX}/engine_group_types.h + ${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}/engine_group_types.h + ${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}/hw_cmds.h + ${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}/hw_helper_extra.inl ${CMAKE_CURRENT_SOURCE_DIR}/definitions/mi_flush_args.h ${CMAKE_CURRENT_SOURCE_DIR}/definitions/pipe_control_args_base.h ${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}/pipe_control_args.h diff --git a/shared/source/helpers/definitions/hw_helper_extra.inl b/shared/source/helpers/definitions/hw_helper_extra.inl new file mode 100644 index 0000000000..7edb69cede --- /dev/null +++ b/shared/source/helpers/definitions/hw_helper_extra.inl @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2021 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/helpers/hw_helper.h" + +namespace NEO { + +template +std::string HwHelperHw::getExtraExtensions(const HardwareInfo &hwInfo) const { + return ""; +} + +} // namespace NEO diff --git a/shared/source/helpers/hw_helper.h b/shared/source/helpers/hw_helper.h index bd0e402311..bc04428564 100644 --- a/shared/source/helpers/hw_helper.h +++ b/shared/source/helpers/hw_helper.h @@ -93,7 +93,7 @@ class HwHelper { virtual const StackVec getDeviceSubGroupSizes() const = 0; virtual const StackVec getThreadsPerEUConfigs() const = 0; virtual bool getEnableLocalMemory(const HardwareInfo &hwInfo) const = 0; - virtual std::string getExtensions() const = 0; + virtual std::string getExtensions(const HardwareInfo &hwInfo) const = 0; virtual std::string getDeviceMemoryName() const = 0; static uint32_t getMaxThreadsForVfe(const HardwareInfo &hwInfo); virtual uint32_t getMetricsLibraryGenId() const = 0; @@ -157,6 +157,7 @@ class HwHelper { protected: virtual LocalMemoryAccessMode getDefaultLocalMemoryAccessMode(const HardwareInfo &hwInfo) const = 0; + virtual std::string getExtraExtensions(const HardwareInfo &hwInfo) const = 0; HwHelper() = default; }; @@ -265,7 +266,7 @@ class HwHelperHw : public HwHelper { bool getEnableLocalMemory(const HardwareInfo &hwInfo) const override; - std::string getExtensions() const override; + std::string getExtensions(const HardwareInfo &hwInfo) const override; std::string getDeviceMemoryName() const override; @@ -387,6 +388,8 @@ class HwHelperHw : public HwHelper { protected: LocalMemoryAccessMode getDefaultLocalMemoryAccessMode(const HardwareInfo &hwInfo) const override; + std::string getExtraExtensions(const HardwareInfo &hwInfo) const override; + static const AuxTranslationMode defaultAuxTranslationMode; HwHelperHw() = default; }; diff --git a/shared/source/helpers/hw_helper_bdw_and_later.inl b/shared/source/helpers/hw_helper_bdw_and_later.inl index 6672151c3b..9088b81478 100644 --- a/shared/source/helpers/hw_helper_bdw_and_later.inl +++ b/shared/source/helpers/hw_helper_bdw_and_later.inl @@ -70,7 +70,7 @@ EngineGroupType HwHelperHw::getEngineGroupType(aub_stream::EngineType } template -std::string HwHelperHw::getExtensions() const { +std::string HwHelperHw::getExtensions(const HardwareInfo &hwInfo) const { return ""; } diff --git a/shared/source/xe_hp_core/hw_helper_xe_hp_core.cpp b/shared/source/xe_hp_core/hw_helper_xe_hp_core.cpp index 281a86e861..ec4d309283 100644 --- a/shared/source/xe_hp_core/hw_helper_xe_hp_core.cpp +++ b/shared/source/xe_hp_core/hw_helper_xe_hp_core.cpp @@ -19,6 +19,8 @@ using Family = NEO::XeHpFamily; #include "shared/source/helpers/hw_helper_xehp_and_later.inl" #include "shared/source/os_interface/hw_info_config.h" +#include "hw_helper_extra.inl" + namespace NEO { template <> const AuxTranslationMode HwHelperHw::defaultAuxTranslationMode = AuxTranslationMode::Blit; @@ -160,11 +162,13 @@ const StackVec HwHelperHw::getThreadsPerEUConfigs() const { } template <> -std::string HwHelperHw::getExtensions() const { +std::string HwHelperHw::getExtensions(const HardwareInfo &hwInfo) const { std::string extensions; extensions += "cl_intel_dot_accumulate "; extensions += "cl_intel_subgroup_local_block_io "; + extensions += getExtraExtensions(hwInfo); + return extensions; }