diff --git a/level_zero/doc/experimental_extensions/MULTI_CCS_MODES.md b/level_zero/doc/experimental_extensions/MULTI_CCS_MODES.md index 6da325ad71..b684300fee 100644 --- a/level_zero/doc/experimental_extensions/MULTI_CCS_MODES.md +++ b/level_zero/doc/experimental_extensions/MULTI_CCS_MODES.md @@ -72,5 +72,5 @@ Alternatively, a process may select different modes for each tile. For instance, # Availability -- `ZEX_NUMBER_OF_CCS` is only supported and meant to be used on PVC. +- `ZEX_NUMBER_OF_CCS` is only supported and meant to be used on PVC and DG2. - `ZEX_NUMBER_OF_CCS` can be used also by applications using Intel OpenCL GPU driver. \ No newline at end of file diff --git a/shared/source/xe_hpg_core/dg2/os_agnostic_product_helper_dg2.inl b/shared/source/xe_hpg_core/dg2/os_agnostic_product_helper_dg2.inl index d654219845..a94d301c72 100644 --- a/shared/source/xe_hpg_core/dg2/os_agnostic_product_helper_dg2.inl +++ b/shared/source/xe_hpg_core/dg2/os_agnostic_product_helper_dg2.inl @@ -255,4 +255,9 @@ bool ProductHelperHw::disableL3CacheForDebug(const HardwareInfo &hwI return DG2::isG10(hwInfo) && GfxCoreHelper::isWorkaroundRequired(REVISION_A0, REVISION_B, hwInfo, *this); } +template <> +void ProductHelperHw::adjustNumberOfCcs(HardwareInfo &hwInfo) const { + hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 1; +} + } // namespace NEO diff --git a/shared/test/common/mocks/mock_execution_environment.h b/shared/test/common/mocks/mock_execution_environment.h index 424e459859..55b1b404d2 100644 --- a/shared/test/common/mocks/mock_execution_environment.h +++ b/shared/test/common/mocks/mock_execution_environment.h @@ -26,7 +26,9 @@ struct MockRootDeviceEnvironment : public RootDeviceEnvironment { }; struct MockExecutionEnvironment : ExecutionEnvironment { + using ExecutionEnvironment::adjustCcsCountImpl; using ExecutionEnvironment::directSubmissionController; + using ExecutionEnvironment::rootDeviceEnvironments; ~MockExecutionEnvironment() override = default; MockExecutionEnvironment(); diff --git a/shared/test/unit_test/xe_hpg_core/dg2/CMakeLists.txt b/shared/test/unit_test/xe_hpg_core/dg2/CMakeLists.txt index c80d9ba7bd..a141942497 100644 --- a/shared/test/unit_test/xe_hpg_core/dg2/CMakeLists.txt +++ b/shared/test/unit_test/xe_hpg_core/dg2/CMakeLists.txt @@ -17,6 +17,7 @@ if(TESTS_DG2) ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_dg2_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/device_binary_format_ar_tests_dg2.cpp ${CMAKE_CURRENT_SOURCE_DIR}/device_factory_tests_dg2.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/device_tests_dg2.cpp ${CMAKE_CURRENT_SOURCE_DIR}/gfx_core_helper_tests_dg2.cpp ${CMAKE_CURRENT_SOURCE_DIR}/memory_manager_tests_dg2.cpp ${CMAKE_CURRENT_SOURCE_DIR}/product_config_helper_tests_dg2.cpp diff --git a/shared/test/unit_test/xe_hpg_core/dg2/device_tests_dg2.cpp b/shared/test/unit_test/xe_hpg_core/dg2/device_tests_dg2.cpp new file mode 100644 index 0000000000..20ac16a0aa --- /dev/null +++ b/shared/test/unit_test/xe_hpg_core/dg2/device_tests_dg2.cpp @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/xe_hpg_core/hw_cmds_dg2.h" +#include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/common/helpers/default_hw_info.h" +#include "shared/test/common/helpers/ult_hw_config.h" +#include "shared/test/common/mocks/mock_device.h" +#include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/common/mocks/ult_device_factory.h" +#include "shared/test/common/test_macros/header/per_product_test_definitions.h" +#include "shared/test/common/test_macros/test.h" + +using namespace NEO; + +using DeviceTestsDg2 = ::testing::Test; + +HWTEST_EXCLUDE_PRODUCT(DeviceTests, givenZexNumberOfCssEnvVariableSetAmbigouslyWhenDeviceIsCreatedThenDontApplyAnyLimitations, IGFX_DG2) + +DG2TEST_F(DeviceTestsDg2, WhenAdjustCCSCountImplCalledThenHwInfoReportOneComputeEngine) { + VariableBackup backup(&ultHwConfig); + ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false; + auto hwInfo = *defaultHwInfo; + + hwInfo.featureTable.flags.ftrCCSNode = 1; + hwInfo.gtSystemInfo.CCSInfo.IsValid = 1; + hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 4; + + auto executionEnvironment = std::make_unique(&hwInfo); + executionEnvironment->incRefInternal(); + executionEnvironment->adjustCcsCountImpl(executionEnvironment->rootDeviceEnvironments[0].get()); + EXPECT_EQ(1u, executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo()->gtSystemInfo.CCSInfo.NumberOfCCSEnabled); +}