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

@ -0,0 +1,12 @@
#
# Copyright (C) 2022 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(TESTS_PVC)
target_sources(${TARGET_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/test_cmdqueue_pvc.cpp
)
endif()

View File

@ -0,0 +1,131 @@
/*
* Copyright (C) 2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/mocks/mock_command_stream_receiver.h"
#include "shared/test/common/test_macros/test.h"
#include "level_zero/core/source/driver/driver_handle_imp.h"
#include "level_zero/core/test/unit_tests/fixtures/device_fixture.h"
#include "level_zero/core/test/unit_tests/mocks/mock_built_ins.h"
#include "level_zero/core/test/unit_tests/mocks/mock_cmdlist.h"
#include "level_zero/core/test/unit_tests/mocks/mock_cmdqueue.h"
#include "level_zero/core/test/unit_tests/mocks/mock_kernel.h"
#include "level_zero/core/test/unit_tests/mocks/mock_module.h"
namespace L0 {
namespace ult {
using CommandQueueCommandsPvc = Test<DeviceFixture>;
PVCTEST_F(CommandQueueCommandsPvc, whenExecuteCommandListsIsCalledThenAdditionalCfeStatesAreCorrectlyProgrammed) {
if (!PVC::isXtTemporary(*defaultHwInfo)) {
GTEST_SKIP();
}
DebugManagerStateRestore restorer;
DebugManager.flags.AllowMixingRegularAndCooperativeKernels.set(1);
DebugManager.flags.AllowPatchingVfeStateInCommandLists.set(1);
using CFE_STATE = typename FamilyType::CFE_STATE;
auto hwInfo = *NEO::defaultHwInfo;
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
auto bStep = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, hwInfo);
if (bStep != CommonConstants::invalidStepping) {
hwInfo.platform.usRevId = bStep;
}
hwInfo.platform.usRevId |= FamilyType::pvcBaseDieRevMask;
auto neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo);
auto mockBuiltIns = new MockBuiltins();
neoDevice->executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltIns);
NEO::DeviceVector devices;
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
auto driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
driverHandle->initialize(std::move(devices));
auto device = driverHandle->devices[0];
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u);
auto commandQueue = new MockCommandQueueHw<IGFX_XE_HPC_CORE>{device, csr, &desc};
commandQueue->initialize(false, false);
Mock<::L0::Kernel> defaultKernel;
auto pMockModule1 = std::unique_ptr<Module>(new Mock<Module>(device, nullptr));
defaultKernel.module = pMockModule1.get();
Mock<::L0::Kernel> cooperativeKernel;
auto pMockModule2 = std::unique_ptr<Module>(new Mock<Module>(device, nullptr));
cooperativeKernel.module = pMockModule2.get();
cooperativeKernel.immutableData.kernelDescriptor->kernelAttributes.flags.usesSyncBuffer = true;
cooperativeKernel.immutableData.kernelDescriptor->kernelAttributes.numGrfRequired = GrfConfig::DefaultGrfNumber;
cooperativeKernel.setGroupSize(1, 1, 1);
ze_group_count_t threadGroupDimensions{1, 1, 1};
auto commandListAB = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<IGFX_XE_HPC_CORE>>>();
commandListAB->initialize(device, NEO::EngineGroupType::CooperativeCompute, 0u);
commandListAB->appendLaunchKernelWithParams(&defaultKernel, &threadGroupDimensions, nullptr, false, false, false);
commandListAB->appendLaunchKernelWithParams(&cooperativeKernel, &threadGroupDimensions, nullptr, false, false, true);
auto hCommandListAB = commandListAB->toHandle();
auto commandListBA = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<IGFX_XE_HPC_CORE>>>();
commandListBA->initialize(device, NEO::EngineGroupType::CooperativeCompute, 0u);
commandListBA->appendLaunchKernelWithParams(&cooperativeKernel, &threadGroupDimensions, nullptr, false, false, true);
commandListBA->appendLaunchKernelWithParams(&defaultKernel, &threadGroupDimensions, nullptr, false, false, false);
auto hCommandListBA = commandListBA->toHandle();
// Set state B
csr->getStreamProperties().frontEndState.setProperties(true, false, false, false, *NEO::defaultHwInfo);
// Execute command list AB
commandQueue->executeCommandLists(1, &hCommandListAB, nullptr, false);
// Expect state A programmed by command queue
GenCmdList cmdList;
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
cmdList, commandQueue->commandStream->getCpuBase(), commandQueue->commandStream->getUsed()));
auto cfeStates = findAll<CFE_STATE *>(cmdList.begin(), cmdList.end());
EXPECT_EQ(1u, cfeStates.size());
EXPECT_EQ(false, genCmdCast<CFE_STATE *>(*cfeStates[0])->getComputeDispatchAllWalkerEnable());
// Expect state B programmed by command list
cmdList.clear();
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
cmdList, commandListAB->commandContainer.getCommandStream()->getCpuBase(), commandListAB->commandContainer.getCommandStream()->getUsed()));
cfeStates = findAll<CFE_STATE *>(cmdList.begin(), cmdList.end());
EXPECT_EQ(1u, cfeStates.size());
EXPECT_EQ(true, genCmdCast<CFE_STATE *>(*cfeStates[0])->getComputeDispatchAllWalkerEnable());
// Set state A
csr->getStreamProperties().frontEndState.setProperties(false, false, false, false, *NEO::defaultHwInfo);
// Execute command list BA
commandQueue->executeCommandLists(1, &hCommandListBA, nullptr, false);
// Expect state B programmed by command queue
cmdList.clear();
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
cmdList, commandQueue->commandStream->getCpuBase(), commandQueue->commandStream->getUsed()));
cfeStates = findAll<CFE_STATE *>(cmdList.begin(), cmdList.end());
EXPECT_EQ(2u, cfeStates.size());
EXPECT_EQ(false, genCmdCast<CFE_STATE *>(*cfeStates[0])->getComputeDispatchAllWalkerEnable());
EXPECT_EQ(true, genCmdCast<CFE_STATE *>(*cfeStates[1])->getComputeDispatchAllWalkerEnable());
// Expect state A programmed by command list
cmdList.clear();
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
cmdList, commandListBA->commandContainer.getCommandStream()->getCpuBase(), commandListBA->commandContainer.getCommandStream()->getUsed()));
cfeStates = findAll<CFE_STATE *>(cmdList.begin(), cmdList.end());
EXPECT_EQ(1u, cfeStates.size());
EXPECT_EQ(false, genCmdCast<CFE_STATE *>(*cfeStates[0])->getComputeDispatchAllWalkerEnable());
commandQueue->destroy();
}
} // namespace ult
} // namespace L0

View File

@ -163,113 +163,5 @@ HWTEST2_F(CommandQueueCommandsPvc, givenLinkedCopyEngineOrdinalWhenCreatingThenS
L0::Context::fromHandle(hContext)->destroy();
}
HWTEST2_F(CommandQueueCommandsPvc, whenExecuteCommandListsIsCalledThenAdditionalCfeStatesAreCorrectlyProgrammed, IsXeHpcCore) {
if (!XE_HPC_CORE::isXtTemporary(*defaultHwInfo)) {
GTEST_SKIP();
}
if (defaultHwInfo->platform.eProductFamily != IGFX_PVC) {
GTEST_SKIP();
}
DebugManagerStateRestore restorer;
DebugManager.flags.AllowMixingRegularAndCooperativeKernels.set(1);
DebugManager.flags.AllowPatchingVfeStateInCommandLists.set(1);
using CFE_STATE = typename FamilyType::CFE_STATE;
auto hwInfo = *NEO::defaultHwInfo;
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
auto bStep = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, hwInfo);
if (bStep != CommonConstants::invalidStepping) {
hwInfo.platform.usRevId = bStep;
}
if constexpr (IsPVC::isMatched<productFamily>()) {
hwInfo.platform.usRevId |= FamilyType::pvcBaseDieRevMask;
}
auto neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo);
auto mockBuiltIns = new MockBuiltins();
neoDevice->executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltIns);
NEO::DeviceVector devices;
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
auto driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
driverHandle->initialize(std::move(devices));
auto device = driverHandle->devices[0];
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u);
auto commandQueue = new MockCommandQueueHw<gfxCoreFamily>{device, csr, &desc};
commandQueue->initialize(false, false);
Mock<::L0::Kernel> defaultKernel;
auto pMockModule1 = std::unique_ptr<Module>(new Mock<Module>(device, nullptr));
defaultKernel.module = pMockModule1.get();
Mock<::L0::Kernel> cooperativeKernel;
auto pMockModule2 = std::unique_ptr<Module>(new Mock<Module>(device, nullptr));
cooperativeKernel.module = pMockModule2.get();
cooperativeKernel.immutableData.kernelDescriptor->kernelAttributes.flags.usesSyncBuffer = true;
cooperativeKernel.immutableData.kernelDescriptor->kernelAttributes.numGrfRequired = GrfConfig::DefaultGrfNumber;
cooperativeKernel.setGroupSize(1, 1, 1);
ze_group_count_t threadGroupDimensions{1, 1, 1};
auto commandListAB = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
commandListAB->initialize(device, NEO::EngineGroupType::CooperativeCompute, 0u);
commandListAB->appendLaunchKernelWithParams(&defaultKernel, &threadGroupDimensions, nullptr, false, false, false);
commandListAB->appendLaunchKernelWithParams(&cooperativeKernel, &threadGroupDimensions, nullptr, false, false, true);
auto hCommandListAB = commandListAB->toHandle();
auto commandListBA = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
commandListBA->initialize(device, NEO::EngineGroupType::CooperativeCompute, 0u);
commandListBA->appendLaunchKernelWithParams(&cooperativeKernel, &threadGroupDimensions, nullptr, false, false, true);
commandListBA->appendLaunchKernelWithParams(&defaultKernel, &threadGroupDimensions, nullptr, false, false, false);
auto hCommandListBA = commandListBA->toHandle();
// Set state B
csr->getStreamProperties().frontEndState.setProperties(true, false, false, false, *NEO::defaultHwInfo);
// Execute command list AB
commandQueue->executeCommandLists(1, &hCommandListAB, nullptr, false);
// Expect state A programmed by command queue
GenCmdList cmdList;
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
cmdList, commandQueue->commandStream->getCpuBase(), commandQueue->commandStream->getUsed()));
auto cfeStates = findAll<CFE_STATE *>(cmdList.begin(), cmdList.end());
EXPECT_EQ(1u, cfeStates.size());
EXPECT_EQ(false, genCmdCast<CFE_STATE *>(*cfeStates[0])->getComputeDispatchAllWalkerEnable());
// Expect state B programmed by command list
cmdList.clear();
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
cmdList, commandListAB->commandContainer.getCommandStream()->getCpuBase(), commandListAB->commandContainer.getCommandStream()->getUsed()));
cfeStates = findAll<CFE_STATE *>(cmdList.begin(), cmdList.end());
EXPECT_EQ(1u, cfeStates.size());
EXPECT_EQ(true, genCmdCast<CFE_STATE *>(*cfeStates[0])->getComputeDispatchAllWalkerEnable());
// Set state A
csr->getStreamProperties().frontEndState.setProperties(false, false, false, false, *NEO::defaultHwInfo);
// Execute command list BA
commandQueue->executeCommandLists(1, &hCommandListBA, nullptr, false);
// Expect state B programmed by command queue
cmdList.clear();
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
cmdList, commandQueue->commandStream->getCpuBase(), commandQueue->commandStream->getUsed()));
cfeStates = findAll<CFE_STATE *>(cmdList.begin(), cmdList.end());
EXPECT_EQ(2u, cfeStates.size());
EXPECT_EQ(false, genCmdCast<CFE_STATE *>(*cfeStates[0])->getComputeDispatchAllWalkerEnable());
EXPECT_EQ(true, genCmdCast<CFE_STATE *>(*cfeStates[1])->getComputeDispatchAllWalkerEnable());
// Expect state A programmed by command list
cmdList.clear();
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
cmdList, commandListBA->commandContainer.getCommandStream()->getCpuBase(), commandListBA->commandContainer.getCommandStream()->getUsed()));
cfeStates = findAll<CFE_STATE *>(cmdList.begin(), cmdList.end());
EXPECT_EQ(1u, cfeStates.size());
EXPECT_EQ(false, genCmdCast<CFE_STATE *>(*cfeStates[0])->getComputeDispatchAllWalkerEnable());
commandQueue->destroy();
}
} // namespace ult
} // namespace L0

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

@ -121,3 +121,43 @@ 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());
}
}