Move pvc helpers to pvc files

Related-To: NEO-6631
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2022-03-09 15:39:57 +00:00
committed by Compute-Runtime-Automation
parent 3490b489ad
commit 7d6bee26c7
20 changed files with 499 additions and 240 deletions

View File

@@ -86,6 +86,15 @@ class HwInfoConfig {
virtual bool getUuid(Device *device, std::array<uint8_t, HwInfoConfig::uuidSize> &uuid) const = 0;
virtual bool isFlushTaskAllowed() const = 0;
virtual bool programAllStateComputeCommandFields() const = 0;
virtual bool isSpecialPipelineSelectModeChanged(const HardwareInfo &hwInfo) const = 0;
virtual bool isSystolicModeConfigurable(const HardwareInfo &hwInfo) const = 0;
virtual bool isGlobalFenceAsPostSyncOperationInComputeWalkerRequired(const HardwareInfo &hwInfo) const = 0;
virtual bool isComputeDispatchAllWalkerEnableInComputeWalkerRequired(const HardwareInfo &hwInfo) const = 0;
virtual bool isGlobalFenceAsMiMemFenceCommandInCommandStreamRequired(const HardwareInfo &hwInfo) const = 0;
virtual bool isAdjustProgrammableIdPreferredSlmSizeRequired(const HardwareInfo &hwInfo) const = 0;
virtual bool isThreaEuRatio16ForScratchRequired(const HardwareInfo &hwInfo) const = 0;
virtual bool isComputeDispatchAllWalkerEnableInCfeStateRequired(const HardwareInfo &hwInfo) const = 0;
MOCKABLE_VIRTUAL ~HwInfoConfig() = default;
protected:
@@ -156,6 +165,14 @@ class HwInfoConfigHw : public HwInfoConfig {
bool getUuid(Device *device, std::array<uint8_t, HwInfoConfig::uuidSize> &uuid) const override;
bool isFlushTaskAllowed() const override;
bool programAllStateComputeCommandFields() const override;
bool isSpecialPipelineSelectModeChanged(const HardwareInfo &hwInfo) const override;
bool isSystolicModeConfigurable(const HardwareInfo &hwInfo) const override;
bool isGlobalFenceAsPostSyncOperationInComputeWalkerRequired(const HardwareInfo &hwInfo) const override;
bool isComputeDispatchAllWalkerEnableInComputeWalkerRequired(const HardwareInfo &hwInfo) const override;
bool isGlobalFenceAsMiMemFenceCommandInCommandStreamRequired(const HardwareInfo &hwInfo) const override;
bool isAdjustProgrammableIdPreferredSlmSizeRequired(const HardwareInfo &hwInfo) const override;
bool isThreaEuRatio16ForScratchRequired(const HardwareInfo &hwInfo) const override;
bool isComputeDispatchAllWalkerEnableInCfeStateRequired(const HardwareInfo &hwInfo) const override;
protected:
HwInfoConfigHw() = default;

View File

@@ -298,4 +298,44 @@ bool HwInfoConfigHw<gfxProduct>::programAllStateComputeCommandFields() const {
return false;
}
template <PRODUCT_FAMILY gfxProduct>
bool HwInfoConfigHw<gfxProduct>::isSpecialPipelineSelectModeChanged(const HardwareInfo &hwInfo) const {
return false;
}
template <PRODUCT_FAMILY gfxProduct>
bool HwInfoConfigHw<gfxProduct>::isSystolicModeConfigurable(const HardwareInfo &hwInfo) const {
return false;
}
template <PRODUCT_FAMILY gfxProduct>
bool HwInfoConfigHw<gfxProduct>::isGlobalFenceAsPostSyncOperationInComputeWalkerRequired(const HardwareInfo &hwInfo) const {
return false;
}
template <PRODUCT_FAMILY gfxProduct>
bool HwInfoConfigHw<gfxProduct>::isComputeDispatchAllWalkerEnableInComputeWalkerRequired(const HardwareInfo &hwInfo) const {
return false;
}
template <PRODUCT_FAMILY gfxProduct>
bool HwInfoConfigHw<gfxProduct>::isGlobalFenceAsMiMemFenceCommandInCommandStreamRequired(const HardwareInfo &hwInfo) const {
return false;
}
template <PRODUCT_FAMILY gfxProduct>
bool HwInfoConfigHw<gfxProduct>::isAdjustProgrammableIdPreferredSlmSizeRequired(const HardwareInfo &hwInfo) const {
return false;
}
template <PRODUCT_FAMILY gfxProduct>
bool HwInfoConfigHw<gfxProduct>::isThreaEuRatio16ForScratchRequired(const HardwareInfo &hwInfo) const {
return false;
}
template <PRODUCT_FAMILY gfxProduct>
bool HwInfoConfigHw<gfxProduct>::isComputeDispatchAllWalkerEnableInCfeStateRequired(const HardwareInfo &hwInfo) const {
return false;
}
} // namespace NEO

View File

@@ -175,7 +175,9 @@ void EncodeDispatchKernel<Family>::programBarrierEnable(INTERFACE_DESCRIPTOR_DAT
template <>
void EncodeDispatchKernel<Family>::encodeAdditionalWalkerFields(const HardwareInfo &hwInfo, WALKER_TYPE &walkerCmd, KernelExecutionType kernelExecutionType) {
auto programGlobalFenceAsPostSyncOperationInComputeWalker = !Family::isXlA0(hwInfo);
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
auto programGlobalFenceAsPostSyncOperationInComputeWalker = hwInfoConfig.isGlobalFenceAsPostSyncOperationInComputeWalkerRequired(hwInfo);
if (DebugManager.flags.ProgramGlobalFenceAsPostSyncOperationInComputeWalker.get() != -1) {
programGlobalFenceAsPostSyncOperationInComputeWalker = !!DebugManager.flags.ProgramGlobalFenceAsPostSyncOperationInComputeWalker.get();
}
@@ -188,7 +190,7 @@ void EncodeDispatchKernel<Family>::encodeAdditionalWalkerFields(const HardwareIn
walkerCmd.setL3PrefetchDisable(!DebugManager.flags.ForceL3PrefetchForComputeWalker.get());
}
auto programComputeDispatchAllWalkerEnableInComputeWalker = Family::isXtTemporary(hwInfo);
auto programComputeDispatchAllWalkerEnableInComputeWalker = hwInfoConfig.isComputeDispatchAllWalkerEnableInComputeWalkerRequired(hwInfo);
if (programComputeDispatchAllWalkerEnableInComputeWalker) {
if (kernelExecutionType == KernelExecutionType::Concurrent) {
walkerCmd.setComputeDispatchAllWalkerEnable(true);
@@ -240,7 +242,9 @@ void EncodeDispatchKernel<Family>::appendAdditionalIDDFields(INTERFACE_DESCRIPTO
}
}
if ((slmSize == 0) && (Family::isXlA0(hwInfo))) {
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
if ((slmSize == 0) && (hwInfoConfig.isAdjustProgrammableIdPreferredSlmSizeRequired(hwInfo))) {
programmableIdPreferredSlmSize = PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_16K;
}

View File

@@ -38,24 +38,6 @@ struct XE_HPC_CORE {
static constexpr bool supportsSampler = false;
static constexpr bool isUsingGenericMediaStateClear = true;
static bool isPvc(const HardwareInfo &hwInfo) {
return hwInfo.platform.eProductFamily == IGFX_PVC;
}
static bool isXlA0(const HardwareInfo &hwInfo) {
auto revId = hwInfo.platform.usRevId & pvcSteppingBits;
return (revId < 0x3) && !isXtTemporary(hwInfo);
}
static bool isAtMostXtA0(const HardwareInfo &hwInfo) {
auto revId = hwInfo.platform.usRevId & pvcSteppingBits;
return (revId <= 0x3) && !isXtTemporary(hwInfo);
}
static bool isXtTemporary(const HardwareInfo &hwInfo) {
return (hwInfo.platform.usDeviceID == pvcXtTemporaryDeviceId) || !isPvc(hwInfo);
}
struct DataPortBindlessSurfaceExtendedMessageDescriptor {
union {
struct {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -26,6 +26,9 @@ struct PVC : public XE_HPC_COREFamily {
static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo);
static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, bool setupMultiTile);
static void adjustHardwareInfo(HardwareInfo *hwInfo);
static bool isXlA0(const HardwareInfo &hwInfo);
static bool isAtMostXtA0(const HardwareInfo &hwInfo);
static bool isXtTemporary(const HardwareInfo &hwInfo);
};
class PVC_CONFIG : public PVC {

View File

@@ -172,7 +172,8 @@ size_t HwHelperHw<Family>::getPaddingForISAAllocation() const {
template <>
size_t MemorySynchronizationCommands<Family>::getSizeForSingleAdditionalSynchronization(const HardwareInfo &hwInfo) {
auto programGlobalFenceAsMiMemFenceCommandInCommandStream = !Family::isXlA0(hwInfo);
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
auto programGlobalFenceAsMiMemFenceCommandInCommandStream = hwInfoConfig.isGlobalFenceAsMiMemFenceCommandInCommandStreamRequired(hwInfo);
if (DebugManager.flags.ProgramGlobalFenceAsMiMemFenceCommandInCommandStream.get() != -1) {
programGlobalFenceAsMiMemFenceCommandInCommandStream = !!DebugManager.flags.ProgramGlobalFenceAsMiMemFenceCommandInCommandStream.get();
}
@@ -188,7 +189,9 @@ template <>
void MemorySynchronizationCommands<Family>::setAdditionalSynchronization(void *&commandsBuffer, uint64_t gpuAddress, const HardwareInfo &hwInfo) {
using MI_MEM_FENCE = typename Family::MI_MEM_FENCE;
using MI_SEMAPHORE_WAIT = typename Family::MI_SEMAPHORE_WAIT;
auto programGlobalFenceAsMiMemFenceCommandInCommandStream = !Family::isXlA0(hwInfo);
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
auto programGlobalFenceAsMiMemFenceCommandInCommandStream = hwInfoConfig.isGlobalFenceAsMiMemFenceCommandInCommandStreamRequired(hwInfo);
if (DebugManager.flags.ProgramGlobalFenceAsMiMemFenceCommandInCommandStream.get() != -1) {
programGlobalFenceAsMiMemFenceCommandInCommandStream = !!DebugManager.flags.ProgramGlobalFenceAsMiMemFenceCommandInCommandStream.get();
}
@@ -410,8 +413,9 @@ uint32_t HwHelperHw<Family>::getComputeUnitsUsedForScratch(const HardwareInfo *p
return static_cast<uint32_t>(DebugManager.flags.OverrideNumComputeUnitsForScratch.get());
}
const auto &hwInfoConfig = *HwInfoConfig::get(pHwInfo->platform.eProductFamily);
auto revId = pHwInfo->platform.usRevId & Family::pvcSteppingBits;
uint32_t threadEuRatio = ((0x3 <= revId) && !Family::isXtTemporary(*pHwInfo)) ? 16 : 8;
uint32_t threadEuRatio = ((0x3 <= revId) && hwInfoConfig.isThreaEuRatio16ForScratchRequired(*pHwInfo)) ? 16 : 8;
return pHwInfo->gtSystemInfo.MaxSubSlicesSupported * pHwInfo->gtSystemInfo.MaxEuPerSubSlice * threadEuRatio;
}

View File

@@ -139,6 +139,21 @@ void PVC::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) {
void PVC::adjustHardwareInfo(HardwareInfo *hwInfo) {
hwInfo->capabilityTable.sharedSystemMemCapabilities = (UNIFIED_SHARED_MEMORY_ACCESS | UNIFIED_SHARED_MEMORY_CONCURRENT_ACCESS | UNIFIED_SHARED_MEMORY_CONCURRENT_ATOMIC_ACCESS);
}
bool PVC::isXlA0(const HardwareInfo &hwInfo) {
auto revId = hwInfo.platform.usRevId & pvcSteppingBits;
return (revId < 0x3) && !isXtTemporary(hwInfo);
}
bool PVC::isAtMostXtA0(const HardwareInfo &hwInfo) {
auto revId = hwInfo.platform.usRevId & pvcSteppingBits;
return (revId <= 0x3) && !isXtTemporary(hwInfo);
}
bool PVC::isXtTemporary(const HardwareInfo &hwInfo) {
return (hwInfo.platform.usDeviceID == pvcXtTemporaryDeviceId);
}
void PVC::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, bool setupMultiTile) {
GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo;
gtSysInfo->ThreadCount = gtSysInfo->EUCount * PVC::threadsPerEu;

View File

@@ -120,4 +120,44 @@ bool HwInfoConfigHw<gfxProduct>::isDcFlushAllowed() const {
template <>
bool HwInfoConfigHw<gfxProduct>::isFlushTaskAllowed() const {
return true;
}
template <>
bool HwInfoConfigHw<gfxProduct>::isSpecialPipelineSelectModeChanged(const HardwareInfo &hwInfo) const {
return PVC::isAtMostXtA0(hwInfo);
}
template <>
bool HwInfoConfigHw<gfxProduct>::isSystolicModeConfigurable(const HardwareInfo &hwInfo) const {
return PVC::isAtMostXtA0(hwInfo);
}
template <>
bool HwInfoConfigHw<gfxProduct>::isGlobalFenceAsPostSyncOperationInComputeWalkerRequired(const HardwareInfo &hwInfo) const {
return !PVC::isXlA0(hwInfo);
}
template <>
bool HwInfoConfigHw<gfxProduct>::isComputeDispatchAllWalkerEnableInComputeWalkerRequired(const HardwareInfo &hwInfo) const {
return PVC::isXtTemporary(hwInfo);
}
template <>
bool HwInfoConfigHw<gfxProduct>::isGlobalFenceAsMiMemFenceCommandInCommandStreamRequired(const HardwareInfo &hwInfo) const {
return !PVC::isXlA0(hwInfo);
}
template <>
bool HwInfoConfigHw<gfxProduct>::isAdjustProgrammableIdPreferredSlmSizeRequired(const HardwareInfo &hwInfo) const {
return PVC::isXlA0(hwInfo);
}
template <>
bool HwInfoConfigHw<gfxProduct>::isThreaEuRatio16ForScratchRequired(const HardwareInfo &hwInfo) const {
return !PVC::isXtTemporary(hwInfo);
}
template <>
bool HwInfoConfigHw<gfxProduct>::isComputeDispatchAllWalkerEnableInCfeStateRequired(const HardwareInfo &hwInfo) const {
return !PVC::isXtTemporary(hwInfo);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -24,8 +24,10 @@ void PreambleHelper<Family>::appendProgramVFEState(const HardwareInfo &hwInfo, c
command->setComputeOverdispatchDisable(streamProperties.frontEndState.disableOverdispatch.value == 1);
command->setSingleSliceDispatchCcsMode(streamProperties.frontEndState.singleSliceDispatchCcsMode.value == 1);
if (HwInfoConfig::get(hwInfo.platform.eProductFamily)->getSteppingFromHwRevId(hwInfo) >= REVISION_B) {
const auto programComputeDispatchAllWalkerEnableInCfeState = !Family::isXtTemporary(hwInfo);
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
if (hwInfoConfig.getSteppingFromHwRevId(hwInfo) >= REVISION_B) {
const auto programComputeDispatchAllWalkerEnableInCfeState = hwInfoConfig.isComputeDispatchAllWalkerEnableInCfeStateRequired(hwInfo);
if (programComputeDispatchAllWalkerEnableInCfeState && streamProperties.frontEndState.computeDispatchAllWalkerEnable.value > 0) {
command->setComputeDispatchAllWalkerEnable(true);
command->setSingleSliceDispatchCcsMode(true);
@@ -51,13 +53,16 @@ void PreambleHelper<Family>::appendProgramVFEState(const HardwareInfo &hwInfo, c
template <>
bool PreambleHelper<Family>::isSystolicModeConfigurable(const HardwareInfo &hwInfo) {
return Family::isAtMostXtA0(hwInfo);
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
return hwInfoConfig.isSystolicModeConfigurable(hwInfo);
}
template <>
bool PreambleHelper<Family>::isSpecialPipelineSelectModeChanged(bool lastSpecialPipelineSelectMode, bool newSpecialPipelineSelectMode,
const HardwareInfo &hwInfo) {
return (lastSpecialPipelineSelectMode != newSpecialPipelineSelectMode) && Family::isAtMostXtA0(hwInfo);
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
return (lastSpecialPipelineSelectMode != newSpecialPipelineSelectMode) && hwInfoConfig.isSpecialPipelineSelectModeChanged(hwInfo);
}
template struct PreambleHelper<Family>;

View File

@@ -1,5 +1,5 @@
#
# Copyright (C) 2019-2021 Intel Corporation
# Copyright (C) 2019-2022 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
@@ -30,6 +30,7 @@ set(NEO_CORE_HELPERS_TESTS
${CMAKE_CURRENT_SOURCE_DIR}/simd_helper_tests.inl
${CMAKE_CURRENT_SOURCE_DIR}/string_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/string_to_hash_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_traits.h
${CMAKE_CURRENT_SOURCE_DIR}/test_traits_platforms.h
${CMAKE_CURRENT_SOURCE_DIR}/includes${BRANCH_DIR_SUFFIX}test_traits_common.h

View File

@@ -0,0 +1,54 @@
/*
* Copyright (C) 2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/test/common/fixtures/device_fixture.h"
#include "shared/test/common/test_macros/test.h"
using namespace NEO;
using HwInfoConfigTest = Test<DeviceFixture>;
HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenIsAdjustProgrammableIdPreferredSlmSizeRequiredThenFalseIsReturned) {
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
EXPECT_FALSE(hwInfoConfig.isAdjustProgrammableIdPreferredSlmSizeRequired(*defaultHwInfo));
}
HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenIsComputeDispatchAllWalkerEnableInCfeStateRequiredThenFalseIsReturned) {
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
EXPECT_FALSE(hwInfoConfig.isComputeDispatchAllWalkerEnableInCfeStateRequired(*defaultHwInfo));
}
HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenIsComputeDispatchAllWalkerEnableInComputeWalkerRequiredThenFalseIsReturned) {
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
EXPECT_FALSE(hwInfoConfig.isComputeDispatchAllWalkerEnableInComputeWalkerRequired(*defaultHwInfo));
}
HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenIsGlobalFenceAsMiMemFenceCommandInCommandStreamRequiredThenFalseIsReturned) {
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
EXPECT_FALSE(hwInfoConfig.isGlobalFenceAsMiMemFenceCommandInCommandStreamRequired(*defaultHwInfo));
}
HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenIsGlobalFenceAsPostSyncOperationInComputeWalkerRequiredThenFalseIsReturned) {
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
EXPECT_FALSE(hwInfoConfig.isGlobalFenceAsPostSyncOperationInComputeWalkerRequired(*defaultHwInfo));
}
HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenIsSpecialPipelineSelectModeChangedThenFalseIsReturned) {
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
EXPECT_FALSE(hwInfoConfig.isSpecialPipelineSelectModeChanged(*defaultHwInfo));
}
HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenIsSystolicModeConfigurabledThenFalseIsReturned) {
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
EXPECT_FALSE(hwInfoConfig.isSystolicModeConfigurable(*defaultHwInfo));
}
HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenIsThreaEuRatio16ForScratchRequiredThenFalseIsReturned) {
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
EXPECT_FALSE(hwInfoConfig.isThreaEuRatio16ForScratchRequired(*defaultHwInfo));
}

View File

@@ -287,4 +287,44 @@ bool HwInfoConfigHw<IGFX_UNKNOWN>::programAllStateComputeCommandFields() const {
return false;
}
template <>
bool HwInfoConfigHw<IGFX_UNKNOWN>::isSpecialPipelineSelectModeChanged(const HardwareInfo &hwInfo) const {
return false;
}
template <>
bool HwInfoConfigHw<IGFX_UNKNOWN>::isSystolicModeConfigurable(const HardwareInfo &hwInfo) const {
return false;
}
template <>
bool HwInfoConfigHw<IGFX_UNKNOWN>::isGlobalFenceAsPostSyncOperationInComputeWalkerRequired(const HardwareInfo &hwInfo) const {
return false;
}
template <>
bool HwInfoConfigHw<IGFX_UNKNOWN>::isComputeDispatchAllWalkerEnableInComputeWalkerRequired(const HardwareInfo &hwInfo) const {
return false;
}
template <>
bool HwInfoConfigHw<IGFX_UNKNOWN>::isGlobalFenceAsMiMemFenceCommandInCommandStreamRequired(const HardwareInfo &hwInfo) const {
return false;
}
template <>
bool HwInfoConfigHw<IGFX_UNKNOWN>::isAdjustProgrammableIdPreferredSlmSizeRequired(const HardwareInfo &hwInfo) const {
return false;
}
template <>
bool HwInfoConfigHw<IGFX_UNKNOWN>::isThreaEuRatio16ForScratchRequired(const HardwareInfo &hwInfo) const {
return false;
}
template <>
bool HwInfoConfigHw<IGFX_UNKNOWN>::isComputeDispatchAllWalkerEnableInCfeStateRequired(const HardwareInfo &hwInfo) const {
return false;
}
} //namespace NEO

View File

@@ -22,3 +22,11 @@ HWTEST_EXCLUDE_PRODUCT(ComputeModeRequirements, givenComputeModeProgrammingWhenL
HWTEST_EXCLUDE_PRODUCT(ComputeModeRequirements, givenComputeModeProgrammingWhenRequiredGRFNumberIsLowerThan128ThenSmallGRFModeIsProgrammed_ForceNonCoherentSupportedMatcher, IGFX_XE_HPC_CORE);
HWTEST_EXCLUDE_PRODUCT(ComputeModeRequirements, givenComputeModeProgrammingWhenRequiredGRFNumberIsGreaterThan128ThenLargeGRFModeIsProgrammed_ForceNonCoherentSupportedMatcher, IGFX_XE_HPC_CORE);
HWTEST_EXCLUDE_PRODUCT(BlitTests, givenXyCopyBltCommandWhenAppendBlitCommandsMemCopyIsCalledThenNothingChanged, IGFX_XE_HPC_CORE);
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenIsAdjustProgrammableIdPreferredSlmSizeRequiredThenFalseIsReturned, IGFX_XE_HPC_CORE);
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenIsComputeDispatchAllWalkerEnableInCfeStateRequiredThenFalseIsReturned, IGFX_XE_HPC_CORE);
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenIsComputeDispatchAllWalkerEnableInComputeWalkerRequiredThenFalseIsReturned, IGFX_XE_HPC_CORE);
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenIsGlobalFenceAsMiMemFenceCommandInCommandStreamRequiredThenFalseIsReturned, IGFX_XE_HPC_CORE);
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenIsGlobalFenceAsPostSyncOperationInComputeWalkerRequiredThenFalseIsReturned, IGFX_XE_HPC_CORE);
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenIsSpecialPipelineSelectModeChangedThenFalseIsReturned, IGFX_XE_HPC_CORE);
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenIsSystolicModeConfigurabledThenFalseIsReturned, IGFX_XE_HPC_CORE);
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenIsThreaEuRatio16ForScratchRequiredThenFalseIsReturned, IGFX_XE_HPC_CORE);

View File

@@ -1,5 +1,5 @@
#
# Copyright (C) 2021 Intel Corporation
# Copyright (C) 2021-2022 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
@@ -8,6 +8,8 @@ if(TESTS_PVC)
set(NEO_CORE_TESTS_XE_HPC_CORE_PVC
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/test_encode_dispatch_kernel_pvc.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_preamble_pvc.cpp
)
target_sources(${TARGET_NAME} PRIVATE ${NEO_CORE_TESTS_XE_HPC_CORE_PVC})

View File

@@ -0,0 +1,105 @@
/*
* Copyright (C) 2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/command_stream/stream_properties.h"
#include "shared/source/helpers/hw_helper.h"
#include "shared/source/os_interface/device_factory.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/unit_test/preamble/preamble_fixture.h"
using namespace NEO;
using PreambleCfeState = PreambleFixture;
PVCTEST_F(PreambleCfeState, givenXeHpcAndKernelExecutionTypeAndRevisionWhenCallingProgramVFEStateThenCFEStateParamsAreCorrectlySet) {
using CFE_STATE = typename FamilyType::CFE_STATE;
auto hwInfo = pDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo->platform.eProductFamily);
auto pVfeCmd = PreambleHelper<FamilyType>::getSpaceForVfeState(&linearStream, *hwInfo, EngineGroupType::RenderCompute);
StreamProperties streamProperties{};
std::array<std::pair<uint32_t, bool>, 4> revisions = {
{{REVISION_A0, false},
{REVISION_A0, true},
{REVISION_B, false},
{REVISION_B, true}}};
for (const auto &[revision, kernelExecutionType] : revisions) {
hwInfo->platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(revision, *hwInfo);
streamProperties.frontEndState.setProperties(kernelExecutionType, false, false, false, *hwInfo);
PreambleHelper<FamilyType>::programVfeState(pVfeCmd, *hwInfo, 0u, 0, 0, streamProperties);
parseCommands<FamilyType>(linearStream);
auto cfeStateIt = find<CFE_STATE *>(cmdList.begin(), cmdList.end());
ASSERT_NE(cmdList.end(), cfeStateIt);
auto cfeState = reinterpret_cast<CFE_STATE *>(*cfeStateIt);
auto expectedValue = (HwInfoConfig::get(hwInfo->platform.eProductFamily)->getSteppingFromHwRevId(*hwInfo) >= REVISION_B) &&
(!PVC::isXtTemporary(*defaultHwInfo)) &&
kernelExecutionType;
EXPECT_EQ(expectedValue, cfeState->getComputeDispatchAllWalkerEnable());
EXPECT_EQ(expectedValue, cfeState->getSingleSliceDispatchCcsMode());
EXPECT_FALSE(cfeState->getComputeOverdispatchDisable());
}
}
PVCTEST_F(PreambleCfeState, givenPvcXtTemporaryAndKernelExecutionTypeConcurrentAndRevisionBWhenCallingProgramVFEStateThenAllWalkerIsDisabled) {
using CFE_STATE = typename FamilyType::CFE_STATE;
auto hwInfo = *defaultHwInfo;
hwInfo.platform.usDeviceID = 0x0BE5;
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, hwInfo);
auto pVfeCmd = PreambleHelper<FamilyType>::getSpaceForVfeState(&linearStream, hwInfo, EngineGroupType::RenderCompute);
StreamProperties streamProperties{};
streamProperties.frontEndState.setProperties(true, false, false, false, hwInfo);
PreambleHelper<FamilyType>::programVfeState(pVfeCmd, hwInfo, 0u, 0, 0, streamProperties);
parseCommands<FamilyType>(linearStream);
auto cfeStateIt = find<CFE_STATE *>(cmdList.begin(), cmdList.end());
ASSERT_NE(cmdList.end(), cfeStateIt);
auto cfeState = reinterpret_cast<CFE_STATE *>(*cfeStateIt);
EXPECT_FALSE(cfeState->getComputeDispatchAllWalkerEnable());
EXPECT_FALSE(cfeState->getSingleSliceDispatchCcsMode());
}
using PreamblePipelineSelectState = PreambleFixture;
PVCTEST_F(PreamblePipelineSelectState, givenRevisionBAndAboveWhenCallingProgramPipelineSelectThenSystolicModeDisabled) {
using PIPELINE_SELECT = typename FamilyType::PIPELINE_SELECT;
auto hwInfo = pDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
PipelineSelectArgs pipelineArgs;
pipelineArgs.specialPipelineSelectMode = true;
struct {
unsigned short revId;
bool expectedValue;
} testInputs[] = {
{0x0, true},
{0x1, true},
{0x3, true},
{0x5, false},
{0x6, false},
{0x7, false},
};
for (auto &testInput : testInputs) {
LinearStream linearStream(&gfxAllocation);
hwInfo->platform.usRevId = testInput.revId;
PreambleHelper<FamilyType>::programPipelineSelect(&linearStream, pipelineArgs, *hwInfo);
parseCommands<FamilyType>(linearStream);
auto itorCmd = find<PIPELINE_SELECT *>(cmdList.begin(), cmdList.end());
ASSERT_NE(itorCmd, cmdList.end());
auto cmd = genCmdCast<PIPELINE_SELECT *>(*itorCmd);
EXPECT_EQ(testInput.expectedValue, cmd->getSystolicModeEnable());
}
}

View File

@@ -5,10 +5,12 @@
*
*/
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/xe_hpc_core/hw_info.h"
#include "shared/test/common/helpers/unit_test_helper.h"
#include "shared/test/common/helpers/unit_test_helper.inl"
#include "shared/test/common/helpers/unit_test_helper_xehp_and_later.inl"
using Family = NEO::XE_HPC_COREFamily;
namespace NEO {
@@ -54,7 +56,8 @@ bool UnitTestHelper<Family>::isAdditionalSynchronizationRequired() {
template <>
bool UnitTestHelper<Family>::isAdditionalMiSemaphoreWaitRequired(const HardwareInfo &hwInfo) {
auto programGlobalFenceAsMiMemFenceCommandInCommandStream = !Family::isXlA0(hwInfo);
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
auto programGlobalFenceAsMiMemFenceCommandInCommandStream = hwInfoConfig.isGlobalFenceAsMiMemFenceCommandInCommandStreamRequired(hwInfo);
if (DebugManager.flags.ProgramGlobalFenceAsMiMemFenceCommandInCommandStream.get() != -1) {
programGlobalFenceAsMiMemFenceCommandInCommandStream = !!DebugManager.flags.ProgramGlobalFenceAsMiMemFenceCommandInCommandStream.get();
}

View File

@@ -16,68 +16,6 @@ using namespace NEO;
using PreambleCfeState = PreambleFixture;
XE_HPC_CORETEST_F(PreambleCfeState, givenXeHpcAndKernelExecutionTypeAndRevisionWhenCallingProgramVFEStateThenCFEStateParamsAreCorrectlySet) {
using CFE_STATE = typename FamilyType::CFE_STATE;
auto hwInfo = pDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
if (hwInfo->platform.eProductFamily != IGFX_PVC) {
GTEST_SKIP();
}
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo->platform.eProductFamily);
auto pVfeCmd = PreambleHelper<FamilyType>::getSpaceForVfeState(&linearStream, *hwInfo, EngineGroupType::RenderCompute);
StreamProperties streamProperties{};
std::array<std::pair<uint32_t, bool>, 4> revisions = {
{{REVISION_A0, false},
{REVISION_A0, true},
{REVISION_B, false},
{REVISION_B, true}}};
for (const auto &[revision, kernelExecutionType] : revisions) {
hwInfo->platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(revision, *hwInfo);
streamProperties.frontEndState.setProperties(kernelExecutionType, false, false, false, *hwInfo);
PreambleHelper<FamilyType>::programVfeState(pVfeCmd, *hwInfo, 0u, 0, 0, streamProperties);
parseCommands<FamilyType>(linearStream);
auto cfeStateIt = find<CFE_STATE *>(cmdList.begin(), cmdList.end());
ASSERT_NE(cmdList.end(), cfeStateIt);
auto cfeState = reinterpret_cast<CFE_STATE *>(*cfeStateIt);
auto expectedValue = (HwInfoConfig::get(hwInfo->platform.eProductFamily)->getSteppingFromHwRevId(*hwInfo) >= REVISION_B) &&
(!XE_HPC_CORE::isXtTemporary(*defaultHwInfo)) &&
kernelExecutionType;
EXPECT_EQ(expectedValue, cfeState->getComputeDispatchAllWalkerEnable());
EXPECT_EQ(expectedValue, cfeState->getSingleSliceDispatchCcsMode());
EXPECT_FALSE(cfeState->getComputeOverdispatchDisable());
}
}
XE_HPC_CORETEST_F(PreambleCfeState, givenPvcXtTemporaryAndKernelExecutionTypeConcurrentAndRevisionBWhenCallingProgramVFEStateThenAllWalkerIsDisabled) {
using CFE_STATE = typename FamilyType::CFE_STATE;
auto hwInfo = *defaultHwInfo;
hwInfo.platform.usDeviceID = 0x0BE5;
if (hwInfo.platform.eProductFamily != IGFX_PVC) {
GTEST_SKIP();
}
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, hwInfo);
auto pVfeCmd = PreambleHelper<FamilyType>::getSpaceForVfeState(&linearStream, hwInfo, EngineGroupType::RenderCompute);
StreamProperties streamProperties{};
streamProperties.frontEndState.setProperties(true, false, false, false, hwInfo);
PreambleHelper<FamilyType>::programVfeState(pVfeCmd, hwInfo, 0u, 0, 0, streamProperties);
parseCommands<FamilyType>(linearStream);
auto cfeStateIt = find<CFE_STATE *>(cmdList.begin(), cmdList.end());
ASSERT_NE(cmdList.end(), cfeStateIt);
auto cfeState = reinterpret_cast<CFE_STATE *>(*cfeStateIt);
EXPECT_FALSE(cfeState->getComputeDispatchAllWalkerEnable());
EXPECT_FALSE(cfeState->getSingleSliceDispatchCcsMode());
}
XE_HPC_CORETEST_F(PreambleCfeState, givenXeHpcCoreAndSetDebugFlagWhenPreambleCfeStateIsProgrammedThenCFEStateParamsHaveSetValue) {
using CFE_STATE = typename FamilyType::CFE_STATE;
DebugManagerStateRestore dbgRestore;
@@ -155,40 +93,3 @@ XE_HPC_CORETEST_F(PreambleCfeState, givenSetDebugFlagWhenPreambleCfeStateIsProgr
EXPECT_EQ(expectedValue2, cfeState->getNumberOfWalkers());
EXPECT_EQ(expectedValue2, cfeState->getMaximumNumberOfThreads());
}
using PreamblePipelineSelectState = PreambleFixture;
XE_HPC_CORETEST_F(PreamblePipelineSelectState, givenRevisionBAndAboveWhenCallingProgramPipelineSelectThenSystolicModeDisabled) {
using PIPELINE_SELECT = typename FamilyType::PIPELINE_SELECT;
auto hwInfo = pDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
if (hwInfo->platform.eProductFamily != IGFX_PVC) {
GTEST_SKIP();
}
PipelineSelectArgs pipelineArgs;
pipelineArgs.specialPipelineSelectMode = true;
struct {
unsigned short revId;
bool expectedValue;
} testInputs[] = {
{0x0, true},
{0x1, true},
{0x3, true},
{0x5, false},
{0x6, false},
{0x7, false},
};
for (auto &testInput : testInputs) {
LinearStream linearStream(&gfxAllocation);
hwInfo->platform.usRevId = testInput.revId;
PreambleHelper<FamilyType>::programPipelineSelect(&linearStream, pipelineArgs, *hwInfo);
parseCommands<FamilyType>(linearStream);
auto itorCmd = find<PIPELINE_SELECT *>(cmdList.begin(), cmdList.end());
ASSERT_NE(itorCmd, cmdList.end());
auto cmd = genCmdCast<PIPELINE_SELECT *>(*itorCmd);
EXPECT_EQ(testInput.expectedValue, cmd->getSystolicModeEnable());
}
}