mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Correct xe_hpc_core ults
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com> Related-To: NEO-6738
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
9c06af79ad
commit
bf559ed028
@ -154,25 +154,6 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, whenQueryingMaxNumSamplersThenReturnZe
|
||||
EXPECT_EQ(0u, helper.getMaxNumSamplers());
|
||||
}
|
||||
|
||||
XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenDeviceIdThenProperMaxThreadsForWorkgroupIsReturned) {
|
||||
auto &hwInfoConfig = *HwInfoConfig::get(hardwareInfo.platform.eProductFamily);
|
||||
|
||||
if (hardwareInfo.platform.eProductFamily != IGFX_PVC) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
for (auto &deviceId : PVC_XL_IDS) {
|
||||
hardwareInfo.platform.usDeviceID = deviceId;
|
||||
EXPECT_EQ(64u, hwInfoConfig.getMaxThreadsForWorkgroupInDSSOrSS(hardwareInfo, 64u, 64u));
|
||||
}
|
||||
|
||||
for (auto &deviceId : PVC_XT_IDS) {
|
||||
hardwareInfo.platform.usDeviceID = deviceId;
|
||||
uint32_t numThreadsPerEU = hardwareInfo.gtSystemInfo.ThreadCount / hardwareInfo.gtSystemInfo.EUCount;
|
||||
EXPECT_EQ(64u * numThreadsPerEU, hwInfoConfig.getMaxThreadsForWorkgroupInDSSOrSS(hardwareInfo, 64u, 64u));
|
||||
}
|
||||
}
|
||||
|
||||
XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenRevisionEnumAndPlatformFamilyTypeThenProperValueForIsWorkaroundRequiredIsReturned) {
|
||||
uint32_t steppings[] = {
|
||||
REVISION_A0,
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
#include "device_ids_configs_pvc.h"
|
||||
#include "gmock/gmock.h"
|
||||
|
||||
using namespace NEO;
|
||||
@ -104,6 +105,22 @@ PVCTEST_F(PvcHwInfo, givenDebugVariableSetWhenConfiguringThenEnableCccs) {
|
||||
EXPECT_TRUE(hwInfo.featureTable.flags.ftrRcsNode);
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfo, givenDeviceIdThenProperMaxThreadsForWorkgroupIsReturned) {
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
|
||||
for (auto &deviceId : PVC_XL_IDS) {
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
EXPECT_EQ(64u, hwInfoConfig.getMaxThreadsForWorkgroupInDSSOrSS(hwInfo, 64u, 64u));
|
||||
}
|
||||
|
||||
for (auto &deviceId : PVC_XT_IDS) {
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
uint32_t numThreadsPerEU = hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount;
|
||||
EXPECT_EQ(64u * numThreadsPerEU, hwInfoConfig.getMaxThreadsForWorkgroupInDSSOrSS(hwInfo, 64u, 64u));
|
||||
}
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfo, givenVariousValuesWhenConvertingHwRevIdAndSteppingThenConversionIsCorrect) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
|
@ -6,8 +6,10 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
|
||||
#include "shared/test/common/fixtures/command_container_fixture.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/helpers/variable_backup.h"
|
||||
#include "shared/test/common/mocks/mock_dispatch_kernel_encoder_interface.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
#include "hw_cmds.h"
|
||||
@ -50,3 +52,75 @@ PVCTEST_F(CommandEncodeStatesPvcTest, GivenSmallSlmTotalSizesWhenSetAdditionalIn
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
using EncodeKernelPvcTest = Test<CommandEncodeStatesFixture>;
|
||||
|
||||
PVCTEST_F(EncodeKernelPvcTest, givenRevisionBAndAboveWhenSpecialModeRequiredThenDontReprogramPipelineSelect) {
|
||||
bool requiresUncachedMocs = false;
|
||||
auto hwInfo = pDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
|
||||
uint32_t dims[] = {1, 1, 1};
|
||||
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
|
||||
dispatchInterface->kernelDescriptor.kernelAttributes.flags.usesSpecialPipelineSelectMode = true;
|
||||
|
||||
struct {
|
||||
unsigned short revId;
|
||||
bool expectedValue;
|
||||
} testInputs[] = {
|
||||
{0x0, true},
|
||||
{0x1, true},
|
||||
{0x3, true},
|
||||
{0x5, false},
|
||||
{0x6, false},
|
||||
{0x7, false},
|
||||
};
|
||||
for (auto &testInput : testInputs) {
|
||||
for (auto &deviceId : PVC_XL_IDS) {
|
||||
hwInfo->platform.usDeviceID = deviceId;
|
||||
hwInfo->platform.usRevId = testInput.revId;
|
||||
cmdContainer->lastPipelineSelectModeRequired = false;
|
||||
|
||||
EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs);
|
||||
dispatchArgs.preemptionMode = NEO::PreemptionMode::Initial;
|
||||
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dispatchArgs);
|
||||
EXPECT_EQ(testInput.expectedValue, cmdContainer->lastPipelineSelectModeRequired);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PVCTEST_F(EncodeKernelPvcTest, givenRevisionBAndAboveWhenSpecialModeRequiredAndAdjustPipelineSelectCalledThenDontEnableSystolicMode) {
|
||||
using PIPELINE_SELECT = typename FamilyType::PIPELINE_SELECT;
|
||||
auto hwInfo = pDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
|
||||
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
|
||||
dispatchInterface->kernelDescriptor.kernelAttributes.flags.usesSpecialPipelineSelectMode = true;
|
||||
|
||||
struct {
|
||||
unsigned short revId;
|
||||
bool expectedValue;
|
||||
} testInputs[] = {
|
||||
{0x0, true},
|
||||
{0x1, true},
|
||||
{0x3, true},
|
||||
{0x5, false},
|
||||
{0x6, false},
|
||||
{0x7, false},
|
||||
};
|
||||
for (auto &testInput : testInputs) {
|
||||
for (auto &deviceId : PVC_XL_IDS) {
|
||||
hwInfo->platform.usDeviceID = deviceId;
|
||||
hwInfo->platform.usRevId = testInput.revId;
|
||||
EncodeComputeMode<FamilyType>::adjustPipelineSelect(*cmdContainer.get(), dispatchInterface->kernelDescriptor);
|
||||
GenCmdList commands;
|
||||
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
|
||||
|
||||
auto itor = find<PIPELINE_SELECT *>(commands.begin(), commands.end());
|
||||
ASSERT_NE(itor, commands.end());
|
||||
|
||||
auto pipelineSelectCmd = genCmdCast<PIPELINE_SELECT *>(*itor);
|
||||
EXPECT_EQ(testInput.expectedValue, pipelineSelectCmd->getSystolicModeEnable());
|
||||
cmdContainer->reset();
|
||||
}
|
||||
}
|
||||
}
|
@ -430,81 +430,3 @@ XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, whenSizeForEncodeSystemMemoryFenceQ
|
||||
auto size = EncodeMemoryFence<FamilyType>::getSystemMemoryFenceSize();
|
||||
EXPECT_EQ(sizeof(STATE_SYSTEM_MEM_FENCE_ADDRESS), size);
|
||||
}
|
||||
|
||||
XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenRevisionBAndAboveWhenSpecialModeRequiredThenDontReprogramPipelineSelect) {
|
||||
bool requiresUncachedMocs = false;
|
||||
auto hwInfo = pDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
|
||||
if (hwInfo->platform.eProductFamily != IGFX_PVC) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
uint32_t dims[] = {1, 1, 1};
|
||||
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
|
||||
dispatchInterface->kernelDescriptor.kernelAttributes.flags.usesSpecialPipelineSelectMode = true;
|
||||
|
||||
struct {
|
||||
unsigned short revId;
|
||||
bool expectedValue;
|
||||
} testInputs[] = {
|
||||
{0x0, true},
|
||||
{0x1, true},
|
||||
{0x3, true},
|
||||
{0x5, false},
|
||||
{0x6, false},
|
||||
{0x7, false},
|
||||
};
|
||||
for (auto &testInput : testInputs) {
|
||||
for (auto &deviceId : PVC_XL_IDS) {
|
||||
hwInfo->platform.usDeviceID = deviceId;
|
||||
hwInfo->platform.usRevId = testInput.revId;
|
||||
cmdContainer->lastPipelineSelectModeRequired = false;
|
||||
|
||||
EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs);
|
||||
dispatchArgs.preemptionMode = NEO::PreemptionMode::Initial;
|
||||
|
||||
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dispatchArgs);
|
||||
EXPECT_EQ(testInput.expectedValue, cmdContainer->lastPipelineSelectModeRequired);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenRevisionBAndAboveWhenSpecialModeRequiredAndAdjustPipelineSelectCalledThenDontEnableSystolicMode) {
|
||||
using PIPELINE_SELECT = typename FamilyType::PIPELINE_SELECT;
|
||||
auto hwInfo = pDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
|
||||
if (hwInfo->platform.eProductFamily != IGFX_PVC) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
|
||||
dispatchInterface->kernelDescriptor.kernelAttributes.flags.usesSpecialPipelineSelectMode = true;
|
||||
|
||||
struct {
|
||||
unsigned short revId;
|
||||
bool expectedValue;
|
||||
} testInputs[] = {
|
||||
{0x0, true},
|
||||
{0x1, true},
|
||||
{0x3, true},
|
||||
{0x5, false},
|
||||
{0x6, false},
|
||||
{0x7, false},
|
||||
};
|
||||
for (auto &testInput : testInputs) {
|
||||
for (auto &deviceId : PVC_XL_IDS) {
|
||||
hwInfo->platform.usDeviceID = deviceId;
|
||||
hwInfo->platform.usRevId = testInput.revId;
|
||||
EncodeComputeMode<FamilyType>::adjustPipelineSelect(*cmdContainer.get(), dispatchInterface->kernelDescriptor);
|
||||
GenCmdList commands;
|
||||
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
|
||||
|
||||
auto itor = find<PIPELINE_SELECT *>(commands.begin(), commands.end());
|
||||
ASSERT_NE(itor, commands.end());
|
||||
|
||||
auto pipelineSelectCmd = genCmdCast<PIPELINE_SELECT *>(*itor);
|
||||
EXPECT_EQ(testInput.expectedValue, pipelineSelectCmd->getSystolicModeEnable());
|
||||
cmdContainer->reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,8 +6,6 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/source/execution_environment/root_device_environment.h"
|
||||
#include "shared/source/os_interface/device_factory.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
@ -16,44 +14,7 @@ using namespace NEO;
|
||||
|
||||
using WalkerDispatchTestsXeHpcCore = ::testing::Test;
|
||||
|
||||
XE_HPC_CORETEST_F(WalkerDispatchTestsXeHpcCore, whenEncodeAdditionalWalkerFieldsThenPostSyncDataIsCorrectlySet) {
|
||||
struct {
|
||||
unsigned short revisionId;
|
||||
int32_t programGlobalFenceAsPostSyncOperationInComputeWalker;
|
||||
bool expectSystemMemoryFenceRequest;
|
||||
} testInputs[] = {
|
||||
{0x0, -1, false},
|
||||
{0x3, -1, true},
|
||||
{0x0, 0, false},
|
||||
{0x3, 0, false},
|
||||
{0x0, 1, true},
|
||||
{0x3, 1, true},
|
||||
};
|
||||
|
||||
DebugManagerStateRestore debugRestorer;
|
||||
auto walkerCmd = FamilyType::cmdInitGpgpuWalker;
|
||||
auto &postSyncData = walkerCmd.getPostSync();
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
|
||||
if (hwInfo.platform.eProductFamily != IGFX_PVC) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
for (auto &testInput : testInputs) {
|
||||
for (auto &deviceId : PVC_XL_IDS) {
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
hwInfo.platform.usRevId = testInput.revisionId;
|
||||
DebugManager.flags.ProgramGlobalFenceAsPostSyncOperationInComputeWalker.set(
|
||||
testInput.programGlobalFenceAsPostSyncOperationInComputeWalker);
|
||||
|
||||
postSyncData.setSystemMemoryFenceRequest(false);
|
||||
EncodeDispatchKernel<FamilyType>::encodeAdditionalWalkerFields(hwInfo, walkerCmd, KernelExecutionType::Default);
|
||||
EXPECT_EQ(testInput.expectSystemMemoryFenceRequest, postSyncData.getSystemMemoryFenceRequest());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XE_HPC_CORETEST_F(WalkerDispatchTestsXeHpcCore, givenPvcWhenEncodeAdditionalWalkerFieldsIsCalledThenComputeDispatchAllIsCorrectlySet) {
|
||||
XE_HPC_CORETEST_F(WalkerDispatchTestsXeHpcCore, givenXeHpcWhenEncodeAdditionalWalkerFieldsIsCalledThenComputeDispatchAllIsCorrectlySet) {
|
||||
using COMPUTE_WALKER = typename FamilyType::COMPUTE_WALKER;
|
||||
DebugManagerStateRestore debugRestorer;
|
||||
auto walkerCmd = FamilyType::cmdInitGpgpuWalker;
|
||||
|
@ -7,6 +7,7 @@
|
||||
if(TESTS_PVC)
|
||||
set(NEO_SHARED_TESTS_PVC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dispatch_walker_tests_pvc.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_tests_pvc.cpp
|
||||
)
|
||||
|
||||
|
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/source/execution_environment/root_device_environment.h"
|
||||
#include "shared/source/os_interface/device_factory.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using WalkerDispatchTestsPvc = ::testing::Test;
|
||||
|
||||
PVCTEST_F(WalkerDispatchTestsPvc, givenPvcWhenEncodeAdditionalWalkerFieldsThenPostSyncDataIsCorrectlySet) {
|
||||
struct {
|
||||
unsigned short revisionId;
|
||||
int32_t programGlobalFenceAsPostSyncOperationInComputeWalker;
|
||||
bool expectSystemMemoryFenceRequest;
|
||||
} testInputs[] = {
|
||||
{0x0, -1, false},
|
||||
{0x3, -1, true},
|
||||
{0x0, 0, false},
|
||||
{0x3, 0, false},
|
||||
{0x0, 1, true},
|
||||
{0x3, 1, true},
|
||||
};
|
||||
|
||||
DebugManagerStateRestore debugRestorer;
|
||||
auto walkerCmd = FamilyType::cmdInitGpgpuWalker;
|
||||
auto &postSyncData = walkerCmd.getPostSync();
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
|
||||
for (auto &testInput : testInputs) {
|
||||
for (auto &deviceId : PVC_XL_IDS) {
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
hwInfo.platform.usRevId = testInput.revisionId;
|
||||
DebugManager.flags.ProgramGlobalFenceAsPostSyncOperationInComputeWalker.set(
|
||||
testInput.programGlobalFenceAsPostSyncOperationInComputeWalker);
|
||||
|
||||
postSyncData.setSystemMemoryFenceRequest(false);
|
||||
EncodeDispatchKernel<FamilyType>::encodeAdditionalWalkerFields(hwInfo, walkerCmd, KernelExecutionType::Default);
|
||||
EXPECT_EQ(testInput.expectSystemMemoryFenceRequest, postSyncData.getSystemMemoryFenceRequest());
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user