mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
refactor: improve PVC unit tests
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
af7bcbf99c
commit
2e9a7d7dca
@@ -15,13 +15,10 @@
|
||||
template <typename FamilyType>
|
||||
void CommandStreamReceiverSystolicFixture::testBody() {
|
||||
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
|
||||
if (!commandStreamReceiver.pipelineSupportFlags.systolicMode) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
StreamProperties &streamProperties = commandStreamReceiver.getStreamProperties();
|
||||
|
||||
bool systolicModeSupported = commandStreamReceiver.pipelineSupportFlags.systolicMode;
|
||||
|
||||
commandStreamReceiver.isPreambleSent = true;
|
||||
commandStreamReceiver.lastMediaSamplerConfig = false;
|
||||
|
||||
@@ -36,8 +33,13 @@ void CommandStreamReceiverSystolicFixture::testBody() {
|
||||
taskLevel,
|
||||
flushTaskFlags,
|
||||
*pDevice);
|
||||
EXPECT_EQ(true, commandStreamReceiver.lastSystolicPipelineSelectMode);
|
||||
EXPECT_EQ(1, streamProperties.pipelineSelect.systolicMode.value);
|
||||
if (systolicModeSupported) {
|
||||
EXPECT_EQ(true, commandStreamReceiver.lastSystolicPipelineSelectMode);
|
||||
EXPECT_EQ(1, streamProperties.pipelineSelect.systolicMode.value);
|
||||
} else {
|
||||
EXPECT_EQ(false, commandStreamReceiver.lastSystolicPipelineSelectMode);
|
||||
EXPECT_EQ(-1, streamProperties.pipelineSelect.systolicMode.value);
|
||||
}
|
||||
|
||||
flushTaskFlags.pipelineSelectArgs.systolicPipelineSelectMode = false;
|
||||
|
||||
@@ -50,5 +52,10 @@ void CommandStreamReceiverSystolicFixture::testBody() {
|
||||
flushTaskFlags,
|
||||
*pDevice);
|
||||
EXPECT_EQ(false, commandStreamReceiver.lastSystolicPipelineSelectMode);
|
||||
EXPECT_EQ(0, streamProperties.pipelineSelect.systolicMode.value);
|
||||
|
||||
if (systolicModeSupported) {
|
||||
EXPECT_EQ(0, streamProperties.pipelineSelect.systolicMode.value);
|
||||
} else {
|
||||
EXPECT_EQ(-1, streamProperties.pipelineSelect.systolicMode.value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -362,7 +362,7 @@ TEST(UnpackSingleDeviceBinaryZebin, WhenMachineIsIntelGTAndIntelGTNoteSectionIsV
|
||||
targetDevice.maxPointerSizeInBytes = 8;
|
||||
targetDevice.productFamily = productFamily;
|
||||
targetDevice.coreFamily = renderCoreFamily;
|
||||
targetDevice.stepping = NEO::hardwareInfoTable[productFamily]->platform.usRevId;
|
||||
targetDevice.stepping = NEO::hardwareInfoTable[productFamily]->platform.usRevId & 0x1F; // mask to 5 bits (minHwRevisionId and maxHwRevisionId size)
|
||||
|
||||
NEO::Zebin::Elf::ZebinTargetFlags targetMetadata;
|
||||
targetMetadata.validateRevisionId = true;
|
||||
|
||||
@@ -5534,7 +5534,7 @@ TEST_F(IntelGTNotesFixture, WhenValidatingTargetDeviceGivenValidTargetDeviceAndV
|
||||
targetDevice.productFamily = productFamily;
|
||||
targetDevice.coreFamily = renderCoreFamily;
|
||||
targetDevice.maxPointerSizeInBytes = 8;
|
||||
targetDevice.stepping = hardwareInfoTable[productFamily]->platform.usRevId;
|
||||
targetDevice.stepping = hardwareInfoTable[productFamily]->platform.usRevId & 0x1F; // mask to 5 bits (minHwRevisionId and maxHwRevisionId size)
|
||||
|
||||
std::vector<NEO::Elf::ElfNoteSection> elfNoteSections;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
@@ -5619,7 +5619,7 @@ TEST(ValidateTargetDevice32BitZebin, Given32BitZebinAndValidIntelGTNotesWhenVali
|
||||
targetDevice.productFamily = productFamily;
|
||||
targetDevice.coreFamily = renderCoreFamily;
|
||||
targetDevice.maxPointerSizeInBytes = 4;
|
||||
targetDevice.stepping = hardwareInfoTable[productFamily]->platform.usRevId;
|
||||
targetDevice.stepping = hardwareInfoTable[productFamily]->platform.usRevId & 0x1F; // mask to 5 bits (minHwRevisionId and maxHwRevisionId size)
|
||||
|
||||
ZebinTestData::ValidEmptyProgram<NEO::Elf::EI_CLASS_32> zebin;
|
||||
zebin.elfHeader->type = NEO::Elf::ET_REL;
|
||||
@@ -5648,7 +5648,7 @@ TEST(ValidateTargetDeviceGeneratorZebin, GivenZebinAndValidIntelGTNotesWithGener
|
||||
targetDevice.productFamily = productFamily;
|
||||
targetDevice.coreFamily = renderCoreFamily;
|
||||
targetDevice.maxPointerSizeInBytes = 4;
|
||||
targetDevice.stepping = hardwareInfoTable[productFamily]->platform.usRevId;
|
||||
targetDevice.stepping = hardwareInfoTable[productFamily]->platform.usRevId & 0x1F; // mask to 5 bits (minHwRevisionId and maxHwRevisionId size)
|
||||
|
||||
ZebinTestData::ValidEmptyProgram<NEO::Elf::EI_CLASS_32> zebin;
|
||||
zebin.elfHeader->type = NEO::Elf::ET_REL;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/helpers/variable_backup.h"
|
||||
#include "shared/test/common/libult/ult_command_stream_receiver.h"
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/mocks/mock_l0_debugger.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
@@ -1427,10 +1428,15 @@ HWTEST2_F(CommandEncodeStatesTest,
|
||||
cmdContainer->getCommandStream()->getUsed());
|
||||
|
||||
auto itorCmd = find<PIPELINE_SELECT *>(commands.begin(), commands.end());
|
||||
ASSERT_NE(itorCmd, commands.end());
|
||||
|
||||
auto cmd = genCmdCast<PIPELINE_SELECT *>(*itorCmd);
|
||||
EXPECT_EQ(cmd->getSystolicModeEnable(), dpasModeRequired);
|
||||
if (pDevice->getUltCommandStreamReceiver<FamilyType>().pipelineSupportFlags.systolicMode) {
|
||||
ASSERT_NE(itorCmd, commands.end());
|
||||
|
||||
auto cmd = genCmdCast<PIPELINE_SELECT *>(*itorCmd);
|
||||
EXPECT_EQ(cmd->getSystolicModeEnable(), dpasModeRequired);
|
||||
} else {
|
||||
EXPECT_EQ(itorCmd, commands.end());
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandEncodeStatesTest,
|
||||
@@ -1457,10 +1463,15 @@ HWTEST2_F(CommandEncodeStatesTest,
|
||||
cmdContainer->getCommandStream()->getUsed());
|
||||
|
||||
auto itorCmd = find<PIPELINE_SELECT *>(commands.begin(), commands.end());
|
||||
ASSERT_NE(itorCmd, commands.end());
|
||||
|
||||
auto cmd = genCmdCast<PIPELINE_SELECT *>(*itorCmd);
|
||||
EXPECT_EQ(cmd->getSystolicModeEnable(), !dpasModeRequired);
|
||||
if (pDevice->getUltCommandStreamReceiver<FamilyType>().pipelineSupportFlags.systolicMode) {
|
||||
ASSERT_NE(itorCmd, commands.end());
|
||||
|
||||
auto cmd = genCmdCast<PIPELINE_SELECT *>(*itorCmd);
|
||||
EXPECT_EQ(cmd->getSystolicModeEnable(), !dpasModeRequired);
|
||||
} else {
|
||||
EXPECT_EQ(itorCmd, commands.end());
|
||||
}
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest,
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "shared/source/kernel/grf_config.h"
|
||||
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/libult/ult_command_stream_receiver.h"
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
#include "shared/test/unit_test/fixtures/command_container_fixture.h"
|
||||
@@ -60,10 +61,11 @@ HWTEST2_F(CommandEncodeStatesTest, givenCommandContainerWithKernelDpasThenSystol
|
||||
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
|
||||
|
||||
auto itorCmd = find<PIPELINE_SELECT *>(commands.begin(), commands.end());
|
||||
ASSERT_NE(itorCmd, commands.end());
|
||||
|
||||
ASSERT_NE(itorCmd, commands.end());
|
||||
auto cmd = genCmdCast<PIPELINE_SELECT *>(*itorCmd);
|
||||
EXPECT_TRUE(cmd->getSystolicModeEnable());
|
||||
|
||||
EXPECT_EQ(pDevice->getUltCommandStreamReceiver<FamilyType>().pipelineSupportFlags.systolicMode, cmd->getSystolicModeEnable());
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandEncodeStatesTest, givenCommandContainerWithNoKernelDpasThenSystolicModeIsNotEnabled, IsWithinXeGfxFamily) {
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#include "shared/test/common/mocks/ult_device_factory.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
#include "hw_cmds.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
TEST(MemoryManagerTest, givenSetUseSytemMemoryWhenGraphicsAllocationInDevicePoolIsAllocatedThenNullptrIsReturned) {
|
||||
@@ -870,39 +872,3 @@ HWTEST2_F(MemoryManagerDirectSubmissionImplicitScalingTest, givenDirectSubmissio
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(MemoryManagerDirectSubmissionImplicitScalingTest, givenDirectSubmissionForceLocalMemoryStorageEnabledForAllEnginesWhenAllocatingMemoryForCommandOrRingOrSemaphoreBufferThenFirstBankIsSelected, IsPVC) {
|
||||
DebugManager.flags.DirectSubmissionForceLocalMemoryStorageMode.set(2);
|
||||
for (auto &multiTile : ::testing::Bool()) {
|
||||
for (auto &allocationType : {AllocationType::COMMAND_BUFFER, AllocationType::RING_BUFFER, AllocationType::SEMAPHORE_BUFFER}) {
|
||||
allocationProperties->allocationType = allocationType;
|
||||
allocationProperties->flags.multiOsContextCapable = multiTile;
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryInPreferredPool(*allocationProperties, nullptr);
|
||||
|
||||
EXPECT_NE(nullptr, allocation);
|
||||
|
||||
EXPECT_EQ(MemoryPool::LocalMemory, allocation->getMemoryPool());
|
||||
EXPECT_EQ(firstTileMask, allocation->storageInfo.getMemoryBanks());
|
||||
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(MemoryManagerDirectSubmissionImplicitScalingTest, givenDirectSubmissionForceLocalMemoryStorageDefaultModeWhenAllocatingMemoryForCommandOrRingOrSemaphoreBufferThenFirstBankIsSelected, IsPVC) {
|
||||
DebugManager.flags.DirectSubmissionForceLocalMemoryStorageMode.set(-1);
|
||||
for (auto &multiTile : ::testing::Bool()) {
|
||||
for (auto &allocationType : {AllocationType::COMMAND_BUFFER, AllocationType::RING_BUFFER, AllocationType::SEMAPHORE_BUFFER}) {
|
||||
allocationProperties->allocationType = allocationType;
|
||||
allocationProperties->flags.multiOsContextCapable = multiTile;
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryInPreferredPool(*allocationProperties, nullptr);
|
||||
|
||||
EXPECT_NE(nullptr, allocation);
|
||||
|
||||
EXPECT_EQ(MemoryPool::LocalMemory, allocation->getMemoryPool());
|
||||
EXPECT_EQ(firstTileMask, allocation->storageInfo.getMemoryBanks());
|
||||
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
* Copyright (C) 2022-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/memory_manager/local_memory_usage.h"
|
||||
#include "shared/source/xe_hpc_core/hw_cmds_pvc.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/helpers/ult_hw_config.h"
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||
#include "shared/test/common/mocks/mock_memory_manager.h"
|
||||
#include "shared/test/common/mocks/ult_device_factory.h"
|
||||
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using DeviceTestsPvc = ::testing::Test;
|
||||
@@ -43,3 +45,103 @@ PVCTEST_F(DeviceTestsPvc, WhenDeviceIsCreatedThenOnlyOneCcsEngineIsExposed) {
|
||||
auto computeEngineGroup = device->getRegularEngineGroups()[computeEngineGroupIndex];
|
||||
EXPECT_EQ(1u, computeEngineGroup.engines.size());
|
||||
}
|
||||
|
||||
struct MemoryManagerDirectSubmissionImplicitScalingPvcTest : public ::testing::Test {
|
||||
|
||||
void SetUp() override {
|
||||
DebugManager.flags.CreateMultipleSubDevices.set(numSubDevices);
|
||||
executionEnvironment = std::make_unique<MockExecutionEnvironment>(defaultHwInfo.get());
|
||||
auto allTilesMask = executionEnvironment->rootDeviceEnvironments[mockRootDeviceIndex]->deviceAffinityMask.getGenericSubDevicesMask();
|
||||
|
||||
allocationProperties = std::make_unique<AllocationProperties>(mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::UNKNOWN, allTilesMask);
|
||||
allocationProperties->flags.multiOsContextCapable = true;
|
||||
|
||||
constexpr auto enableLocalMemory = true;
|
||||
memoryManager = std::make_unique<MockMemoryManager>(false, enableLocalMemory, *executionEnvironment);
|
||||
|
||||
memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->reserveOnBanks(1u, MemoryConstants::pageSize2M);
|
||||
EXPECT_NE(0u, memoryManager->internalLocalMemoryUsageBankSelector[mockRootDeviceIndex]->getLeastOccupiedBank(allTilesMask));
|
||||
}
|
||||
|
||||
DebugManagerStateRestore restorer{};
|
||||
|
||||
constexpr static DeviceBitfield firstTileMask{1u};
|
||||
constexpr static auto numSubDevices = 2u;
|
||||
std::unique_ptr<MockExecutionEnvironment> executionEnvironment{};
|
||||
std::unique_ptr<AllocationProperties> allocationProperties{};
|
||||
std::unique_ptr<MockMemoryManager> memoryManager{};
|
||||
};
|
||||
|
||||
PVCTEST_F(MemoryManagerDirectSubmissionImplicitScalingPvcTest, givenDirectSubmissionForceLocalMemoryStorageEnabledForAllEnginesWhenAllocatingMemoryForCommandOrRingOrSemaphoreBufferThenFirstBankIsSelected) {
|
||||
DebugManager.flags.DirectSubmissionForceLocalMemoryStorageMode.set(2);
|
||||
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
|
||||
for (auto bdA0 : ::testing::Bool()) {
|
||||
uint32_t expectedPlacement = 0b10;
|
||||
|
||||
if (bdA0) {
|
||||
hwInfo.platform.usRevId &= ~PVC::pvcBaseDieRevMask;
|
||||
} else {
|
||||
hwInfo.platform.usRevId |= PVC::pvcBaseDieRevMask;
|
||||
}
|
||||
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(&hwInfo);
|
||||
|
||||
for (auto &multiTile : ::testing::Bool()) {
|
||||
if (multiTile || bdA0) {
|
||||
expectedPlacement = static_cast<uint32_t>(firstTileMask.to_ulong());
|
||||
}
|
||||
|
||||
for (auto &allocationType : {AllocationType::COMMAND_BUFFER, AllocationType::RING_BUFFER, AllocationType::SEMAPHORE_BUFFER}) {
|
||||
allocationProperties->allocationType = allocationType;
|
||||
allocationProperties->flags.multiOsContextCapable = multiTile;
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryInPreferredPool(*allocationProperties, nullptr);
|
||||
|
||||
EXPECT_NE(nullptr, allocation);
|
||||
|
||||
EXPECT_EQ(MemoryPool::LocalMemory, allocation->getMemoryPool());
|
||||
EXPECT_EQ(expectedPlacement, allocation->storageInfo.getMemoryBanks());
|
||||
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PVCTEST_F(MemoryManagerDirectSubmissionImplicitScalingPvcTest, givenDirectSubmissionForceLocalMemoryStorageDefaultModeWhenAllocatingMemoryForCommandOrRingOrSemaphoreBufferThenFirstBankIsSelected) {
|
||||
DebugManager.flags.DirectSubmissionForceLocalMemoryStorageMode.set(-1);
|
||||
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
|
||||
for (auto bdA0 : ::testing::Bool()) {
|
||||
uint32_t expectedPlacement = 0b10;
|
||||
|
||||
if (bdA0) {
|
||||
hwInfo.platform.usRevId &= ~PVC::pvcBaseDieRevMask;
|
||||
} else {
|
||||
hwInfo.platform.usRevId |= PVC::pvcBaseDieRevMask;
|
||||
}
|
||||
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(&hwInfo);
|
||||
|
||||
for (auto &multiTile : ::testing::Bool()) {
|
||||
if (multiTile || bdA0) {
|
||||
expectedPlacement = static_cast<uint32_t>(firstTileMask.to_ulong());
|
||||
}
|
||||
|
||||
for (auto &allocationType : {AllocationType::COMMAND_BUFFER, AllocationType::RING_BUFFER, AllocationType::SEMAPHORE_BUFFER}) {
|
||||
allocationProperties->allocationType = allocationType;
|
||||
allocationProperties->flags.multiOsContextCapable = multiTile;
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryInPreferredPool(*allocationProperties, nullptr);
|
||||
|
||||
EXPECT_NE(nullptr, allocation);
|
||||
|
||||
EXPECT_EQ(MemoryPool::LocalMemory, allocation->getMemoryPool());
|
||||
EXPECT_EQ(expectedPlacement, allocation->storageInfo.getMemoryBanks());
|
||||
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,6 +82,7 @@ PVCTEST_F(EngineNodeHelperPvcTests, givenPvcBaseDieA0AndTile1WhenGettingBcsEngin
|
||||
auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment();
|
||||
auto pHwInfo = rootDeviceEnvironment.getMutableHardwareInfo();
|
||||
pHwInfo->featureTable.ftrBcsInfo = 0b11111;
|
||||
pHwInfo->platform.usRevId &= ~PVC::pvcBaseDieRevMask;
|
||||
auto deviceBitfield = 0b10;
|
||||
auto &selectorCopyEngine = pDevice->getNearestGenericSubDevice(0)->getSelectorCopyEngine();
|
||||
|
||||
@@ -108,24 +109,50 @@ PVCTEST_F(EngineNodeHelperPvcTests, givenCccsDisabledButDebugVariableSetWhenGetG
|
||||
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS;
|
||||
hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 4;
|
||||
|
||||
auto productHelper = ProductHelper::create(hwInfo.platform.eProductFamily);
|
||||
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.NodeOrdinal.set(static_cast<int32_t>(aub_stream::EngineType::ENGINE_CCCS));
|
||||
|
||||
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));
|
||||
auto &gfxCoreHelper = device->getGfxCoreHelper();
|
||||
EXPECT_EQ(9u, device->allEngines.size());
|
||||
auto &engines = gfxCoreHelper.getGpgpuEngineInstances(device->getRootDeviceEnvironment());
|
||||
EXPECT_EQ(9u, engines.size());
|
||||
for (uint32_t stepping : {REVISION_A0, REVISION_B}) {
|
||||
hwInfo.platform.usRevId = productHelper->getHwRevIdFromStepping(stepping, hwInfo);
|
||||
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS, engines[0].first);
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS1, engines[1].first);
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS2, engines[2].first);
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS3, engines[3].first);
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCCS, engines[4].first);
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCCS, engines[5].first); // low priority
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCCS, engines[6].first); // internal
|
||||
EXPECT_EQ(aub_stream::ENGINE_BCS, engines[7].first); // internal
|
||||
EXPECT_EQ(aub_stream::ENGINE_BCS, engines[8].first);
|
||||
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));
|
||||
|
||||
auto &gfxCoreHelper = device->getGfxCoreHelper();
|
||||
|
||||
bool cooperativeDispatchSupported = productHelper->isCooperativeEngineSupported(hwInfo);
|
||||
|
||||
EXPECT_EQ((stepping == REVISION_B), cooperativeDispatchSupported);
|
||||
|
||||
EXPECT_EQ(cooperativeDispatchSupported ? 13u : 9u, device->allEngines.size());
|
||||
auto &engines = gfxCoreHelper.getGpgpuEngineInstances(device->getRootDeviceEnvironment());
|
||||
EXPECT_EQ(cooperativeDispatchSupported ? 13u : 9u, engines.size());
|
||||
|
||||
uint32_t index = 0;
|
||||
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS, engines[index].first);
|
||||
if (cooperativeDispatchSupported) {
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS, engines[++index].first);
|
||||
}
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS1, engines[++index].first);
|
||||
if (cooperativeDispatchSupported) {
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS1, engines[++index].first);
|
||||
}
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS2, engines[++index].first);
|
||||
if (cooperativeDispatchSupported) {
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS2, engines[++index].first);
|
||||
}
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS3, engines[++index].first);
|
||||
if (cooperativeDispatchSupported) {
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS3, engines[++index].first);
|
||||
}
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCCS, engines[++index].first);
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCCS, engines[++index].first); // low priority
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCCS, engines[++index].first); // internal
|
||||
EXPECT_EQ(aub_stream::ENGINE_BCS, engines[++index].first); // internal
|
||||
EXPECT_EQ(aub_stream::ENGINE_BCS, engines[++index].first);
|
||||
}
|
||||
}
|
||||
|
||||
PVCTEST_F(EngineNodeHelperPvcTests, givenCccsDisabledWhenGetGpgpuEnginesCalledThenDontSetCccs) {
|
||||
@@ -137,20 +164,45 @@ PVCTEST_F(EngineNodeHelperPvcTests, givenCccsDisabledWhenGetGpgpuEnginesCalledTh
|
||||
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS;
|
||||
hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 4;
|
||||
|
||||
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));
|
||||
auto &gfxCoreHelper = device->getGfxCoreHelper();
|
||||
EXPECT_EQ(8u, device->allEngines.size());
|
||||
auto &engines = gfxCoreHelper.getGpgpuEngineInstances(device->getRootDeviceEnvironment());
|
||||
EXPECT_EQ(8u, engines.size());
|
||||
auto productHelper = ProductHelper::create(hwInfo.platform.eProductFamily);
|
||||
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS, engines[0].first);
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS1, engines[1].first);
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS2, engines[2].first);
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS3, engines[3].first);
|
||||
EXPECT_EQ(hwInfo.capabilityTable.defaultEngineType, engines[4].first); // low priority
|
||||
EXPECT_EQ(hwInfo.capabilityTable.defaultEngineType, engines[5].first); // internal
|
||||
EXPECT_EQ(aub_stream::ENGINE_BCS, engines[6].first);
|
||||
EXPECT_EQ(aub_stream::ENGINE_BCS, engines[7].first);
|
||||
for (uint32_t stepping : {REVISION_A0, REVISION_B}) {
|
||||
hwInfo.platform.usRevId = productHelper->getHwRevIdFromStepping(stepping, hwInfo);
|
||||
|
||||
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));
|
||||
auto &gfxCoreHelper = device->getGfxCoreHelper();
|
||||
|
||||
bool cooperativeDispatchSupported = productHelper->isCooperativeEngineSupported(hwInfo);
|
||||
|
||||
EXPECT_EQ((stepping == REVISION_B), cooperativeDispatchSupported);
|
||||
|
||||
EXPECT_EQ(cooperativeDispatchSupported ? 12u : 8u, device->allEngines.size());
|
||||
auto &engines = gfxCoreHelper.getGpgpuEngineInstances(device->getRootDeviceEnvironment());
|
||||
EXPECT_EQ(cooperativeDispatchSupported ? 12u : 8u, engines.size());
|
||||
|
||||
uint32_t index = 0;
|
||||
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS, engines[index].first);
|
||||
if (cooperativeDispatchSupported) {
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS, engines[++index].first);
|
||||
}
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS1, engines[++index].first);
|
||||
if (cooperativeDispatchSupported) {
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS1, engines[++index].first);
|
||||
}
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS2, engines[++index].first);
|
||||
if (cooperativeDispatchSupported) {
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS2, engines[++index].first);
|
||||
}
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS3, engines[++index].first);
|
||||
if (cooperativeDispatchSupported) {
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS3, engines[++index].first);
|
||||
}
|
||||
EXPECT_EQ(hwInfo.capabilityTable.defaultEngineType, engines[++index].first); // low priority
|
||||
EXPECT_EQ(hwInfo.capabilityTable.defaultEngineType, engines[++index].first); // internal
|
||||
EXPECT_EQ(aub_stream::ENGINE_BCS, engines[++index].first);
|
||||
EXPECT_EQ(aub_stream::ENGINE_BCS, engines[++index].first);
|
||||
}
|
||||
}
|
||||
|
||||
PVCTEST_F(EngineNodeHelperPvcTests, givenCCSEngineWhenCallingIsCooperativeDispatchSupportedThenTrueIsReturned) {
|
||||
@@ -159,8 +211,7 @@ PVCTEST_F(EngineNodeHelperPvcTests, givenCCSEngineWhenCallingIsCooperativeDispat
|
||||
auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo();
|
||||
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS;
|
||||
|
||||
auto engineGroupType = gfxCoreHelper.getEngineGroupType(pDevice->getDefaultEngine().getEngineType(),
|
||||
pDevice->getDefaultEngine().getEngineUsage(), hwInfo);
|
||||
auto engineGroupType = gfxCoreHelper.getEngineGroupType(aub_stream::ENGINE_CCS, EngineUsage::Cooperative, hwInfo);
|
||||
auto retVal = gfxCoreHelper.isCooperativeDispatchSupported(engineGroupType, rootDeviceEnvironment);
|
||||
EXPECT_TRUE(retVal);
|
||||
}
|
||||
@@ -172,9 +223,9 @@ PVCTEST_F(EngineNodeHelperPvcTests, givenCCCSEngineAndRevisionBWhenCallingIsCoop
|
||||
auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo();
|
||||
|
||||
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCCS;
|
||||
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hwInfo);
|
||||
|
||||
auto engineGroupType = gfxCoreHelper.getEngineGroupType(pDevice->getDefaultEngine().getEngineType(),
|
||||
pDevice->getDefaultEngine().getEngineUsage(), hwInfo);
|
||||
auto engineGroupType = gfxCoreHelper.getEngineGroupType(aub_stream::ENGINE_CCCS, EngineUsage::Cooperative, hwInfo);
|
||||
auto retVal = gfxCoreHelper.isCooperativeDispatchSupported(engineGroupType, rootDeviceEnvironment);
|
||||
EXPECT_TRUE(retVal);
|
||||
|
||||
@@ -184,6 +235,8 @@ PVCTEST_F(EngineNodeHelperPvcTests, givenCCCSEngineAndRevisionBWhenCallingIsCoop
|
||||
}
|
||||
|
||||
PVCTEST_F(EngineNodeHelperPvcTests, givenBcsDisabledWhenGetEnginesCalledThenDontCreateAnyBcs) {
|
||||
const auto &productHelper = getHelper<ProductHelper>();
|
||||
|
||||
const size_t numEngines = 7;
|
||||
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
@@ -192,6 +245,8 @@ PVCTEST_F(EngineNodeHelperPvcTests, givenBcsDisabledWhenGetEnginesCalledThenDont
|
||||
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS;
|
||||
hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 4;
|
||||
|
||||
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hwInfo);
|
||||
|
||||
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));
|
||||
auto &gfxCoreHelper = device->getGfxCoreHelper();
|
||||
EXPECT_EQ(numEngines, device->allEngines.size());
|
||||
@@ -222,6 +277,8 @@ PVCTEST_F(EngineNodeHelperPvcTests, givenBcsDisabledWhenGetEnginesCalledThenDont
|
||||
}
|
||||
|
||||
PVCTEST_F(EngineNodeHelperPvcTests, givenOneBcsEnabledWhenGetEnginesCalledThenCreateOnlyOneBcs) {
|
||||
const auto &productHelper = getHelper<ProductHelper>();
|
||||
|
||||
const size_t numEngines = 9;
|
||||
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
@@ -231,6 +288,8 @@ PVCTEST_F(EngineNodeHelperPvcTests, givenOneBcsEnabledWhenGetEnginesCalledThenCr
|
||||
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS;
|
||||
hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 4;
|
||||
|
||||
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hwInfo);
|
||||
|
||||
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));
|
||||
auto &gfxCoreHelper = device->getGfxCoreHelper();
|
||||
EXPECT_EQ(numEngines, device->allEngines.size());
|
||||
@@ -263,6 +322,8 @@ PVCTEST_F(EngineNodeHelperPvcTests, givenOneBcsEnabledWhenGetEnginesCalledThenCr
|
||||
}
|
||||
|
||||
PVCTEST_F(EngineNodeHelperPvcTests, givenNotAllCopyEnginesWhenSettingEngineTableThenDontAddUnsupported) {
|
||||
const auto &productHelper = getHelper<ProductHelper>();
|
||||
|
||||
const size_t numEngines = 9;
|
||||
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
@@ -276,6 +337,8 @@ PVCTEST_F(EngineNodeHelperPvcTests, givenNotAllCopyEnginesWhenSettingEngineTable
|
||||
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS;
|
||||
hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 1;
|
||||
|
||||
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hwInfo);
|
||||
|
||||
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));
|
||||
auto &gfxCoreHelper = device->getGfxCoreHelper();
|
||||
EXPECT_EQ(numEngines, device->allEngines.size());
|
||||
@@ -308,6 +371,8 @@ PVCTEST_F(EngineNodeHelperPvcTests, givenNotAllCopyEnginesWhenSettingEngineTable
|
||||
}
|
||||
|
||||
PVCTEST_F(EngineNodeHelperPvcTests, givenOneCcsEnabledWhenGetEnginesCalledThenCreateOnlyOneCcs) {
|
||||
const auto &productHelper = getHelper<ProductHelper>();
|
||||
|
||||
const size_t numEngines = 15;
|
||||
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
@@ -317,6 +382,8 @@ PVCTEST_F(EngineNodeHelperPvcTests, givenOneCcsEnabledWhenGetEnginesCalledThenCr
|
||||
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS;
|
||||
hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 1;
|
||||
|
||||
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hwInfo);
|
||||
|
||||
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));
|
||||
auto &gfxCoreHelper = device->getGfxCoreHelper();
|
||||
EXPECT_EQ(numEngines, device->allEngines.size());
|
||||
@@ -355,6 +422,8 @@ PVCTEST_F(EngineNodeHelperPvcTests, givenOneCcsEnabledWhenGetEnginesCalledThenCr
|
||||
}
|
||||
|
||||
PVCTEST_F(EngineNodeHelperPvcTests, givenCccsAsDefaultEngineWhenGetEnginesCalledThenChangeDefaultEngine) {
|
||||
const auto &productHelper = getHelper<ProductHelper>();
|
||||
|
||||
const size_t numEngines = 18;
|
||||
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
@@ -364,6 +433,8 @@ PVCTEST_F(EngineNodeHelperPvcTests, givenCccsAsDefaultEngineWhenGetEnginesCalled
|
||||
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCCS;
|
||||
hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 4;
|
||||
|
||||
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hwInfo);
|
||||
|
||||
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));
|
||||
auto &gfxCoreHelper = device->getGfxCoreHelper();
|
||||
EXPECT_EQ(numEngines, device->allEngines.size());
|
||||
@@ -405,6 +476,8 @@ PVCTEST_F(EngineNodeHelperPvcTests, givenCccsAsDefaultEngineWhenGetEnginesCalled
|
||||
}
|
||||
|
||||
PVCTEST_F(EngineNodeHelperPvcTests, whenGetGpgpuEnginesThenReturnTwoCccsEnginesAndFourCcsEnginesAndEightLinkCopyEngines) {
|
||||
const auto &productHelper = getHelper<ProductHelper>();
|
||||
|
||||
const size_t numEngines = 18;
|
||||
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
@@ -414,6 +487,8 @@ PVCTEST_F(EngineNodeHelperPvcTests, whenGetGpgpuEnginesThenReturnTwoCccsEnginesA
|
||||
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS;
|
||||
hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 4;
|
||||
|
||||
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hwInfo);
|
||||
|
||||
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));
|
||||
auto &gfxCoreHelper = device->getGfxCoreHelper();
|
||||
EXPECT_EQ(numEngines, device->allEngines.size());
|
||||
@@ -455,6 +530,8 @@ PVCTEST_F(EngineNodeHelperPvcTests, whenGetGpgpuEnginesThenReturnTwoCccsEnginesA
|
||||
}
|
||||
|
||||
PVCTEST_F(EngineNodeHelperPvcTests, whenGetGpgpuEnginesThenReturnTwoCccsEnginesAndFourCcsEnginesAndLinkCopyEngines) {
|
||||
const auto &productHelper = getHelper<ProductHelper>();
|
||||
|
||||
const size_t numEngines = 18;
|
||||
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
@@ -464,6 +541,8 @@ PVCTEST_F(EngineNodeHelperPvcTests, whenGetGpgpuEnginesThenReturnTwoCccsEnginesA
|
||||
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS;
|
||||
hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 4;
|
||||
|
||||
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hwInfo);
|
||||
|
||||
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));
|
||||
auto &gfxCoreHelper = device->getGfxCoreHelper();
|
||||
EXPECT_EQ(numEngines, device->allEngines.size());
|
||||
|
||||
@@ -145,6 +145,9 @@ PVCTEST_F(PvcProductHelper, givenPvcWhenCallingGetDeviceMemoryNameThenHbmIsRetur
|
||||
|
||||
PVCTEST_F(PvcProductHelper, givenProductHelperWhenAdditionalKernelExecInfoSupportCheckedThenCorrectValueIsReturned) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
|
||||
hwInfo.platform.usRevId = productHelper->getHwRevIdFromStepping(REVISION_A0, hwInfo);
|
||||
|
||||
EXPECT_FALSE(productHelper->isDisableOverdispatchAvailable(hwInfo));
|
||||
|
||||
FrontEndPropertiesSupport fePropertiesSupport{};
|
||||
|
||||
Reference in New Issue
Block a user