mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-23 03:01:20 +08:00
fix: Parse CCS mode setting for non PVC platforms
Related-To: GSD-8785 Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
7f607427fa
commit
5ca78dfdd1
@@ -371,7 +371,7 @@ void ExecutionEnvironment::adjustCcsCount(const uint32_t rootDeviceIndex) const
|
|||||||
auto &rootDeviceEnvironment = rootDeviceEnvironments[rootDeviceIndex];
|
auto &rootDeviceEnvironment = rootDeviceEnvironments[rootDeviceIndex];
|
||||||
UNRECOVERABLE_IF(!rootDeviceEnvironment);
|
UNRECOVERABLE_IF(!rootDeviceEnvironment);
|
||||||
if (rootDeviceNumCcsMap.find(rootDeviceIndex) != rootDeviceNumCcsMap.end()) {
|
if (rootDeviceNumCcsMap.find(rootDeviceIndex) != rootDeviceNumCcsMap.end()) {
|
||||||
rootDeviceEnvironment->limitNumberOfCcs(rootDeviceNumCcsMap.at(rootDeviceIndex));
|
rootDeviceEnvironment->setNumberOfCcs(rootDeviceNumCcsMap.at(rootDeviceIndex));
|
||||||
} else {
|
} else {
|
||||||
adjustCcsCountImpl(rootDeviceEnvironment.get());
|
adjustCcsCountImpl(rootDeviceEnvironment.get());
|
||||||
}
|
}
|
||||||
@@ -385,21 +385,11 @@ void ExecutionEnvironment::parseCcsCountLimitations() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint32_t numRootDevices = static_cast<uint32_t>(rootDeviceEnvironments.size());
|
for (auto rootDeviceIndex = 0u; rootDeviceIndex < rootDeviceEnvironments.size(); rootDeviceIndex++) {
|
||||||
|
auto &rootDeviceEnvironment = rootDeviceEnvironments[rootDeviceIndex];
|
||||||
auto numberOfCcsEntries = StringHelpers::split(numberOfCcsString, ",");
|
UNRECOVERABLE_IF(!rootDeviceEnvironment);
|
||||||
|
auto &productHelper = rootDeviceEnvironment->getHelper<ProductHelper>();
|
||||||
for (const auto &entry : numberOfCcsEntries) {
|
productHelper.parseCcsMode(numberOfCcsString, rootDeviceNumCcsMap, rootDeviceIndex, rootDeviceEnvironment.get());
|
||||||
auto subEntries = StringHelpers::split(entry, ":");
|
|
||||||
uint32_t rootDeviceIndex = StringHelpers::toUint32t(subEntries[0]);
|
|
||||||
|
|
||||||
if (rootDeviceIndex < numRootDevices) {
|
|
||||||
if (subEntries.size() > 1) {
|
|
||||||
uint32_t maxCcsCount = StringHelpers::toUint32t(subEntries[1]);
|
|
||||||
rootDeviceNumCcsMap.insert({rootDeviceIndex, maxCcsCount});
|
|
||||||
rootDeviceEnvironments[rootDeviceIndex]->limitNumberOfCcs(maxCcsCount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ BuiltIns *RootDeviceEnvironment::getBuiltIns() {
|
|||||||
return this->builtins.get();
|
return this->builtins.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RootDeviceEnvironment::limitNumberOfCcs(uint32_t numberOfCcs) {
|
void RootDeviceEnvironment::setNumberOfCcs(uint32_t numberOfCcs) {
|
||||||
|
|
||||||
hwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled = std::min(hwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled, numberOfCcs);
|
hwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled = std::min(hwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled, numberOfCcs);
|
||||||
limitedNumberOfCcs = true;
|
limitedNumberOfCcs = true;
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ struct RootDeviceEnvironment : NonCopyableClass {
|
|||||||
BindlessHeapsHelper *getBindlessHeapsHelper() const;
|
BindlessHeapsHelper *getBindlessHeapsHelper() const;
|
||||||
AssertHandler *getAssertHandler(Device *neoDevice);
|
AssertHandler *getAssertHandler(Device *neoDevice);
|
||||||
void createBindlessHeapsHelper(Device *rootDevice, bool availableDevices);
|
void createBindlessHeapsHelper(Device *rootDevice, bool availableDevices);
|
||||||
void limitNumberOfCcs(uint32_t numberOfCcs);
|
void setNumberOfCcs(uint32_t numberOfCcs);
|
||||||
bool isNumberOfCcsLimited() const;
|
bool isNumberOfCcsLimited() const;
|
||||||
void setRcsExposure();
|
void setRcsExposure();
|
||||||
void initProductHelper();
|
void initProductHelper();
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <unordered_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace aub_stream {
|
namespace aub_stream {
|
||||||
@@ -228,6 +229,8 @@ class ProductHelper {
|
|||||||
virtual void fillPipelineSelectPropertiesSupportStructure(PipelineSelectPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) const = 0;
|
virtual void fillPipelineSelectPropertiesSupportStructure(PipelineSelectPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) const = 0;
|
||||||
virtual void fillStateBaseAddressPropertiesSupportStructure(StateBaseAddressPropertiesSupport &propertiesSupport) const = 0;
|
virtual void fillStateBaseAddressPropertiesSupportStructure(StateBaseAddressPropertiesSupport &propertiesSupport) const = 0;
|
||||||
|
|
||||||
|
virtual void parseCcsMode(std::string ccsModeString, std::unordered_map<uint32_t, uint32_t> &rootDeviceNumCcsMap, uint32_t rootDeviceIndex, RootDeviceEnvironment *rootDeviceEnvironment) const = 0;
|
||||||
|
|
||||||
virtual bool isFusedEuDisabledForDpas(bool kernelHasDpasInstructions, const uint32_t *lws, const uint32_t *groupCount, const HardwareInfo &hwInfo) const = 0;
|
virtual bool isFusedEuDisabledForDpas(bool kernelHasDpasInstructions, const uint32_t *lws, const uint32_t *groupCount, const HardwareInfo &hwInfo) const = 0;
|
||||||
virtual bool isCalculationForDisablingEuFusionWithDpasNeeded(const HardwareInfo &hwInfo) const = 0;
|
virtual bool isCalculationForDisablingEuFusionWithDpasNeeded(const HardwareInfo &hwInfo) const = 0;
|
||||||
virtual uint32_t getNumberOfPartsInTileForConcurrentKernel(uint32_t ccsCount) const = 0;
|
virtual uint32_t getNumberOfPartsInTileForConcurrentKernel(uint32_t ccsCount) const = 0;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#include "shared/source/helpers/kernel_helpers.h"
|
#include "shared/source/helpers/kernel_helpers.h"
|
||||||
#include "shared/source/helpers/local_memory_access_modes.h"
|
#include "shared/source/helpers/local_memory_access_modes.h"
|
||||||
#include "shared/source/helpers/preamble.h"
|
#include "shared/source/helpers/preamble.h"
|
||||||
|
#include "shared/source/helpers/string_helpers.h"
|
||||||
#include "shared/source/kernel/kernel_descriptor.h"
|
#include "shared/source/kernel/kernel_descriptor.h"
|
||||||
#include "shared/source/kernel/kernel_properties.h"
|
#include "shared/source/kernel/kernel_properties.h"
|
||||||
#include "shared/source/memory_manager/allocation_properties.h"
|
#include "shared/source/memory_manager/allocation_properties.h"
|
||||||
@@ -770,6 +771,15 @@ void ProductHelperHw<gfxProduct>::fillStateBaseAddressPropertiesSupportStructure
|
|||||||
propertiesSupport.bindingTablePoolBaseAddress = getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport();
|
propertiesSupport.bindingTablePoolBaseAddress = getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <PRODUCT_FAMILY gfxProduct>
|
||||||
|
void ProductHelperHw<gfxProduct>::parseCcsMode(std::string ccsModeString, std::unordered_map<uint32_t, uint32_t> &rootDeviceNumCcsMap, uint32_t rootDeviceIndex, RootDeviceEnvironment *rootDeviceEnvironment) const {
|
||||||
|
|
||||||
|
auto ccsCount = StringHelpers::toUint32t(ccsModeString);
|
||||||
|
|
||||||
|
rootDeviceNumCcsMap.insert({rootDeviceIndex, ccsCount});
|
||||||
|
rootDeviceEnvironment->setNumberOfCcs(ccsCount);
|
||||||
|
}
|
||||||
|
|
||||||
template <PRODUCT_FAMILY gfxProduct>
|
template <PRODUCT_FAMILY gfxProduct>
|
||||||
bool ProductHelperHw<gfxProduct>::getPreemptionDbgPropertyPreemptionModeSupport() const {
|
bool ProductHelperHw<gfxProduct>::getPreemptionDbgPropertyPreemptionModeSupport() const {
|
||||||
using GfxProduct = typename HwMapper<gfxProduct>::GfxProduct;
|
using GfxProduct = typename HwMapper<gfxProduct>::GfxProduct;
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ class ProductHelperHw : public ProductHelper {
|
|||||||
void fillFrontEndPropertiesSupportStructure(FrontEndPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) const override;
|
void fillFrontEndPropertiesSupportStructure(FrontEndPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) const override;
|
||||||
void fillPipelineSelectPropertiesSupportStructure(PipelineSelectPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) const override;
|
void fillPipelineSelectPropertiesSupportStructure(PipelineSelectPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) const override;
|
||||||
void fillStateBaseAddressPropertiesSupportStructure(StateBaseAddressPropertiesSupport &propertiesSupport) const override;
|
void fillStateBaseAddressPropertiesSupportStructure(StateBaseAddressPropertiesSupport &propertiesSupport) const override;
|
||||||
|
void parseCcsMode(std::string ccsModeString, std::unordered_map<uint32_t, uint32_t> &rootDeviceNumCcsMap, uint32_t rootDeviceIndex, RootDeviceEnvironment *rootDeviceEnvironment) const override;
|
||||||
|
|
||||||
bool isFusedEuDisabledForDpas(bool kernelHasDpasInstructions, const uint32_t *lws, const uint32_t *groupCount, const HardwareInfo &hwInfo) const override;
|
bool isFusedEuDisabledForDpas(bool kernelHasDpasInstructions, const uint32_t *lws, const uint32_t *groupCount, const HardwareInfo &hwInfo) const override;
|
||||||
bool isCalculationForDisablingEuFusionWithDpasNeeded(const HardwareInfo &hwInfo) const override;
|
bool isCalculationForDisablingEuFusionWithDpasNeeded(const HardwareInfo &hwInfo) const override;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include "shared/source/execution_environment/root_device_environment.h"
|
#include "shared/source/execution_environment/root_device_environment.h"
|
||||||
#include "shared/source/helpers/definitions/indirect_detection_versions.h"
|
#include "shared/source/helpers/definitions/indirect_detection_versions.h"
|
||||||
|
#include "shared/source/helpers/string_helpers.h"
|
||||||
#include "shared/source/os_interface/product_helper_xe_hpg_and_xe_hpc.inl"
|
#include "shared/source/os_interface/product_helper_xe_hpg_and_xe_hpc.inl"
|
||||||
|
|
||||||
#include "aubstream/product_family.h"
|
#include "aubstream/product_family.h"
|
||||||
@@ -144,6 +145,25 @@ bool ProductHelperHw<gfxProduct>::isBlitCopyRequiredForLocalMemory(const RootDev
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
void ProductHelperHw<gfxProduct>::parseCcsMode(std::string ccsModeString, std::unordered_map<uint32_t, uint32_t> &rootDeviceNumCcsMap, uint32_t rootDeviceIndex, RootDeviceEnvironment *rootDeviceEnvironment) const {
|
||||||
|
|
||||||
|
auto numberOfCcsEntries = StringHelpers::split(ccsModeString, ",");
|
||||||
|
|
||||||
|
for (const auto &entry : numberOfCcsEntries) {
|
||||||
|
auto subEntries = StringHelpers::split(entry, ":");
|
||||||
|
uint32_t rootDeviceIndexParsed = StringHelpers::toUint32t(subEntries[0]);
|
||||||
|
|
||||||
|
if (rootDeviceIndexParsed == rootDeviceIndex) {
|
||||||
|
if (subEntries.size() > 1) {
|
||||||
|
uint32_t maxCcsCount = StringHelpers::toUint32t(subEntries[1]);
|
||||||
|
rootDeviceNumCcsMap.insert({rootDeviceIndex, maxCcsCount});
|
||||||
|
rootDeviceEnvironment->setNumberOfCcs(maxCcsCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
bool ProductHelperHw<gfxProduct>::isTlbFlushRequired() const {
|
bool ProductHelperHw<gfxProduct>::isTlbFlushRequired() const {
|
||||||
bool tlbFlushRequired = false;
|
bool tlbFlushRequired = false;
|
||||||
|
|||||||
@@ -672,7 +672,59 @@ TEST_F(DeviceTests, givenPreemptionModeWhenOverridePreemptionModeThenProperlySet
|
|||||||
EXPECT_EQ(newPreemptionMode, device->getPreemptionMode());
|
EXPECT_EQ(newPreemptionMode, device->getPreemptionMode());
|
||||||
}
|
}
|
||||||
|
|
||||||
HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZexNumberOfCssEnvVariableDefinedWhenDeviceIsCreatedThenCreateDevicesWithProperCcsCount) {
|
HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZexNumberOfCssEnvVariableDefinedForNonPvcWhenDeviceIsCreatedThenCreateDevicesWithProperCcsCount) {
|
||||||
|
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
||||||
|
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
||||||
|
DebugManagerStateRestore restorer;
|
||||||
|
|
||||||
|
debugManager.flags.ZEX_NUMBER_OF_CCS.set("1");
|
||||||
|
debugManager.flags.SetCommandStreamReceiver.set(1);
|
||||||
|
|
||||||
|
auto hwInfo = *defaultHwInfo;
|
||||||
|
|
||||||
|
MockExecutionEnvironment executionEnvironment(&hwInfo, false, 1);
|
||||||
|
executionEnvironment.incRefInternal();
|
||||||
|
UltDeviceFactory deviceFactory{1, 0, executionEnvironment};
|
||||||
|
|
||||||
|
{
|
||||||
|
auto hardwareInfo = executionEnvironment.rootDeviceEnvironments[0]->getMutableHardwareInfo();
|
||||||
|
hardwareInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled = defaultHwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled;
|
||||||
|
|
||||||
|
executionEnvironment.adjustCcsCount();
|
||||||
|
EXPECT_EQ(std::min(1u, defaultHwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled), hardwareInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenDeviceIsCreatedWithEmptyZexNumberOfCssEnvVariableAndHwInfoCcsCountIsModifiedWhenAdjustCcsCountForSpecificDeviceIsInvokedThenVerifyCcsCountIsAdjustedToOne) {
|
||||||
|
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
||||||
|
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
||||||
|
DebugManagerStateRestore restorer;
|
||||||
|
debugManager.flags.SetCommandStreamReceiver.set(1);
|
||||||
|
debugManager.flags.ZEX_NUMBER_OF_CCS.set("");
|
||||||
|
debugManager.flags.SetCommandStreamReceiver.set(1);
|
||||||
|
|
||||||
|
auto hwInfo = *defaultHwInfo;
|
||||||
|
|
||||||
|
MockExecutionEnvironment executionEnvironment(&hwInfo);
|
||||||
|
executionEnvironment.incRefInternal();
|
||||||
|
|
||||||
|
UltDeviceFactory deviceFactory{1, 0, executionEnvironment};
|
||||||
|
|
||||||
|
auto device = deviceFactory.rootDevices[0];
|
||||||
|
|
||||||
|
auto computeEngineGroupIndex = device->getEngineGroupIndexFromEngineGroupType(EngineGroupType::compute);
|
||||||
|
auto computeEngineGroup = device->getRegularEngineGroups()[computeEngineGroupIndex];
|
||||||
|
EXPECT_EQ(1u, computeEngineGroup.engines.size());
|
||||||
|
|
||||||
|
auto hardwareInfo = executionEnvironment.rootDeviceEnvironments[0]->getMutableHardwareInfo();
|
||||||
|
hardwareInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled = defaultHwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled;
|
||||||
|
|
||||||
|
executionEnvironment.adjustCcsCount();
|
||||||
|
EXPECT_EQ(1u, hardwareInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
HWCMDTEST_F(IGFX_XE_HPC_CORE, DeviceTests, givenZexNumberOfCssEnvVariableDefinedWhenDeviceIsCreatedThenCreateDevicesWithProperCcsCount) {
|
||||||
|
|
||||||
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
||||||
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
||||||
DebugManagerStateRestore restorer;
|
DebugManagerStateRestore restorer;
|
||||||
@@ -718,7 +770,32 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZexNumberOfCssEnvVariableDefinedW
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenDeviceIsCreatedWithZexNumberOfCssEnvVariableDefinedAndHwInfoCcsCountIsSetToDefaultWhenAdjustCcsCountForSpecificRootDeviceIsInvokedThenVerifyHwInfoCcsCountIsRestored) {
|
HWCMDTEST_F(IGFX_XE_HPC_CORE, DeviceTests, givenDeviceIsCreatedWithMalformedZexNumberOfCssEnvVariableDefinedAndHwInfoCcsCountIsSetToDefaultWhenAdjustCcsCountForSpecificRootDeviceIsInvokedThenVerifyHwInfoCcsCountIsSet) {
|
||||||
|
|
||||||
|
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
||||||
|
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
||||||
|
DebugManagerStateRestore restorer;
|
||||||
|
|
||||||
|
debugManager.flags.ZEX_NUMBER_OF_CCS.set("0:");
|
||||||
|
debugManager.flags.SetCommandStreamReceiver.set(1);
|
||||||
|
|
||||||
|
auto hwInfo = *defaultHwInfo;
|
||||||
|
|
||||||
|
MockExecutionEnvironment executionEnvironment(&hwInfo, false, 1);
|
||||||
|
executionEnvironment.incRefInternal();
|
||||||
|
|
||||||
|
UltDeviceFactory deviceFactory{1, 0, executionEnvironment};
|
||||||
|
{
|
||||||
|
auto hardwareInfo = executionEnvironment.rootDeviceEnvironments[0]->getMutableHardwareInfo();
|
||||||
|
hardwareInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled = defaultHwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled;
|
||||||
|
|
||||||
|
executionEnvironment.adjustCcsCount(0);
|
||||||
|
EXPECT_EQ(1u, hardwareInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HWCMDTEST_F(IGFX_XE_HPC_CORE, DeviceTests, givenDeviceIsCreatedWithZexNumberOfCssEnvVariableDefinedAndHwInfoCcsCountIsSetToDefaultWhenAdjustCcsCountForSpecificRootDeviceIsInvokedThenVerifyHwInfoCcsCountIsRestored) {
|
||||||
|
|
||||||
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
||||||
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
||||||
DebugManagerStateRestore restorer;
|
DebugManagerStateRestore restorer;
|
||||||
@@ -731,7 +808,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenDeviceIsCreatedWithZexNumberOfCss
|
|||||||
MockExecutionEnvironment executionEnvironment(&hwInfo, false, 2);
|
MockExecutionEnvironment executionEnvironment(&hwInfo, false, 2);
|
||||||
executionEnvironment.incRefInternal();
|
executionEnvironment.incRefInternal();
|
||||||
|
|
||||||
UltDeviceFactory deviceFactory{1, 0, executionEnvironment};
|
UltDeviceFactory deviceFactory{2, 0, executionEnvironment};
|
||||||
{
|
{
|
||||||
auto hardwareInfo = executionEnvironment.rootDeviceEnvironments[0]->getMutableHardwareInfo();
|
auto hardwareInfo = executionEnvironment.rootDeviceEnvironments[0]->getMutableHardwareInfo();
|
||||||
hardwareInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled = defaultHwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled;
|
hardwareInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled = defaultHwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled;
|
||||||
@@ -749,7 +826,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenDeviceIsCreatedWithZexNumberOfCss
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HWTEST2_F(DeviceTests, givenDeviceIsCreatedWithAmbiguousZexNumberOfCssEnvVariableAndHwInfoCcsCountIsModifiedWhenAdjustCcsCountForSpecificDeviceIsInvokedThenVerifyCcsCountIsAdjustedToOne, IsPVC) {
|
HWCMDTEST_F(IGFX_XE_HPC_CORE, DeviceTests, givenDeviceIsCreatedWithAmbiguousZexNumberOfCssEnvVariableAndHwInfoCcsCountIsModifiedWhenAdjustCcsCountForSpecificDeviceIsInvokedThenVerifyCcsCountIsAdjustedToOne) {
|
||||||
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
||||||
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
||||||
DebugManagerStateRestore restorer;
|
DebugManagerStateRestore restorer;
|
||||||
@@ -779,7 +856,8 @@ HWTEST2_F(DeviceTests, givenDeviceIsCreatedWithAmbiguousZexNumberOfCssEnvVariabl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZexNumberOfCssAndZeAffinityMaskSetWhenDeviceIsCreatedThenProperNumberOfCcsIsExposed) {
|
HWCMDTEST_F(IGFX_XE_HPC_CORE, DeviceTests, givenZexNumberOfCssAndZeAffinityMaskSetWhenDeviceIsCreatedThenProperNumberOfCcsIsExposed) {
|
||||||
|
|
||||||
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
||||||
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
||||||
DebugManagerStateRestore restorer;
|
DebugManagerStateRestore restorer;
|
||||||
@@ -806,7 +884,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZexNumberOfCssAndZeAffinityMaskSe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZeAffinityMaskSetAndTilesAsDevicesModelThenProperSubDeviceHierarchyMapisSet) {
|
HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZeAffinityMaskSetAndTilesAsDevicesModelForXeHpThenProperSubDeviceHierarchyMapisSet) {
|
||||||
std::unordered_map<std::string, std::string> mockableEnvs = {{"ZE_FLAT_DEVICE_HIERARCHY", "FLAT"}};
|
std::unordered_map<std::string, std::string> mockableEnvs = {{"ZE_FLAT_DEVICE_HIERARCHY", "FLAT"}};
|
||||||
VariableBackup<std::unordered_map<std::string, std::string> *> mockableEnvValuesBackup(&IoFunctions::mockableEnvValues, &mockableEnvs);
|
VariableBackup<std::unordered_map<std::string, std::string> *> mockableEnvValuesBackup(&IoFunctions::mockableEnvValues, &mockableEnvs);
|
||||||
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
||||||
@@ -845,7 +923,46 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZeAffinityMaskSetAndTilesAsDevice
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZeAffinityMaskSetThenProperSubDeviceHierarchyMapIsSet) {
|
HWCMDTEST_F(IGFX_XE_HPC_CORE, DeviceTests, givenZeAffinityMaskSetAndTilesAsDevicesModelThenProperSubDeviceHierarchyMapisSet) {
|
||||||
|
std::unordered_map<std::string, std::string> mockableEnvs = {{"ZE_FLAT_DEVICE_HIERARCHY", "FLAT"}};
|
||||||
|
VariableBackup<std::unordered_map<std::string, std::string> *> mockableEnvValuesBackup(&IoFunctions::mockableEnvValues, &mockableEnvs);
|
||||||
|
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
||||||
|
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
||||||
|
DebugManagerStateRestore restorer;
|
||||||
|
|
||||||
|
uint32_t numRootDevices = 4;
|
||||||
|
uint32_t numSubDevices = 4;
|
||||||
|
|
||||||
|
debugManager.flags.CreateMultipleRootDevices.set(numRootDevices);
|
||||||
|
debugManager.flags.CreateMultipleSubDevices.set(numSubDevices);
|
||||||
|
|
||||||
|
uint32_t expectedRootDevices = 4;
|
||||||
|
debugManager.flags.ZE_AFFINITY_MASK.set("0,3,4,1.1,9,15,25");
|
||||||
|
|
||||||
|
debugManager.flags.SetCommandStreamReceiver.set(1);
|
||||||
|
|
||||||
|
auto hwInfo = *defaultHwInfo;
|
||||||
|
|
||||||
|
MockExecutionEnvironment executionEnvironment(&hwInfo, false, numRootDevices);
|
||||||
|
executionEnvironment.incRefInternal();
|
||||||
|
|
||||||
|
auto devices = DeviceFactory::createDevices(executionEnvironment);
|
||||||
|
EXPECT_EQ(devices.size(), expectedRootDevices);
|
||||||
|
std::vector<uint32_t> expectedRootDeviceIndices = {0, 0, 1, 2};
|
||||||
|
std::vector<uint32_t> expectedSubDeviceIndices = {0, 3, 0, 1};
|
||||||
|
for (uint32_t i = 0u; i < devices.size(); i++) {
|
||||||
|
std::tuple<uint32_t, uint32_t, uint32_t> subDeviceMap;
|
||||||
|
EXPECT_TRUE(executionEnvironment.getSubDeviceHierarchy(i, &subDeviceMap));
|
||||||
|
auto hwRootDeviceIndex = std::get<0>(subDeviceMap);
|
||||||
|
auto hwSubDeviceIndex = std::get<1>(subDeviceMap);
|
||||||
|
auto hwSubDevicesCount = std::get<2>(subDeviceMap);
|
||||||
|
EXPECT_EQ(hwRootDeviceIndex, expectedRootDeviceIndices[i]);
|
||||||
|
EXPECT_EQ(hwSubDeviceIndex, expectedSubDeviceIndices[i]);
|
||||||
|
EXPECT_EQ(hwSubDevicesCount, numSubDevices);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HWCMDTEST_F(IGFX_XE_HPC_CORE, DeviceTests, givenZeAffinityMaskSetThenProperSubDeviceHierarchyMapIsSet) {
|
||||||
std::unordered_map<std::string, std::string> mockableEnvs = {{"ZE_FLAT_DEVICE_HIERARCHY", "COMPOSITE"}};
|
std::unordered_map<std::string, std::string> mockableEnvs = {{"ZE_FLAT_DEVICE_HIERARCHY", "COMPOSITE"}};
|
||||||
VariableBackup<std::unordered_map<std::string, std::string> *> mockableEnvValuesBackup(&IoFunctions::mockableEnvValues, &mockableEnvs);
|
VariableBackup<std::unordered_map<std::string, std::string> *> mockableEnvValuesBackup(&IoFunctions::mockableEnvValues, &mockableEnvs);
|
||||||
|
|
||||||
@@ -885,7 +1002,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZeAffinityMaskSetThenProperSubDev
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZeAffinityMaskSetWithoutTilesThenProperSubDeviceHierarchyMapisUnset) {
|
HWCMDTEST_F(IGFX_XE_HPC_CORE, DeviceTests, givenZeAffinityMaskSetWithoutTilesThenProperSubDeviceHierarchyMapisUnset) {
|
||||||
std::unordered_map<std::string, std::string> mockableEnvs = {{"ZE_FLAT_DEVICE_HIERARCHY", "COMPOSITE"}};
|
std::unordered_map<std::string, std::string> mockableEnvs = {{"ZE_FLAT_DEVICE_HIERARCHY", "COMPOSITE"}};
|
||||||
VariableBackup<std::unordered_map<std::string, std::string> *> mockableEnvValuesBackup(&IoFunctions::mockableEnvValues, &mockableEnvs);
|
VariableBackup<std::unordered_map<std::string, std::string> *> mockableEnvValuesBackup(&IoFunctions::mockableEnvValues, &mockableEnvs);
|
||||||
|
|
||||||
@@ -917,7 +1034,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZeAffinityMaskSetWithoutTilesThen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZeAffinityMaskSetWhenAllocateRTDispatchGlobalsIsCalledThenRTDispatchGlobalsIsAllocated) {
|
HWCMDTEST_F(IGFX_XE_HPC_CORE, DeviceTests, givenZeAffinityMaskSetWhenAllocateRTDispatchGlobalsIsCalledThenRTDispatchGlobalsIsAllocated) {
|
||||||
std::unordered_map<std::string, std::string> mockableEnvs = {{"ZE_FLAT_DEVICE_HIERARCHY", "COMPOSITE"}};
|
std::unordered_map<std::string, std::string> mockableEnvs = {{"ZE_FLAT_DEVICE_HIERARCHY", "COMPOSITE"}};
|
||||||
VariableBackup<std::unordered_map<std::string, std::string> *> mockableEnvValuesBackup(&IoFunctions::mockableEnvValues, &mockableEnvs);
|
VariableBackup<std::unordered_map<std::string, std::string> *> mockableEnvValuesBackup(&IoFunctions::mockableEnvValues, &mockableEnvs);
|
||||||
|
|
||||||
@@ -975,7 +1092,7 @@ TEST_F(DeviceTests, givenDifferentHierarchiesWithoutSubDevicesThenNumSubDevicesI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(DeviceTests, givenZeAffinityMaskSetWithDifferentHierarchiesThenNumSubDevicesIsCorrect) {
|
HWCMDTEST_F(IGFX_XE_HPC_CORE, DeviceTests, givenZeAffinityMaskSetWithDifferentHierarchiesThenNumSubDevicesIsCorrect) {
|
||||||
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
||||||
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
||||||
DebugManagerStateRestore restorer;
|
DebugManagerStateRestore restorer;
|
||||||
@@ -1015,7 +1132,7 @@ TEST_F(DeviceTests, givenZeAffinityMaskSetWithDifferentHierarchiesThenNumSubDevi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZexNumberOfCssEnvVariableIsLargerThanNumberOfAvailableCcsCountWhenDeviceIsCreatedThenCreateDevicesWithAvailableCcsCount) {
|
HWCMDTEST_F(IGFX_XE_HPC_CORE, DeviceTests, givenZexNumberOfCssEnvVariableIsLargerThanNumberOfAvailableCcsCountWhenDeviceIsCreatedThenCreateDevicesWithAvailableCcsCount) {
|
||||||
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
||||||
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
||||||
DebugManagerStateRestore restorer;
|
DebugManagerStateRestore restorer;
|
||||||
@@ -1037,7 +1154,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZexNumberOfCssEnvVariableIsLarger
|
|||||||
EXPECT_EQ(defaultHwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled, computeEngineGroup.engines.size());
|
EXPECT_EQ(defaultHwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled, computeEngineGroup.engines.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZexNumberOfCssEnvVariableSetAmbigouslyWhenDeviceIsCreatedThenDontApplyAnyLimitations) {
|
HWCMDTEST_F(IGFX_XE_HPC_CORE, DeviceTests, givenZexNumberOfCssEnvVariableSetAmbigouslyWhenDeviceIsCreatedThenDontApplyAnyLimitations) {
|
||||||
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
||||||
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
||||||
DebugManagerStateRestore restorer;
|
DebugManagerStateRestore restorer;
|
||||||
|
|||||||
Reference in New Issue
Block a user