fix: ensure pollForCompletion in aub on program termination

Related-To: NEO-14867

Signed-off-by: Grochowski, Stanislaw <stanislaw.grochowski@intel.com>
This commit is contained in:
Grochowski, Stanislaw
2025-07-02 12:44:21 +00:00
committed by Compute-Runtime-Automation
parent ff662b3e88
commit 8180e95e0f
8 changed files with 59 additions and 2 deletions

View File

@@ -3376,6 +3376,28 @@ HWTEST_F(CommandStreamReceiverHwTest, givenVariousCsrModeWhenGettingTbxModeThenE
EXPECT_TRUE(ultCsr.isTbxMode());
}
HWTEST_F(CommandStreamReceiverHwTest, givenVariousCsrModeWhenGettingAubModeThenReturnedValueIsCorrect) {
auto &ultCsr = pDevice->getUltCommandStreamReceiver<FamilyType>();
ultCsr.commandStreamReceiverType = CommandStreamReceiverType::hardware;
EXPECT_FALSE(ultCsr.isAubMode());
ultCsr.commandStreamReceiverType = CommandStreamReceiverType::hardwareWithAub;
EXPECT_TRUE(ultCsr.isAubMode());
ultCsr.commandStreamReceiverType = CommandStreamReceiverType::aub;
EXPECT_TRUE(ultCsr.isAubMode());
ultCsr.commandStreamReceiverType = CommandStreamReceiverType::tbx;
EXPECT_FALSE(ultCsr.isAubMode());
ultCsr.commandStreamReceiverType = CommandStreamReceiverType::tbxWithAub;
EXPECT_TRUE(ultCsr.isAubMode());
ultCsr.commandStreamReceiverType = CommandStreamReceiverType::nullAub;
EXPECT_TRUE(ultCsr.isAubMode());
}
HWTEST_F(CommandStreamReceiverHwTest, GivenTwoRootDevicesWhengetMultiRootDeviceTimestampPacketAllocatorCalledThenAllocatorForTwoDevicesCreated) {
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>(defaultHwInfo.get(), true, 2u);
auto devices = DeviceFactory::createDevices(*executionEnvironment.release());

View File

@@ -43,6 +43,7 @@
#include "shared/test/common/mocks/ult_device_factory.h"
#include "shared/test/common/test_macros/hw_test.h"
#include "shared/test/common/test_macros/test.h"
using namespace NEO;
extern ApiSpecificConfig::ApiType apiTypeForUlts;
namespace NEO {
@@ -2704,3 +2705,21 @@ TEST(GroupDevicesTest, givenNullInputInDeviceVectorWhenGroupDevicesThenEmptyVect
EXPECT_TRUE(groupedDevices.empty());
}
HWTEST_F(DeviceTests, givenDeviceWhenPollForCompletionCalledThenPollForCompletionCalledOnAllCommandStreamReceivers) {
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
std::vector<uint32_t> csrCallCounts;
csrCallCounts.reserve(device->commandStreamReceivers.size());
for (uint32_t csrIndex = 0; csrIndex < device->commandStreamReceivers.size(); csrIndex++) {
auto &csr = device->getUltCommandStreamReceiverFromIndex<FamilyType>(csrIndex);
csrCallCounts.push_back(csr.pollForCompletionCalled);
}
device->pollForCompletion();
for (uint32_t csrIndex = 0; csrIndex < device->commandStreamReceivers.size(); csrIndex++) {
auto &csr = device->getUltCommandStreamReceiverFromIndex<FamilyType>(csrIndex);
EXPECT_EQ(csrCallCounts[csrIndex] + 1, csr.pollForCompletionCalled);
}
}