From 3c2ef4fbbf5d160025714d9020a0cf261b63fe1b Mon Sep 17 00:00:00 2001 From: "Bari, Pratik" Date: Tue, 19 Sep 2023 19:47:11 +0000 Subject: [PATCH] feature(sysman): Boilerplate for Sysman Product Helper - Added the product specific files and some functions - Have added APIs to call the interface to the Sysman product helper - Have added ULTs for the new APIs Related-To: NEO-8584 Signed-off-by: Bari, Pratik --- .../sysman/source/linux/zes_os_sysman_imp.cpp | 6 +++ .../sysman/source/linux/zes_os_sysman_imp.h | 4 ++ .../sysman/source/shared/linux/CMakeLists.txt | 4 ++ .../linux/product_helper/CMakeLists.txt | 17 +++++++ .../linux/product_helper/dg1/CMakeLists.txt | 14 ++++++ .../dg1/enable_sysman_product_helper_dg1.cpp | 18 ++++++++ .../dg1/sysman_product_helper_dg1.cpp | 22 +++++++++ .../linux/product_helper/dg2/CMakeLists.txt | 14 ++++++ .../dg2/enable_sysman_product_helper_dg2.cpp | 18 ++++++++ .../dg2/sysman_product_helper_dg2.cpp | 22 +++++++++ .../linux/product_helper/pvc/CMakeLists.txt | 13 ++++++ .../pvc/enable_sysman_product_helper_pvc.cpp | 18 ++++++++ .../pvc/sysman_product_helper_pvc.cpp | 27 +++++++++++ .../product_helper/sysman_product_helper.cpp | 16 +++++++ .../product_helper/sysman_product_helper.h | 46 +++++++++++++++++++ .../product_helper/sysman_product_helper_hw.h | 40 ++++++++++++++++ .../sysman_product_helper_hw.inl | 25 ++++++++++ .../memory/linux/test_sysman_memory.cpp | 31 +++++++++++++ 18 files changed, 355 insertions(+) create mode 100644 level_zero/sysman/source/shared/linux/product_helper/CMakeLists.txt create mode 100644 level_zero/sysman/source/shared/linux/product_helper/dg1/CMakeLists.txt create mode 100644 level_zero/sysman/source/shared/linux/product_helper/dg1/enable_sysman_product_helper_dg1.cpp create mode 100644 level_zero/sysman/source/shared/linux/product_helper/dg1/sysman_product_helper_dg1.cpp create mode 100644 level_zero/sysman/source/shared/linux/product_helper/dg2/CMakeLists.txt create mode 100644 level_zero/sysman/source/shared/linux/product_helper/dg2/enable_sysman_product_helper_dg2.cpp create mode 100644 level_zero/sysman/source/shared/linux/product_helper/dg2/sysman_product_helper_dg2.cpp create mode 100644 level_zero/sysman/source/shared/linux/product_helper/pvc/CMakeLists.txt create mode 100644 level_zero/sysman/source/shared/linux/product_helper/pvc/enable_sysman_product_helper_pvc.cpp create mode 100644 level_zero/sysman/source/shared/linux/product_helper/pvc/sysman_product_helper_pvc.cpp create mode 100644 level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.cpp create mode 100644 level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.h create mode 100644 level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.h create mode 100644 level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.inl diff --git a/level_zero/sysman/source/linux/zes_os_sysman_imp.cpp b/level_zero/sysman/source/linux/zes_os_sysman_imp.cpp index 991cb9500f..53a03a9806 100644 --- a/level_zero/sysman/source/linux/zes_os_sysman_imp.cpp +++ b/level_zero/sysman/source/linux/zes_os_sysman_imp.cpp @@ -22,6 +22,7 @@ #include "level_zero/sysman/source/linux/sysman_fs_access.h" #include "level_zero/sysman/source/pci/linux/sysman_os_pci_imp.h" #include "level_zero/sysman/source/pci/sysman_pci_utils.h" +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.h" #include "level_zero/sysman/source/shared/linux/sysman_kmd_interface.h" namespace L0 { @@ -66,6 +67,7 @@ ze_result_t LinuxSysmanImp::init() { pSysfsAccess->getRealPath(deviceDir, gtDevicePath); pSysmanKmdInterface = SysmanKmdInterface::create(*getDrm()); + pSysmanProductHelper = SysmanProductHelper::create(getProductFamily()); osInterface.getDriverModel()->as()->cleanup(); // Close Drm handles @@ -184,6 +186,10 @@ uint32_t LinuxSysmanImp::getSubDeviceCount() { return subDeviceCount; } +SysmanProductHelper *LinuxSysmanImp::getSysmanProductHelper() { + return pSysmanProductHelper.get(); +} + LinuxSysmanImp::LinuxSysmanImp(SysmanDeviceImp *pParentSysmanDeviceImp) { this->pParentSysmanDeviceImp = pParentSysmanDeviceImp; executionEnvironment = pParentSysmanDeviceImp->getExecutionEnvironment(); diff --git a/level_zero/sysman/source/linux/zes_os_sysman_imp.h b/level_zero/sysman/source/linux/zes_os_sysman_imp.h index 905efb1a1c..d310f2a463 100644 --- a/level_zero/sysman/source/linux/zes_os_sysman_imp.h +++ b/level_zero/sysman/source/linux/zes_os_sysman_imp.h @@ -24,6 +24,8 @@ class Drm; namespace L0 { namespace Sysman { + +class SysmanProductHelper; class PlatformMonitoringTech; class PmuInterface; class FsAccess; @@ -45,6 +47,7 @@ class LinuxSysmanImp : public OsSysman, NEO::NonCopyableOrMovableClass { ProcfsAccess &getProcfsAccess(); SysfsAccess &getSysfsAccess(); SysmanDeviceImp *getSysmanDeviceImp(); + SysmanProductHelper *getSysmanProductHelper(); uint32_t getSubDeviceCount() override; std::string getPciCardBusDirectoryPath(std::string realPciPath); uint32_t getMemoryType(); @@ -77,6 +80,7 @@ class LinuxSysmanImp : public OsSysman, NEO::NonCopyableOrMovableClass { SysmanKmdInterface *getSysmanKmdInterface() { return pSysmanKmdInterface.get(); } protected: + std::unique_ptr pSysmanProductHelper; std::unique_ptr pSysmanKmdInterface; FsAccess *pFsAccess = nullptr; ProcfsAccess *pProcfsAccess = nullptr; diff --git a/level_zero/sysman/source/shared/linux/CMakeLists.txt b/level_zero/sysman/source/shared/linux/CMakeLists.txt index 7c645cae67..006b4cba09 100644 --- a/level_zero/sysman/source/shared/linux/CMakeLists.txt +++ b/level_zero/sysman/source/shared/linux/CMakeLists.txt @@ -12,4 +12,8 @@ if(UNIX) ${CMAKE_CURRENT_SOURCE_DIR}/sysman_kmd_interface.h ${CMAKE_CURRENT_SOURCE_DIR}/sysman_fs_access_interface.h ) + + add_subdirectories() + endif() + diff --git a/level_zero/sysman/source/shared/linux/product_helper/CMakeLists.txt b/level_zero/sysman/source/shared/linux/product_helper/CMakeLists.txt new file mode 100644 index 0000000000..33ee27937f --- /dev/null +++ b/level_zero/sysman/source/shared/linux/product_helper/CMakeLists.txt @@ -0,0 +1,17 @@ +# +# Copyright (C) 2023 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +target_sources(${L0_STATIC_LIB_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper.h + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_hw.h + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_hw.inl + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper.cpp +) + +add_subdirectories() + diff --git a/level_zero/sysman/source/shared/linux/product_helper/dg1/CMakeLists.txt b/level_zero/sysman/source/shared/linux/product_helper/dg1/CMakeLists.txt new file mode 100644 index 0000000000..d46dcc231f --- /dev/null +++ b/level_zero/sysman/source/shared/linux/product_helper/dg1/CMakeLists.txt @@ -0,0 +1,14 @@ +# +# Copyright (C) 2023 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +if(SUPPORT_DG1) + target_sources(${L0_STATIC_LIB_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_dg1.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_dg1.cpp + ) +endif() + diff --git a/level_zero/sysman/source/shared/linux/product_helper/dg1/enable_sysman_product_helper_dg1.cpp b/level_zero/sysman/source/shared/linux/product_helper/dg1/enable_sysman_product_helper_dg1.cpp new file mode 100644 index 0000000000..43e4f7a059 --- /dev/null +++ b/level_zero/sysman/source/shared/linux/product_helper/dg1/enable_sysman_product_helper_dg1.cpp @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.h" +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.h" +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.inl" + +namespace L0 { +namespace Sysman { + +static EnableSysmanProductHelper enableDG1; + +} // namespace Sysman +} // namespace L0 \ No newline at end of file diff --git a/level_zero/sysman/source/shared/linux/product_helper/dg1/sysman_product_helper_dg1.cpp b/level_zero/sysman/source/shared/linux/product_helper/dg1/sysman_product_helper_dg1.cpp new file mode 100644 index 0000000000..309a522131 --- /dev/null +++ b/level_zero/sysman/source/shared/linux/product_helper/dg1/sysman_product_helper_dg1.cpp @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.h" +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.h" + +namespace L0 { +namespace Sysman { + +constexpr static auto gfxProduct = IGFX_DG1; + +template <> +ze_result_t SysmanProductHelperHw::getMemoryProperties(zes_mem_properties_t *pProperties, const LinuxSysmanImp *pLinuxSysmanImp) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +} // namespace Sysman +} // namespace L0 \ No newline at end of file diff --git a/level_zero/sysman/source/shared/linux/product_helper/dg2/CMakeLists.txt b/level_zero/sysman/source/shared/linux/product_helper/dg2/CMakeLists.txt new file mode 100644 index 0000000000..a358d4a48a --- /dev/null +++ b/level_zero/sysman/source/shared/linux/product_helper/dg2/CMakeLists.txt @@ -0,0 +1,14 @@ +# +# Copyright (C) 2023 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +if(SUPPORT_DG2) + target_sources(${L0_STATIC_LIB_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_dg2.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_dg2.cpp + ) +endif() + diff --git a/level_zero/sysman/source/shared/linux/product_helper/dg2/enable_sysman_product_helper_dg2.cpp b/level_zero/sysman/source/shared/linux/product_helper/dg2/enable_sysman_product_helper_dg2.cpp new file mode 100644 index 0000000000..e19d4ee1ee --- /dev/null +++ b/level_zero/sysman/source/shared/linux/product_helper/dg2/enable_sysman_product_helper_dg2.cpp @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.h" +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.h" +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.inl" + +namespace L0 { +namespace Sysman { + +static EnableSysmanProductHelper enableDG2; + +} // namespace Sysman +} // namespace L0 \ No newline at end of file diff --git a/level_zero/sysman/source/shared/linux/product_helper/dg2/sysman_product_helper_dg2.cpp b/level_zero/sysman/source/shared/linux/product_helper/dg2/sysman_product_helper_dg2.cpp new file mode 100644 index 0000000000..051389cbb6 --- /dev/null +++ b/level_zero/sysman/source/shared/linux/product_helper/dg2/sysman_product_helper_dg2.cpp @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.h" +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.h" + +namespace L0 { +namespace Sysman { + +constexpr static auto gfxProduct = IGFX_DG2; + +template <> +ze_result_t SysmanProductHelperHw::getMemoryBandwidth(zes_mem_bandwidth_t *pBandwidth, const LinuxSysmanImp *pLinuxSysmanImp) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +} // namespace Sysman +} // namespace L0 \ No newline at end of file diff --git a/level_zero/sysman/source/shared/linux/product_helper/pvc/CMakeLists.txt b/level_zero/sysman/source/shared/linux/product_helper/pvc/CMakeLists.txt new file mode 100644 index 0000000000..73d5034e30 --- /dev/null +++ b/level_zero/sysman/source/shared/linux/product_helper/pvc/CMakeLists.txt @@ -0,0 +1,13 @@ +# +# Copyright (C) 2023 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +if(SUPPORT_PVC) + target_sources(${L0_STATIC_LIB_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_pvc.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_pvc.cpp + ) +endif() diff --git a/level_zero/sysman/source/shared/linux/product_helper/pvc/enable_sysman_product_helper_pvc.cpp b/level_zero/sysman/source/shared/linux/product_helper/pvc/enable_sysman_product_helper_pvc.cpp new file mode 100644 index 0000000000..d00d7855db --- /dev/null +++ b/level_zero/sysman/source/shared/linux/product_helper/pvc/enable_sysman_product_helper_pvc.cpp @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.h" +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.h" +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.inl" + +namespace L0 { +namespace Sysman { + +static EnableSysmanProductHelper enablePVC; + +} // namespace Sysman +} // namespace L0 \ No newline at end of file diff --git a/level_zero/sysman/source/shared/linux/product_helper/pvc/sysman_product_helper_pvc.cpp b/level_zero/sysman/source/shared/linux/product_helper/pvc/sysman_product_helper_pvc.cpp new file mode 100644 index 0000000000..b81a514295 --- /dev/null +++ b/level_zero/sysman/source/shared/linux/product_helper/pvc/sysman_product_helper_pvc.cpp @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.h" +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.h" + +namespace L0 { +namespace Sysman { + +constexpr static auto gfxProduct = IGFX_PVC; + +template <> +ze_result_t SysmanProductHelperHw::getMemoryProperties(zes_mem_properties_t *pProperties, const LinuxSysmanImp *pLinuxSysmanImp) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +template <> +ze_result_t SysmanProductHelperHw::getMemoryBandwidth(zes_mem_bandwidth_t *pBandwidth, const LinuxSysmanImp *pLinuxSysmanImp) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +} // namespace Sysman +} // namespace L0 \ No newline at end of file diff --git a/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.cpp b/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.cpp new file mode 100644 index 0000000000..1c9fa6fe88 --- /dev/null +++ b/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.h" + +namespace L0 { +namespace Sysman { + +SysmanProductHelperCreateFunctionType SysmanProductHelperFactory[IGFX_MAX_PRODUCT] = {}; + +} +} // namespace L0 \ No newline at end of file diff --git a/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.h b/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.h new file mode 100644 index 0000000000..055ab21a41 --- /dev/null +++ b/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once + +#include +#include + +#include "igfxfmid.h" + +#include + +namespace L0 { +namespace Sysman { + +class SysmanProductHelper; +class LinuxSysmanImp; + +using SysmanProductHelperCreateFunctionType = std::unique_ptr (*)(); +extern SysmanProductHelperCreateFunctionType SysmanProductHelperFactory[IGFX_MAX_PRODUCT]; + +class SysmanProductHelper { + public: + static std::unique_ptr create(PRODUCT_FAMILY product) { + auto productHelperCreateFunction = SysmanProductHelperFactory[product]; + if (productHelperCreateFunction == nullptr) { + return nullptr; + } + auto productHelper = productHelperCreateFunction(); + return productHelper; + } + + virtual ze_result_t getMemoryProperties(zes_mem_properties_t *pProperties, const LinuxSysmanImp *pLinuxSysmanImp) = 0; + virtual ze_result_t getMemoryBandwidth(zes_mem_bandwidth_t *pBandwidth, const LinuxSysmanImp *pLinuxSysmanImp) = 0; + virtual ~SysmanProductHelper() = default; + + protected: + SysmanProductHelper() = default; +}; + +} // namespace Sysman +} // namespace L0 \ No newline at end of file diff --git a/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.h b/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.h new file mode 100644 index 0000000000..9f50fa577a --- /dev/null +++ b/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.h" + +namespace L0 { +namespace Sysman { + +template +class SysmanProductHelperHw : public SysmanProductHelper { + public: + static std::unique_ptr create() { + auto pSysmanProductHelper = std::unique_ptr(new SysmanProductHelperHw()); + return pSysmanProductHelper; + } + + ze_result_t getMemoryProperties(zes_mem_properties_t *pProperties, const LinuxSysmanImp *pLinuxSysmanImp) override; + ze_result_t getMemoryBandwidth(zes_mem_bandwidth_t *pBandwidth, const LinuxSysmanImp *pLinuxSysmanImp) override; + + ~SysmanProductHelperHw() override = default; + + protected: + SysmanProductHelperHw() = default; +}; + +template +struct EnableSysmanProductHelper { + EnableSysmanProductHelper() { + auto sysmanProductHelperCreateFunction = SysmanProductHelperHw::create; + SysmanProductHelperFactory[gfxProduct] = sysmanProductHelperCreateFunction; + } +}; + +} // namespace Sysman +} // namespace L0 \ No newline at end of file diff --git a/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.inl b/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.inl new file mode 100644 index 0000000000..092f86c818 --- /dev/null +++ b/level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.inl @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.h" +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper_hw.h" + +namespace L0 { +namespace Sysman { + +template +ze_result_t SysmanProductHelperHw::getMemoryProperties(zes_mem_properties_t *pProperties, const LinuxSysmanImp *pLinuxSysmanImp) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +template +ze_result_t SysmanProductHelperHw::getMemoryBandwidth(zes_mem_bandwidth_t *pBandwidth, const LinuxSysmanImp *pLinuxSysmanImp) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +} // namespace Sysman +} // namespace L0 \ No newline at end of file diff --git a/level_zero/sysman/test/unit_tests/sources/memory/linux/test_sysman_memory.cpp b/level_zero/sysman/test/unit_tests/sources/memory/linux/test_sysman_memory.cpp index 0facbb00fa..54ae019a73 100644 --- a/level_zero/sysman/test/unit_tests/sources/memory/linux/test_sysman_memory.cpp +++ b/level_zero/sysman/test/unit_tests/sources/memory/linux/test_sysman_memory.cpp @@ -5,6 +5,7 @@ * */ +#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.h" #include "level_zero/sysman/source/sysman_device_imp.h" #include "level_zero/sysman/test/unit_tests/sources/linux/mock_sysman_fixture.h" #include "level_zero/sysman/test/unit_tests/sources/memory/linux/mock_memory.h" @@ -48,6 +49,36 @@ class SysmanDeviceMemoryFixture : public SysmanDeviceFixture { L0::Sysman::SysmanDevice *device = nullptr; }; +HWTEST2_F(SysmanDeviceMemoryFixture, GivenSysmanProductHelperInstanceWhenCallingMemoryAPIsThenErrorIsReturned, IsPVC) { + auto pSysmanProductHelper = L0::Sysman::SysmanProductHelper::create(defaultHwInfo->platform.eProductFamily); + zes_mem_properties_t properties; + ze_result_t result = pSysmanProductHelper->getMemoryProperties(&properties, static_cast(pLinuxSysmanImp)); + EXPECT_EQ(result, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + zes_mem_bandwidth_t bandwidth; + result = pSysmanProductHelper->getMemoryBandwidth(&bandwidth, static_cast(pLinuxSysmanImp)); + EXPECT_EQ(result, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); +} + +HWTEST2_F(SysmanDeviceMemoryFixture, GivenSysmanProductHelperInstanceWhenCallingMemoryAPIsThenErrorIsReturned, IsDG1) { + auto pSysmanProductHelper = L0::Sysman::SysmanProductHelper::create(defaultHwInfo->platform.eProductFamily); + zes_mem_properties_t properties; + ze_result_t result = pSysmanProductHelper->getMemoryProperties(&properties, static_cast(pLinuxSysmanImp)); + EXPECT_EQ(result, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + zes_mem_bandwidth_t bandwidth; + result = pSysmanProductHelper->getMemoryBandwidth(&bandwidth, static_cast(pLinuxSysmanImp)); + EXPECT_EQ(result, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); +} + +HWTEST2_F(SysmanDeviceMemoryFixture, GivenSysmanProductHelperInstanceWhenCallingMemoryAPIsThenErrorIsReturned, IsDG2) { + auto pSysmanProductHelper = L0::Sysman::SysmanProductHelper::create(defaultHwInfo->platform.eProductFamily); + zes_mem_properties_t properties; + ze_result_t result = pSysmanProductHelper->getMemoryProperties(&properties, static_cast(pLinuxSysmanImp)); + EXPECT_EQ(result, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + zes_mem_bandwidth_t bandwidth; + result = pSysmanProductHelper->getMemoryBandwidth(&bandwidth, static_cast(pLinuxSysmanImp)); + EXPECT_EQ(result, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); +} + TEST_F(SysmanDeviceMemoryFixture, GivenComponentCountZeroWhenEnumeratingMemoryModulesWithLocalMemorySupportThenValidCountIsReturned) { setLocalSupportedAndReinit(false); uint32_t count = 0;