mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
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:
committed by
Compute-Runtime-Automation
parent
ff662b3e88
commit
8180e95e0f
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user