mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-30 09:58:55 +08:00
Command stream receiver: handle flush method failure when flushing BCS task
Related-To: NEO-7412 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
27d042107a
commit
33e1b3a717
@@ -163,6 +163,9 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
|
||||
}
|
||||
|
||||
NEO::SubmissionStatus flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override {
|
||||
if (flushReturnValue) {
|
||||
return *flushReturnValue;
|
||||
}
|
||||
if (recordFlusheBatchBuffer) {
|
||||
latestFlushedBatchBuffer = batchBuffer;
|
||||
}
|
||||
@@ -393,6 +396,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
|
||||
std::optional<WaitStatus> waitForTaskCountWithKmdNotifyFallbackReturnValue{};
|
||||
bool callBaseFlushBcsTask{true};
|
||||
uint32_t flushBcsTaskReturnValue{};
|
||||
std::optional<SubmissionStatus> flushReturnValue{};
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -2320,4 +2320,28 @@ HWTEST_F(CommandStreamReceiverHwTest, givenSshHeapNotProvidedWhenFlushTaskPerfor
|
||||
*pDevice);
|
||||
|
||||
EXPECT_FALSE(scratchController->setRequiredScratchSpaceCalled);
|
||||
}
|
||||
|
||||
TEST(CommandStreamReceiverSimpleTest, whenTranslatingSubmissionStatusToTaskCountValueThenProperValueIsReturned) {
|
||||
EXPECT_EQ(0u, CompletionStamp::getTaskCountFromSubmissionStatusError(SubmissionStatus::SUCCESS));
|
||||
EXPECT_EQ(CompletionStamp::outOfHostMemory, CompletionStamp::getTaskCountFromSubmissionStatusError(SubmissionStatus::OUT_OF_HOST_MEMORY));
|
||||
EXPECT_EQ(CompletionStamp::outOfDeviceMemory, CompletionStamp::getTaskCountFromSubmissionStatusError(SubmissionStatus::OUT_OF_MEMORY));
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverHwTest, givenFailureOnFlushWhenFlushingBcsTaskThenErrorIsPropagated) {
|
||||
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
|
||||
auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::BufferToHostPtr,
|
||||
commandStreamReceiver, commandStreamReceiver.getTagAllocation(), nullptr,
|
||||
commandStreamReceiver.getTagAllocation()->getUnderlyingBuffer(),
|
||||
commandStreamReceiver.getTagAllocation()->getGpuAddress(), 0,
|
||||
0, 0, 0, 0, 0, 0, 0);
|
||||
|
||||
BlitPropertiesContainer container;
|
||||
container.push_back(blitProperties);
|
||||
|
||||
commandStreamReceiver.flushReturnValue = SubmissionStatus::OUT_OF_HOST_MEMORY;
|
||||
EXPECT_EQ(CompletionStamp::outOfHostMemory, commandStreamReceiver.flushBcsTask(container, true, false, *pDevice));
|
||||
commandStreamReceiver.flushReturnValue = SubmissionStatus::OUT_OF_MEMORY;
|
||||
EXPECT_EQ(CompletionStamp::outOfDeviceMemory, commandStreamReceiver.flushBcsTask(container, true, false, *pDevice));
|
||||
}
|
||||
Reference in New Issue
Block a user