feature(sysman): adds sysman product helper for all supported platforms

Related-To: NEO-8720

Signed-off-by: Kulkarni, Ashwin Kumar <ashwin.kumar.kulkarni@intel.com>
This commit is contained in:
Kulkarni, Ashwin Kumar
2023-11-15 13:58:28 +00:00
committed by Compute-Runtime-Automation
parent 8dd80efbb1
commit 5c7875bbb9
41 changed files with 450 additions and 49 deletions

View File

@@ -0,0 +1,7 @@
#
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
add_subdirectories()

View File

@@ -0,0 +1,13 @@
#
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(SUPPORT_ICLLP)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_icllp.cpp
)
endif()

View File

@@ -0,0 +1,17 @@
/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#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<IGFX_ICELAKE_LP> enableICL_LP;
} // namespace Sysman
} // namespace L0

View File

@@ -0,0 +1,7 @@
#
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
add_subdirectories()

View File

@@ -0,0 +1,13 @@
#
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(SUPPORT_ADLN)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_adln.cpp
)
endif()

View File

@@ -0,0 +1,17 @@
/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#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<IGFX_ALDERLAKE_N> enableADLN;
} // namespace Sysman
} // namespace L0

View File

@@ -0,0 +1,13 @@
#
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(SUPPORT_ADLP)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_adlp.cpp
)
endif()

View File

@@ -0,0 +1,17 @@
/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#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<IGFX_ALDERLAKE_P> enableADLP;
} // namespace Sysman
} // namespace L0

View File

@@ -0,0 +1,13 @@
#
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(SUPPORT_ADLS)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_adls.cpp
)
endif()

View File

@@ -0,0 +1,17 @@
/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#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<IGFX_ALDERLAKE_S> enableADL_S;
} // namespace Sysman
} // namespace L0

View File

@@ -7,8 +7,8 @@
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
${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_dg1.cpp
)
endif()

View File

@@ -5,7 +5,6 @@
*
*/
#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"

View File

@@ -5,12 +5,10 @@
*
*/
#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 <>
@@ -19,4 +17,4 @@ ze_result_t SysmanProductHelperHw<gfxProduct>::getMemoryProperties(zes_mem_prope
}
} // namespace Sysman
} // namespace L0
} // namespace L0

View File

@@ -0,0 +1,13 @@
#
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(SUPPORT_RKL)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_rkl.cpp
)
endif()

View File

@@ -0,0 +1,17 @@
/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#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<IGFX_ROCKETLAKE> enableRKL;
} // namespace Sysman
} // namespace L0

View File

@@ -0,0 +1,13 @@
#
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(SUPPORT_TGLLP)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_tgllp.cpp
)
endif()

View File

@@ -0,0 +1,17 @@
/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#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<IGFX_TIGERLAKE_LP> enableTGL_LP;
} // namespace Sysman
} // namespace L0

View File

@@ -0,0 +1,7 @@
#
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
add_subdirectories()

View File

@@ -0,0 +1,13 @@
#
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(SUPPORT_CFL)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_cfl.cpp
)
endif()

View File

@@ -0,0 +1,17 @@
/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#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<IGFX_COFFEELAKE> enableCFL;
} // namespace Sysman
} // namespace L0

View File

@@ -0,0 +1,13 @@
#
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(SUPPORT_KBL)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_kbl.cpp
)
endif()

View File

@@ -0,0 +1,17 @@
/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#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<IGFX_KABYLAKE> enableKBL;
} // namespace Sysman
} // namespace L0

View File

@@ -0,0 +1,13 @@
#
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(SUPPORT_SKL)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_skl.cpp
)
endif()

View File

@@ -0,0 +1,17 @@
/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#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<IGFX_SKYLAKE> enableSKL;
} // namespace Sysman
} // namespace L0

View File

@@ -43,4 +43,4 @@ class SysmanProductHelper {
};
} // namespace Sysman
} // namespace L0
} // namespace L0

View File

@@ -0,0 +1,7 @@
#
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
add_subdirectories()

View File

@@ -7,7 +7,7 @@
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
${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_pvc.cpp
)
endif()

View File

@@ -5,7 +5,6 @@
*
*/
#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"
@@ -15,4 +14,4 @@ namespace Sysman {
static EnableSysmanProductHelper<IGFX_PVC> enablePVC;
} // namespace Sysman
} // namespace L0
} // namespace L0

View File

@@ -5,12 +5,10 @@
*
*/
#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 <>
@@ -24,4 +22,4 @@ ze_result_t SysmanProductHelperHw<gfxProduct>::getMemoryBandwidth(zes_mem_bandwi
}
} // namespace Sysman
} // namespace L0
} // namespace L0

View File

@@ -0,0 +1,7 @@
#
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
add_subdirectories()

View File

@@ -0,0 +1,13 @@
#
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(SUPPORT_ARL)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_arl.cpp
)
endif()

View File

@@ -0,0 +1,17 @@
/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#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<IGFX_ARROWLAKE> enableARL;
} // namespace Sysman
} // namespace L0

View File

@@ -7,8 +7,8 @@
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
${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_dg2.cpp
)
endif()

View File

@@ -5,7 +5,6 @@
*
*/
#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"
@@ -15,4 +14,4 @@ namespace Sysman {
static EnableSysmanProductHelper<IGFX_DG2> enableDG2;
} // namespace Sysman
} // namespace L0
} // namespace L0

View File

@@ -5,12 +5,10 @@
*
*/
#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 <>
@@ -19,4 +17,4 @@ ze_result_t SysmanProductHelperHw<gfxProduct>::getMemoryBandwidth(zes_mem_bandwi
}
} // namespace Sysman
} // namespace L0
} // namespace L0

View File

@@ -0,0 +1,13 @@
#
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(SUPPORT_MTL)
target_sources(${L0_STATIC_LIB_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/enable_sysman_product_helper_mtl.cpp
)
endif()

View File

@@ -0,0 +1,17 @@
/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#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<IGFX_METEORLAKE> enableMTL;
} // namespace Sysman
} // namespace L0

View File

@@ -6,7 +6,6 @@
*/
#include "level_zero/sysman/source/device/sysman_device_imp.h"
#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.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"
@@ -49,36 +48,6 @@ 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<const L0::Sysman::LinuxSysmanImp *>(pLinuxSysmanImp));
EXPECT_EQ(result, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
zes_mem_bandwidth_t bandwidth;
result = pSysmanProductHelper->getMemoryBandwidth(&bandwidth, static_cast<const L0::Sysman::LinuxSysmanImp *>(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<const L0::Sysman::LinuxSysmanImp *>(pLinuxSysmanImp));
EXPECT_EQ(result, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
zes_mem_bandwidth_t bandwidth;
result = pSysmanProductHelper->getMemoryBandwidth(&bandwidth, static_cast<const L0::Sysman::LinuxSysmanImp *>(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<const L0::Sysman::LinuxSysmanImp *>(pLinuxSysmanImp));
EXPECT_EQ(result, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
zes_mem_bandwidth_t bandwidth;
result = pSysmanProductHelper->getMemoryBandwidth(&bandwidth, static_cast<const L0::Sysman::LinuxSysmanImp *>(pLinuxSysmanImp));
EXPECT_EQ(result, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
}
TEST_F(SysmanDeviceMemoryFixture, GivenComponentCountZeroWhenEnumeratingMemoryModulesWithLocalMemorySupportThenValidCountIsReturned) {
setLocalSupportedAndReinit(false);
uint32_t count = 0;

View File

@@ -16,4 +16,5 @@ if(UNIX)
${L0_SYSMAN_SHARED_TESTS}
)
endif()
add_subdirectories()

View File

@@ -0,0 +1,13 @@
#
# Copyright (C) 2020-2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(UNIX)
target_sources(${TARGET_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/sysman_product_helper_tests.cpp
)
endif()

View File

@@ -0,0 +1,62 @@
/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "level_zero/sysman/source/device/sysman_device_imp.h"
#include "level_zero/sysman/source/shared/linux/product_helper/sysman_product_helper.h"
#include "level_zero/sysman/test/unit_tests/sources/linux/mock_sysman_fixture.h"
namespace L0 {
namespace Sysman {
namespace ult {
struct SysmanProductHelperTest : public SysmanDeviceFixture {
void SetUp() override {
SysmanDeviceFixture::SetUp();
}
void TearDown() override {
SysmanDeviceFixture::TearDown();
}
};
HWTEST2_F(SysmanProductHelperTest, 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<const L0::Sysman::LinuxSysmanImp *>(pLinuxSysmanImp));
EXPECT_EQ(result, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
zes_mem_bandwidth_t bandwidth;
result = pSysmanProductHelper->getMemoryBandwidth(&bandwidth, static_cast<const L0::Sysman::LinuxSysmanImp *>(pLinuxSysmanImp));
EXPECT_EQ(result, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
}
HWTEST2_F(SysmanProductHelperTest, 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<const L0::Sysman::LinuxSysmanImp *>(pLinuxSysmanImp));
EXPECT_EQ(result, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
zes_mem_bandwidth_t bandwidth;
result = pSysmanProductHelper->getMemoryBandwidth(&bandwidth, static_cast<const L0::Sysman::LinuxSysmanImp *>(pLinuxSysmanImp));
EXPECT_EQ(result, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
}
HWTEST2_F(SysmanProductHelperTest, 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<const L0::Sysman::LinuxSysmanImp *>(pLinuxSysmanImp));
EXPECT_EQ(result, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
zes_mem_bandwidth_t bandwidth;
result = pSysmanProductHelper->getMemoryBandwidth(&bandwidth, static_cast<const L0::Sysman::LinuxSysmanImp *>(pLinuxSysmanImp));
EXPECT_EQ(result, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
}
TEST_F(SysmanProductHelperTest, GivenInvalidProductFamilyWhenCallingProductHelperCreateThenNullPtrIsReturned) {
auto pSysmanProductHelper = L0::Sysman::SysmanProductHelper::create(IGFX_UNKNOWN);
EXPECT_EQ(nullptr, pSysmanProductHelper);
}
} // namespace ult
} // namespace Sysman
} // namespace L0