mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Refactoring the use of PVC device ids
Replacing the old device id implementation & clearing PVC XT temporary. Related-To: NEO-6742 Signed-off-by: Daria Hinz <daria.hinz@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
b79d9a8e10
commit
452050ae40
@ -5,6 +5,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hpc_core/hw_cmds_pvc.h"
|
||||
|
||||
#include "level_zero/core/source/helpers/l0_populate_factory.h"
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper_base.inl"
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper_pvc_and_later.inl"
|
||||
@ -24,14 +26,7 @@ void populateFactoryTable<L0HwHelperHw<Family>>() {
|
||||
|
||||
template <>
|
||||
bool L0HwHelperHw<Family>::isIpSamplingSupported(const NEO::HardwareInfo &hwInfo) const {
|
||||
if (hwInfo.platform.usDeviceID == NEO::XE_HPC_CORE::pvcXtDeviceIds[0] ||
|
||||
hwInfo.platform.usDeviceID == NEO::XE_HPC_CORE::pvcXtDeviceIds[1] ||
|
||||
hwInfo.platform.usDeviceID == NEO::XE_HPC_CORE::pvcXtDeviceIds[2] ||
|
||||
hwInfo.platform.usDeviceID == NEO::XE_HPC_CORE::pvcXtDeviceIds[3] ||
|
||||
hwInfo.platform.usDeviceID == NEO::XE_HPC_CORE::pvcXtDeviceIds[4]) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return NEO::PVC::isXt(hwInfo);
|
||||
}
|
||||
|
||||
template class L0HwHelperHw<Family>;
|
||||
|
@ -1,12 +0,0 @@
|
||||
#
|
||||
# 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()
|
@ -1,131 +0,0 @@
|
||||
/*
|
||||
* 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
|
@ -16,6 +16,7 @@
|
||||
#include "level_zero/core/test/unit_tests/fixtures/device_fixture.h"
|
||||
#include "level_zero/tools/source/metrics/os_metric_ip_sampling.h"
|
||||
|
||||
#include "device_ids_configs.h"
|
||||
#include "hw_cmds.h"
|
||||
|
||||
namespace NEO {
|
||||
@ -274,7 +275,7 @@ HWTEST2_F(MetricIpSamplingLinuxTestPrelim, GivenSupportedProductFamilyAndUnsuppo
|
||||
|
||||
auto hwInfo = neoDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
hwInfo->platform.eProductFamily = productFamily;
|
||||
hwInfo->platform.usDeviceID = NEO::XE_HPC_CORE::pvcXlDeviceId;
|
||||
hwInfo->platform.usDeviceID = NEO::PVC_XL_IDS.front();
|
||||
EXPECT_FALSE(metricIpSamplingOsInterface->isDependencyAvailable());
|
||||
}
|
||||
|
||||
@ -283,14 +284,7 @@ HWTEST2_F(MetricIpSamplingLinuxTestPrelim, GivenSupportedProductFamilyAndSupport
|
||||
auto hwInfo = neoDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
hwInfo->platform.eProductFamily = productFamily;
|
||||
|
||||
const std::vector<uint32_t> supportedDeviceIds = {
|
||||
NEO::XE_HPC_CORE::pvcXtDeviceIds[0],
|
||||
NEO::XE_HPC_CORE::pvcXtDeviceIds[1],
|
||||
NEO::XE_HPC_CORE::pvcXtDeviceIds[2],
|
||||
NEO::XE_HPC_CORE::pvcXtDeviceIds[3],
|
||||
NEO::XE_HPC_CORE::pvcXtDeviceIds[4]};
|
||||
|
||||
for (uint32_t deviceId : supportedDeviceIds) {
|
||||
for (auto deviceId : NEO::PVC_XT_IDS) {
|
||||
hwInfo->platform.usDeviceID = deviceId;
|
||||
EXPECT_TRUE(metricIpSamplingOsInterface->isDependencyAvailable());
|
||||
}
|
||||
@ -300,7 +294,7 @@ HWTEST2_F(MetricIpSamplingLinuxTestPrelim, GivenDriverOpenFailsWhenIsDependencyA
|
||||
|
||||
auto hwInfo = neoDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
hwInfo->platform.eProductFamily = productFamily;
|
||||
hwInfo->platform.usDeviceID = NEO::XE_HPC_CORE::pvcXtDeviceIds[0];
|
||||
hwInfo->platform.usDeviceID = NEO::PVC_XT_IDS.front();
|
||||
|
||||
auto drm = static_cast<DrmPrelimMock *>(device->getOsInterface().getDriverModel()->as<NEO::Drm>());
|
||||
VariableBackup<int> backupCsTimeStampFrequency(&drm->storedCsTimestampFrequency, 0);
|
||||
@ -313,7 +307,7 @@ HWTEST2_F(MetricIpSamplingLinuxTestPrelim, GivenIoctlHelperFailsWhenIsDependency
|
||||
|
||||
auto hwInfo = neoDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
hwInfo->platform.eProductFamily = productFamily;
|
||||
hwInfo->platform.usDeviceID = NEO::XE_HPC_CORE::pvcXtDeviceIds[0];
|
||||
hwInfo->platform.usDeviceID = NEO::PVC_XT_IDS.front();
|
||||
|
||||
auto drm = static_cast<DrmPrelimMock *>(device->getOsInterface().getDriverModel()->as<NEO::Drm>());
|
||||
|
||||
|
@ -51,14 +51,7 @@ HWTEST2_F(MetricIpSamplingLinuxTestUpstream, GivenSupportedProductFamilyAndSuppo
|
||||
auto hwInfo = neoDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
hwInfo->platform.eProductFamily = productFamily;
|
||||
|
||||
const std::vector<uint32_t> supportedDeviceIds = {
|
||||
NEO::XE_HPC_CORE::pvcXtDeviceIds[0],
|
||||
NEO::XE_HPC_CORE::pvcXtDeviceIds[1],
|
||||
NEO::XE_HPC_CORE::pvcXtDeviceIds[2],
|
||||
NEO::XE_HPC_CORE::pvcXtDeviceIds[3],
|
||||
NEO::XE_HPC_CORE::pvcXtDeviceIds[4]};
|
||||
|
||||
for (uint32_t deviceId : supportedDeviceIds) {
|
||||
for (auto deviceId : NEO::PVC_XT_IDS) {
|
||||
hwInfo->platform.usDeviceID = deviceId;
|
||||
EXPECT_FALSE(metricIpSamplingOsInterface->isDependencyAvailable());
|
||||
}
|
||||
|
@ -161,11 +161,13 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenDeviceIdThenProperMaxThreadsForWo
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
hardwareInfo.platform.usDeviceID = FamilyType::pvcXlDeviceId;
|
||||
for (auto &deviceId : PVC_XL_IDS) {
|
||||
hardwareInfo.platform.usDeviceID = deviceId;
|
||||
EXPECT_EQ(64u, hwInfoConfig.getMaxThreadsForWorkgroupInDSSOrSS(hardwareInfo, 64u, 64u));
|
||||
auto xtDevicesCount = 3;
|
||||
for (int32_t i = 0; i < xtDevicesCount; i++) {
|
||||
hardwareInfo.platform.usDeviceID = FamilyType::pvcXtDeviceIds[i];
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
@ -1076,7 +1078,4 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, GivenRevisionIdWhenGetComputeUnitsUsed
|
||||
hwInfo.platform.usRevId = testInput.revId;
|
||||
EXPECT_EQ(expectedValue * testInput.expectedRatio, helper.getComputeUnitsUsedForScratch(&hwInfo));
|
||||
}
|
||||
hwInfo.platform.usRevId = 0x5;
|
||||
hwInfo.platform.usDeviceID = FamilyType::pvcXtTemporaryDeviceId;
|
||||
EXPECT_EQ(expectedValue * 8, helper.getComputeUnitsUsedForScratch(&hwInfo));
|
||||
}
|
||||
|
@ -108,7 +108,9 @@ PVCTEST_F(PvcHwInfo, givenVariousValuesWhenConvertingHwRevIdAndSteppingThenConve
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
|
||||
uint32_t deviceIds[] = {FamilyType::pvcXlDeviceId, FamilyType::pvcXtDeviceIds[0], FamilyType::pvcXtDeviceIds[1], FamilyType::pvcXtDeviceIds[2], FamilyType::pvcXtTemporaryDeviceId};
|
||||
std::vector<unsigned short> deviceIds = PVC_XL_IDS;
|
||||
deviceIds.insert(deviceIds.end(), PVC_XT_IDS.begin(), PVC_XT_IDS.end());
|
||||
|
||||
for (uint32_t testValue = 0; testValue < 0xFF; testValue++) {
|
||||
for (auto deviceId : deviceIds) {
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
|
@ -92,7 +92,7 @@ class HwInfoConfig {
|
||||
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 isThreadEuRatio16ForScratchRequired(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isComputeDispatchAllWalkerEnableInCfeStateRequired(const HardwareInfo &hwInfo) const = 0;
|
||||
|
||||
MOCKABLE_VIRTUAL ~HwInfoConfig() = default;
|
||||
@ -171,7 +171,7 @@ class HwInfoConfigHw : public HwInfoConfig {
|
||||
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 isThreadEuRatio16ForScratchRequired(const HardwareInfo &hwInfo) const override;
|
||||
bool isComputeDispatchAllWalkerEnableInCfeStateRequired(const HardwareInfo &hwInfo) const override;
|
||||
|
||||
protected:
|
||||
|
@ -329,7 +329,7 @@ bool HwInfoConfigHw<gfxProduct>::isAdjustProgrammableIdPreferredSlmSizeRequired(
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool HwInfoConfigHw<gfxProduct>::isThreaEuRatio16ForScratchRequired(const HardwareInfo &hwInfo) const {
|
||||
bool HwInfoConfigHw<gfxProduct>::isThreadEuRatio16ForScratchRequired(const HardwareInfo &hwInfo) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -7,13 +7,14 @@
|
||||
if(SUPPORT_XE_HPC_CORE)
|
||||
set(HW_DEFINITIONS_XE_HPC_CORE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}hw_cmds_pvc.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}os_agnostic_hw_info_config_pvc_extra.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}device_ids_configs_pvc.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}hw_cmds_pvc.inl
|
||||
)
|
||||
set(NEO_CORE_HELPERS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compiler_hw_info_config_pvc.inl
|
||||
)
|
||||
set_property(GLOBAL APPEND PROPERTY CORE_SRCS_GENX_ALL_BASE ${HW_DEFINITIONS_XE_HPC_CORE})
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY NEO_CORE_HELPERS ${HW_DEFINITIONS_XE_HPC_CORE})
|
||||
|
||||
add_subdirectories()
|
||||
endif()
|
||||
|
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
template <>
|
||||
bool HwInfoConfigHw<gfxProduct>::isComputeDispatchAllWalkerEnableInComputeWalkerRequired(const HardwareInfo &hwInfo) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool HwInfoConfigHw<gfxProduct>::isThreadEuRatio16ForScratchRequired(const HardwareInfo &hwInfo) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool HwInfoConfigHw<gfxProduct>::isComputeDispatchAllWalkerEnableInCfeStateRequired(const HardwareInfo &hwInfo) const {
|
||||
return true;
|
||||
}
|
@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/commands/bxml_generator_glue.h"
|
||||
#include "shared/source/helpers/debug_helpers.h"
|
||||
#include "shared/source/xe_hpc_core/hw_info.h"
|
||||
@ -17,8 +18,8 @@
|
||||
|
||||
template <class T>
|
||||
struct CmdParse;
|
||||
namespace NEO {
|
||||
|
||||
namespace NEO {
|
||||
struct XE_HPC_CORE {
|
||||
#include "shared/source/generated/xe_hpc_core/hw_cmds_generated_xe_hpc_core.inl"
|
||||
|
||||
@ -29,9 +30,6 @@ struct XE_HPC_CORE {
|
||||
static constexpr uint8_t pvcBaseDieRevMask = 0b111000; // [3:5]
|
||||
static constexpr uint8_t pvcBaseDieA0Masked = 0; // [3:5] == 0
|
||||
static constexpr uint32_t pvcSteppingBits = 0b111;
|
||||
static constexpr uint32_t pvcXlDeviceId = 0x0BD0;
|
||||
static constexpr uint32_t pvcXtDeviceIds[5] = {0x0BD5, 0x0BD6, 0x0BD7, 0x0BD8, 0x0BE1};
|
||||
static constexpr uint32_t pvcXtTemporaryDeviceId = 0x0BE5;
|
||||
|
||||
static constexpr bool isUsingL3Control = false;
|
||||
static constexpr bool isUsingMediaSamplerDopClockGate = false;
|
||||
|
21
shared/source/xe_hpc_core/hw_cmds_pvc.cpp
Normal file
21
shared/source/xe_hpc_core/hw_cmds_pvc.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hpc_core/hw_cmds_pvc.h"
|
||||
|
||||
namespace NEO {
|
||||
bool PVC::isXlA0(const HardwareInfo &hwInfo) {
|
||||
auto revId = hwInfo.platform.usRevId & pvcSteppingBits;
|
||||
return (revId < 0x3);
|
||||
}
|
||||
|
||||
bool PVC::isAtMostXtA0(const HardwareInfo &hwInfo) {
|
||||
auto revId = hwInfo.platform.usRevId & pvcSteppingBits;
|
||||
return (revId <= 0x3);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
@ -7,6 +7,9 @@
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/xe_hpc_core/hw_cmds_base.h"
|
||||
|
||||
#include "device_ids_configs_pvc.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
struct PVC : public XE_HPC_COREFamily {
|
||||
@ -28,7 +31,22 @@ struct PVC : public XE_HPC_COREFamily {
|
||||
static void adjustHardwareInfo(HardwareInfo *hwInfo);
|
||||
static bool isXlA0(const HardwareInfo &hwInfo);
|
||||
static bool isAtMostXtA0(const HardwareInfo &hwInfo);
|
||||
static bool isXtTemporary(const HardwareInfo &hwInfo);
|
||||
|
||||
static bool isXl(const HardwareInfo &hwInfo) {
|
||||
auto it = std::find(PVC_XL_IDS.begin(), PVC_XL_IDS.end(), hwInfo.platform.usDeviceID);
|
||||
if (it != PVC_XL_IDS.end()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool isXt(const HardwareInfo &hwInfo) {
|
||||
auto it = std::find(PVC_XT_IDS.begin(), PVC_XT_IDS.end(), hwInfo.platform.usDeviceID);
|
||||
if (it != PVC_XT_IDS.end()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class PVC_CONFIG : public PVC {
|
||||
|
@ -415,7 +415,7 @@ uint32_t HwHelperHw<Family>::getComputeUnitsUsedForScratch(const HardwareInfo *p
|
||||
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(pHwInfo->platform.eProductFamily);
|
||||
auto revId = pHwInfo->platform.usRevId & Family::pvcSteppingBits;
|
||||
uint32_t threadEuRatio = ((0x3 <= revId) && hwInfoConfig.isThreaEuRatio16ForScratchRequired(*pHwInfo)) ? 16 : 8;
|
||||
uint32_t threadEuRatio = ((0x3 <= revId) && hwInfoConfig.isThreadEuRatio16ForScratchRequired(*pHwInfo)) ? 16 : 8;
|
||||
|
||||
return pHwInfo->gtSystemInfo.MaxSubSlicesSupported * pHwInfo->gtSystemInfo.MaxEuPerSubSlice * threadEuRatio;
|
||||
}
|
||||
|
@ -140,20 +140,6 @@ 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;
|
||||
|
@ -28,6 +28,8 @@ const std::map<std::string, std::pair<uint32_t, uint32_t>> guidUuidOffsetMap = {
|
||||
#include "shared/source/os_interface/linux/hw_info_config_uuid_xehp_and_later.inl"
|
||||
#include "shared/source/xe_hpc_core/os_agnostic_hw_info_config_pvc.inl"
|
||||
|
||||
#include "os_agnostic_hw_info_config_pvc_extra.inl"
|
||||
|
||||
template <>
|
||||
int HwInfoConfigHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) {
|
||||
enableCompression(hwInfo);
|
||||
|
@ -14,16 +14,21 @@ void HwInfoConfigHw<gfxProduct>::getKernelExtendedProperties(uint32_t *fp16, uin
|
||||
|
||||
template <>
|
||||
bool HwInfoConfigHw<gfxProduct>::isMaxThreadsForWorkgroupWARequired(const HardwareInfo &hwInfo) const {
|
||||
auto deviceId = hwInfo.platform.usDeviceID;
|
||||
return XE_HPC_COREFamily::pvcXlDeviceId == deviceId;
|
||||
return PVC::isXl(hwInfo);
|
||||
}
|
||||
|
||||
template <>
|
||||
uint32_t HwInfoConfigHw<gfxProduct>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
|
||||
switch (hwInfo.platform.usDeviceID) {
|
||||
default:
|
||||
case XE_HPC_COREFamily::pvcXtTemporaryDeviceId:
|
||||
case XE_HPC_COREFamily::pvcXlDeviceId:
|
||||
if (PVC::isXt(hwInfo)) {
|
||||
switch (stepping) {
|
||||
case REVISION_A0:
|
||||
return 0x3;
|
||||
case REVISION_B:
|
||||
return 0x9D;
|
||||
case REVISION_C:
|
||||
return 0x7;
|
||||
}
|
||||
} else {
|
||||
switch (stepping) {
|
||||
case REVISION_A0:
|
||||
return 0x0;
|
||||
@ -33,19 +38,8 @@ uint32_t HwInfoConfigHw<gfxProduct>::getHwRevIdFromStepping(uint32_t stepping, c
|
||||
DEBUG_BREAK_IF(true);
|
||||
return 0x7;
|
||||
}
|
||||
break;
|
||||
case XE_HPC_COREFamily::pvcXtDeviceIds[0]:
|
||||
case XE_HPC_COREFamily::pvcXtDeviceIds[1]:
|
||||
case XE_HPC_COREFamily::pvcXtDeviceIds[2]:
|
||||
switch (stepping) {
|
||||
case REVISION_A0:
|
||||
return 0x3;
|
||||
case REVISION_B:
|
||||
return 0x9D;
|
||||
case REVISION_C:
|
||||
return 0x7;
|
||||
}
|
||||
}
|
||||
|
||||
return CommonConstants::invalidStepping;
|
||||
}
|
||||
|
||||
@ -137,11 +131,6 @@ bool HwInfoConfigHw<gfxProduct>::isGlobalFenceAsPostSyncOperationInComputeWalker
|
||||
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);
|
||||
@ -151,13 +140,3 @@ 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);
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@ -18,6 +18,8 @@ constexpr static auto gfxProduct = IGFX_PVC;
|
||||
|
||||
#include "shared/source/xe_hpc_core/os_agnostic_hw_info_config_pvc.inl"
|
||||
|
||||
#include "os_agnostic_hw_info_config_pvc_extra.inl"
|
||||
|
||||
template <>
|
||||
int HwInfoConfigHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) {
|
||||
enableCompression(hwInfo);
|
||||
|
@ -50,5 +50,5 @@ HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenIsSystolicModeConfigurabledThenF
|
||||
|
||||
HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenIsThreaEuRatio16ForScratchRequiredThenFalseIsReturned) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
EXPECT_FALSE(hwInfoConfig.isThreaEuRatio16ForScratchRequired(*defaultHwInfo));
|
||||
EXPECT_FALSE(hwInfoConfig.isThreadEuRatio16ForScratchRequired(*defaultHwInfo));
|
||||
}
|
||||
|
@ -318,7 +318,7 @@ bool HwInfoConfigHw<IGFX_UNKNOWN>::isAdjustProgrammableIdPreferredSlmSizeRequire
|
||||
}
|
||||
|
||||
template <>
|
||||
bool HwInfoConfigHw<IGFX_UNKNOWN>::isThreaEuRatio16ForScratchRequired(const HardwareInfo &hwInfo) const {
|
||||
bool HwInfoConfigHw<IGFX_UNKNOWN>::isThreadEuRatio16ForScratchRequired(const HardwareInfo &hwInfo) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,8 @@ PVCTEST_F(CommandEncodeStatesPvcTest, GivenSmallSlmTotalSizesWhenSetAdditionalIn
|
||||
};
|
||||
|
||||
for (auto &revisionToTest : revisionsToTest) {
|
||||
for (auto &deviceId : PVC_XL_IDS) {
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
hwInfo.platform.usRevId = revisionToTest.revisionId;
|
||||
INTERFACE_DESCRIPTOR_DATA idd = FamilyType::cmdInitInterfaceDescriptorData;
|
||||
EncodeDispatchKernel<FamilyType>::appendAdditionalIDDFields(&idd, hwInfo, threadsCount, slmTotalSize, SlmPolicy::SlmPolicyNone);
|
||||
@ -47,3 +49,4 @@ PVCTEST_F(CommandEncodeStatesPvcTest, GivenSmallSlmTotalSizesWhenSetAdditionalIn
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,6 @@ PVCTEST_F(PreambleCfeState, givenXeHpcAndKernelExecutionTypeAndRevisionWhenCalli
|
||||
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());
|
||||
@ -48,29 +47,6 @@ PVCTEST_F(PreambleCfeState, givenXeHpcAndKernelExecutionTypeAndRevisionWhenCalli
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
|
@ -455,6 +455,8 @@ XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenRevisionBAndAboveWhenSpecialMo
|
||||
{0x7, false},
|
||||
};
|
||||
for (auto &testInput : testInputs) {
|
||||
for (auto &deviceId : PVC_XL_IDS) {
|
||||
hwInfo->platform.usDeviceID = deviceId;
|
||||
hwInfo->platform.usRevId = testInput.revId;
|
||||
cmdContainer->lastPipelineSelectModeRequired = false;
|
||||
|
||||
@ -465,6 +467,7 @@ XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenRevisionBAndAboveWhenSpecialMo
|
||||
EXPECT_EQ(testInput.expectedValue, cmdContainer->lastPipelineSelectModeRequired);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenRevisionBAndAboveWhenSpecialModeRequiredAndAdjustPipelineSelectCalledThenDontEnableSystolicMode) {
|
||||
using PIPELINE_SELECT = typename FamilyType::PIPELINE_SELECT;
|
||||
@ -489,6 +492,8 @@ XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenRevisionBAndAboveWhenSpecialMo
|
||||
{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;
|
||||
@ -502,3 +507,4 @@ XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenRevisionBAndAboveWhenSpecialMo
|
||||
cmdContainer->reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -40,16 +40,18 @@ XE_HPC_CORETEST_F(WalkerDispatchTestsXeHpcCore, whenEncodeAdditionalWalkerFields
|
||||
}
|
||||
|
||||
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) {
|
||||
using COMPUTE_WALKER = typename FamilyType::COMPUTE_WALKER;
|
||||
@ -68,26 +70,3 @@ XE_HPC_CORETEST_F(WalkerDispatchTestsXeHpcCore, givenPvcWhenEncodeAdditionalWalk
|
||||
EXPECT_TRUE(walkerCmd.getComputeDispatchAllWalkerEnable());
|
||||
}
|
||||
}
|
||||
|
||||
XE_HPC_CORETEST_F(WalkerDispatchTestsXeHpcCore, givenPvcXtTemporaryWhenEncodeAdditionalWalkerFieldsIsCalledThenComputeDispatchAllIsCorrectlySet) {
|
||||
using COMPUTE_WALKER = typename FamilyType::COMPUTE_WALKER;
|
||||
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
hwInfo.platform.usDeviceID = 0x0BE5;
|
||||
|
||||
if (hwInfo.platform.eProductFamily != IGFX_PVC) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
auto walkerCmd = FamilyType::cmdInitGpgpuWalker;
|
||||
|
||||
{
|
||||
EncodeDispatchKernel<FamilyType>::encodeAdditionalWalkerFields(hwInfo, walkerCmd, KernelExecutionType::Default);
|
||||
EXPECT_FALSE(walkerCmd.getComputeDispatchAllWalkerEnable());
|
||||
}
|
||||
|
||||
{
|
||||
EncodeDispatchKernel<FamilyType>::encodeAdditionalWalkerFields(hwInfo, walkerCmd, KernelExecutionType::Concurrent);
|
||||
EXPECT_TRUE(walkerCmd.getComputeDispatchAllWalkerEnable());
|
||||
}
|
||||
}
|
||||
|
15
shared/test/unit_test/xe_hpc_core/pvc/CMakeLists.txt
Normal file
15
shared/test/unit_test/xe_hpc_core/pvc/CMakeLists.txt
Normal file
@ -0,0 +1,15 @@
|
||||
#
|
||||
# Copyright (C) 2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
if(TESTS_PVC)
|
||||
set(NEO_SHARED_TESTS_PVC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_tests_pvc.cpp
|
||||
)
|
||||
|
||||
target_sources(${TARGET_NAME} PRIVATE ${NEO_SHARED_TESTS_PVC})
|
||||
add_subdirectories()
|
||||
endif()
|
54
shared/test/unit_test/xe_hpc_core/pvc/hw_info_tests_pvc.cpp
Normal file
54
shared/test/unit_test/xe_hpc_core/pvc/hw_info_tests_pvc.cpp
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using PvcConfigHwInfoTests = ::testing::Test;
|
||||
|
||||
PVCTEST_F(PvcConfigHwInfoTests, givenPvcDeviceIdsAndRevisionsWhenCheckingConfigsThenReturnCorrectValues) {
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
|
||||
for (auto &deviceId : PVC_XL_IDS) {
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
EXPECT_TRUE(PVC::isXl(hwInfo));
|
||||
EXPECT_FALSE(PVC::isXt(hwInfo));
|
||||
|
||||
hwInfo.platform.usRevId = 0x0;
|
||||
EXPECT_TRUE(PVC::isXlA0(hwInfo));
|
||||
EXPECT_TRUE(PVC::isAtMostXtA0(hwInfo));
|
||||
|
||||
hwInfo.platform.usRevId = 0x1;
|
||||
EXPECT_TRUE(PVC::isXlA0(hwInfo));
|
||||
EXPECT_TRUE(PVC::isAtMostXtA0(hwInfo));
|
||||
|
||||
hwInfo.platform.usRevId = 0x6;
|
||||
EXPECT_FALSE(PVC::isXlA0(hwInfo));
|
||||
EXPECT_FALSE(PVC::isAtMostXtA0(hwInfo));
|
||||
}
|
||||
|
||||
for (auto &deviceId : PVC_XT_IDS) {
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
EXPECT_FALSE(PVC::isXl(hwInfo));
|
||||
EXPECT_TRUE(PVC::isXt(hwInfo));
|
||||
|
||||
hwInfo.platform.usRevId = 0x0;
|
||||
EXPECT_TRUE(PVC::isAtMostXtA0(hwInfo));
|
||||
|
||||
hwInfo.platform.usRevId = 0x1;
|
||||
EXPECT_TRUE(PVC::isAtMostXtA0(hwInfo));
|
||||
|
||||
hwInfo.platform.usRevId = 0x3;
|
||||
EXPECT_TRUE(PVC::isAtMostXtA0(hwInfo));
|
||||
|
||||
hwInfo.platform.usRevId = 0x5;
|
||||
EXPECT_FALSE(PVC::isAtMostXtA0(hwInfo));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user