test: remove not needed tests

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2024-09-16 16:11:48 +00:00
committed by Compute-Runtime-Automation
parent d565333e66
commit 4f715c9b6a
23 changed files with 9 additions and 695 deletions

View File

@@ -1994,56 +1994,6 @@ HWTEST_F(CommandListCreate, GivenGpuHangWhenCreatingImmediateCommandListAndAppen
queue->csr = oldCsr;
}
HWTEST2_F(CommandListCreate, GivenGpuHangOnExecutingCommandListsWhenCreatingImmediateCommandListAndWaitingOnEventsThenDeviceLostIsReturned, IsSKL) {
ze_command_queue_desc_t desc = {};
desc.mode = ZE_COMMAND_QUEUE_MODE_SYNCHRONOUS;
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::renderCompute, returnValue));
ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue);
ASSERT_NE(nullptr, commandList);
auto whiteBoxCmdList = static_cast<CommandList *>(commandList.get());
EXPECT_EQ(device, commandList->getDevice());
EXPECT_TRUE(commandList->isImmediateType());
EXPECT_NE(nullptr, whiteBoxCmdList->cmdQImmediate);
ze_event_pool_desc_t eventPoolDesc = {};
eventPoolDesc.count = 1;
eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE;
ze_event_desc_t eventDesc = {};
eventDesc.index = 0;
eventDesc.signal = ZE_EVENT_SCOPE_FLAG_HOST;
eventDesc.wait = ZE_EVENT_SCOPE_FLAG_HOST;
ze_event_handle_t event = nullptr;
std::unique_ptr<L0::EventPool> eventPool(EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, returnValue));
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
ASSERT_NE(nullptr, eventPool);
eventPool->createEvent(&eventDesc, &event);
std::unique_ptr<Event> eventObject(static_cast<Event *>(L0::Event::fromHandle(event)));
ASSERT_NE(nullptr, eventObject->csrs[0]);
ASSERT_EQ(static_cast<DeviceImp *>(device)->getNEODevice()->getDefaultEngine().commandStreamReceiver, eventObject->csrs[0]);
MockCommandStreamReceiver mockCommandStreamReceiver(*neoDevice->executionEnvironment, neoDevice->getRootDeviceIndex(), neoDevice->getDeviceBitfield());
mockCommandStreamReceiver.waitForCompletionWithTimeoutReturnValue = WaitStatus::gpuHang;
auto queue = static_cast<WhiteBox<::L0::CommandQueue> *>(whiteBoxCmdList->cmdQImmediate);
const auto oldCsr = queue->csr;
queue->csr = &mockCommandStreamReceiver;
returnValue = commandList->appendWaitOnEvents(1, &event, nullptr, false, true, false, false, false);
EXPECT_EQ(ZE_RESULT_ERROR_DEVICE_LOST, returnValue);
queue->csr = oldCsr;
}
TEST_F(CommandListCreate, givenImmediateCommandListWhenThereIsNoEnoughSpaceForImmediateCommandThenNextCommandBufferIsUsed) {
ze_command_queue_desc_t desc = {};
desc.mode = ZE_COMMAND_QUEUE_MODE_SYNCHRONOUS;
@@ -2100,157 +2050,6 @@ TEST_F(CommandListCreate, givenCreatingRegularCommandlistAndppendCommandListsThe
EXPECT_EQ(result, ZE_RESULT_ERROR_INVALID_ARGUMENT);
}
HWTEST2_F(CommandListCreate, GivenGpuHangOnSynchronizingWhenCreatingImmediateCommandListAndWaitingOnEventsThenDeviceLostIsReturned, IsSKL) {
DebugManagerStateRestore restorer;
ze_command_queue_desc_t desc = {};
desc.mode = ZE_COMMAND_QUEUE_MODE_SYNCHRONOUS;
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::renderCompute, returnValue));
ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue);
ASSERT_NE(nullptr, commandList);
auto whiteBoxCmdList = static_cast<CommandList *>(commandList.get());
EXPECT_EQ(device, commandList->getDevice());
EXPECT_TRUE(commandList->isImmediateType());
EXPECT_NE(nullptr, whiteBoxCmdList->cmdQImmediate);
ze_event_pool_desc_t eventPoolDesc = {};
eventPoolDesc.count = 1;
eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE;
ze_event_desc_t eventDesc = {};
eventDesc.index = 0;
eventDesc.signal = ZE_EVENT_SCOPE_FLAG_HOST;
eventDesc.wait = ZE_EVENT_SCOPE_FLAG_HOST;
ze_event_handle_t event = nullptr;
std::unique_ptr<L0::EventPool> eventPool(EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, returnValue));
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
ASSERT_NE(nullptr, eventPool);
eventPool->createEvent(&eventDesc, &event);
std::unique_ptr<Event> eventObject(static_cast<Event *>(L0::Event::fromHandle(event)));
ASSERT_NE(nullptr, eventObject->csrs[0]);
ASSERT_EQ(static_cast<DeviceImp *>(device)->getNEODevice()->getDefaultEngine().commandStreamReceiver, eventObject->csrs[0]);
MockCommandStreamReceiver mockCommandStreamReceiver(*neoDevice->executionEnvironment, neoDevice->getRootDeviceIndex(), neoDevice->getDeviceBitfield());
mockCommandStreamReceiver.waitForCompletionWithTimeoutReturnValue = WaitStatus::gpuHang;
auto queue = static_cast<WhiteBox<::L0::CommandQueue> *>(whiteBoxCmdList->cmdQImmediate);
const auto oldCsr = queue->csr;
queue->csr = &mockCommandStreamReceiver;
returnValue = commandList->appendWaitOnEvents(1, &event, nullptr, false, true, false, false, false);
EXPECT_EQ(ZE_RESULT_ERROR_DEVICE_LOST, returnValue);
queue->csr = oldCsr;
}
HWTEST2_F(CommandListCreate, GivenGpuHangOnSynchronizingWhenCreatingImmediateCommandListWithoutFlushTaskAndWaitingOnEventsThenDeviceLostIsReturnedFromExecute, IsSKL) {
DebugManagerStateRestore restorer;
debugManager.flags.EnableFlushTaskSubmission.set(0);
ze_command_queue_desc_t desc = {};
desc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::renderCompute, returnValue));
ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue);
ASSERT_NE(nullptr, commandList);
auto whiteBoxCmdList = static_cast<CommandList *>(commandList.get());
EXPECT_EQ(device, commandList->getDevice());
EXPECT_TRUE(commandList->isImmediateType());
EXPECT_NE(nullptr, whiteBoxCmdList->cmdQImmediate);
ze_event_pool_desc_t eventPoolDesc = {};
eventPoolDesc.count = 1;
eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE;
ze_event_desc_t eventDesc = {};
eventDesc.index = 0;
eventDesc.signal = ZE_EVENT_SCOPE_FLAG_HOST;
eventDesc.wait = ZE_EVENT_SCOPE_FLAG_HOST;
ze_event_handle_t event = nullptr;
std::unique_ptr<L0::EventPool> eventPool(EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, returnValue));
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
ASSERT_NE(nullptr, eventPool);
eventPool->createEvent(&eventDesc, &event);
std::unique_ptr<Event> eventObject(static_cast<Event *>(L0::Event::fromHandle(event)));
ASSERT_NE(nullptr, eventObject->csrs[0]);
ASSERT_EQ(static_cast<DeviceImp *>(device)->getNEODevice()->getDefaultEngine().commandStreamReceiver, eventObject->csrs[0]);
MockCommandStreamReceiver mockCommandStreamReceiver(*neoDevice->executionEnvironment, neoDevice->getRootDeviceIndex(), neoDevice->getDeviceBitfield());
Mock<CommandQueue> mockCommandQueue(device, &mockCommandStreamReceiver, &desc);
mockCommandQueue.executeCommandListsResult = ZE_RESULT_ERROR_DEVICE_LOST;
auto oldCommandQueue = whiteBoxCmdList->cmdQImmediate;
whiteBoxCmdList->cmdQImmediate = &mockCommandQueue;
returnValue = commandList->appendWaitOnEvents(1, &event, nullptr, false, true, false, false, false);
EXPECT_EQ(ZE_RESULT_ERROR_DEVICE_LOST, returnValue);
whiteBoxCmdList->cmdQImmediate = oldCommandQueue;
}
HWTEST2_F(CommandListCreate, GivenGpuHangOnSynchronizingWhenCreatingImmediateCommandListWithoutFlushTaskAndWaitingOnEventsThenDeviceLostIsReturnedFromSynchronize, IsSKL) {
DebugManagerStateRestore restorer;
debugManager.flags.EnableFlushTaskSubmission.set(0);
ze_command_queue_desc_t desc = {};
desc.mode = ZE_COMMAND_QUEUE_MODE_SYNCHRONOUS;
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::renderCompute, returnValue));
ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue);
ASSERT_NE(nullptr, commandList);
auto whiteBoxCmdList = static_cast<CommandList *>(commandList.get());
EXPECT_EQ(device, commandList->getDevice());
EXPECT_TRUE(commandList->isImmediateType());
EXPECT_NE(nullptr, whiteBoxCmdList->cmdQImmediate);
ze_event_pool_desc_t eventPoolDesc = {};
eventPoolDesc.count = 1;
eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE;
ze_event_desc_t eventDesc = {};
eventDesc.index = 0;
eventDesc.signal = ZE_EVENT_SCOPE_FLAG_HOST;
eventDesc.wait = ZE_EVENT_SCOPE_FLAG_HOST;
ze_event_handle_t event = nullptr;
std::unique_ptr<L0::EventPool> eventPool(EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, returnValue));
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
ASSERT_NE(nullptr, eventPool);
eventPool->createEvent(&eventDesc, &event);
std::unique_ptr<Event> eventObject(static_cast<Event *>(L0::Event::fromHandle(event)));
ASSERT_NE(nullptr, eventObject->csrs[0]);
ASSERT_EQ(static_cast<DeviceImp *>(device)->getNEODevice()->getDefaultEngine().commandStreamReceiver, eventObject->csrs[0]);
MockCommandStreamReceiver mockCommandStreamReceiver(*neoDevice->executionEnvironment, neoDevice->getRootDeviceIndex(), neoDevice->getDeviceBitfield());
Mock<CommandQueue> mockCommandQueue(device, &mockCommandStreamReceiver, &desc);
mockCommandQueue.synchronizeResult = ZE_RESULT_ERROR_DEVICE_LOST;
auto oldCommandQueue = whiteBoxCmdList->cmdQImmediate;
whiteBoxCmdList->cmdQImmediate = &mockCommandQueue;
returnValue = commandList->appendWaitOnEvents(1, &event, nullptr, false, true, false, false, false);
EXPECT_EQ(ZE_RESULT_ERROR_DEVICE_LOST, returnValue);
whiteBoxCmdList->cmdQImmediate = oldCommandQueue;
}
HWTEST_F(CommandListCreate, GivenGpuHangWhenCreatingImmediateCommandListAndAppendingEventResetThenDeviceLostIsReturned) {
DebugManagerStateRestore restorer;
debugManager.flags.EnableFlushTaskSubmission.set(1);

View File

@@ -267,60 +267,6 @@ HWTEST_F(CommandQueueExecuteCommandLists, givenFenceWhenExecutingCmdListThenFenc
commandQueue->destroy();
}
HWTEST2_F(CommandQueueExecuteCommandLists, whenUsingFenceThenExpectEndingPipeControlUpdatingTagAllocation, IsGen9) {
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
using POST_SYNC_OPERATION = typename FamilyType::PIPE_CONTROL::POST_SYNC_OPERATION;
using Parse = typename FamilyType::Parse;
ze_command_queue_desc_t desc{};
ze_result_t returnValue;
desc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
auto commandQueue = whiteboxCast(CommandQueue::create(productFamily,
device,
neoDevice->getDefaultEngine().commandStreamReceiver,
&desc,
false,
false,
false,
returnValue));
ASSERT_NE(nullptr, commandQueue);
ze_fence_desc_t fenceDesc{};
auto fence = whiteboxCast(Fence::create(commandQueue, &fenceDesc));
ASSERT_NE(nullptr, fence);
ze_fence_handle_t fenceHandle = fence->toHandle();
auto usedSpaceBefore = commandQueue->commandStream.getUsed();
auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, fenceHandle, true, nullptr);
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
auto usedSpaceAfter = commandQueue->commandStream.getUsed();
ASSERT_GT(usedSpaceAfter, usedSpaceBefore);
GenCmdList cmdList;
ASSERT_TRUE(Parse::parseCommandBuffer(cmdList,
ptrOffset(commandQueue->commandStream.getCpuBase(), 0),
usedSpaceAfter));
auto pipeControls = findAll<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
size_t pipeControlsPostSyncNumber = 0u;
for (size_t i = 0; i < pipeControls.size(); i++) {
auto pipeControl = reinterpret_cast<PIPE_CONTROL *>(*pipeControls[i]);
if (pipeControl->getPostSyncOperation() == POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA) {
EXPECT_EQ(commandQueue->getCsr()->getTagAllocation()->getGpuAddress(), NEO::UnitTestHelper<FamilyType>::getPipeControlPostSyncAddress(*pipeControl));
EXPECT_EQ(fence->taskCount, pipeControl->getImmediateData());
pipeControlsPostSyncNumber++;
}
}
EXPECT_EQ(1u, pipeControlsPostSyncNumber);
fence->destroy();
commandQueue->destroy();
}
HWTEST_F(CommandQueueExecuteCommandLists, whenExecutingCommandListsThenEndingPipeControlCommandIsExpected) {
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
using POST_SYNC_OPERATION = typename FamilyType::PIPE_CONTROL::POST_SYNC_OPERATION;

View File

@@ -28,13 +28,6 @@ TEST(L0GfxCoreHelperTest, WhenL0GfxCoreHelperIsCalledWithUnknownGfxCoreThenNullp
EXPECT_EQ(nullptr, L0GfxCoreHelper::create(IGFX_UNKNOWN_CORE));
}
HWTEST2_F(L0GfxCoreHelperTest, givenResumeWANotNeededThenFalseIsReturned, IsAtMostGen11) {
MockExecutionEnvironment executionEnvironment;
auto &l0GfxCoreHelper = executionEnvironment.rootDeviceEnvironments[0]->getHelper<L0GfxCoreHelper>();
EXPECT_FALSE(l0GfxCoreHelper.isResumeWARequired());
}
using PlatformsWithWa = IsWithinGfxCore<IGFX_GEN12LP_CORE, IGFX_XE_HP_CORE>;
HWTEST2_F(L0GfxCoreHelperTest, givenResumeWANeededThenTrueIsReturned, PlatformsWithWa) {