test: correct expectations in opencl tests if heapless enabled 4/4

Related-To: NEO-10641
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2024-09-06 06:21:45 +00:00
committed by Compute-Runtime-Automation
parent 41e24635e3
commit c7a6a74e4e
32 changed files with 389 additions and 150 deletions

View File

@@ -1138,7 +1138,9 @@ struct BlitEnqueueFlushTests : public BlitEnqueueTests<1> {
using UltCommandStreamReceiver<FamilyType>::UltCommandStreamReceiver; using UltCommandStreamReceiver<FamilyType>::UltCommandStreamReceiver;
SubmissionStatus flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override { SubmissionStatus flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override {
latestFlushedCounter = ++(*flushCounter); if (flushCounter) {
latestFlushedCounter = ++(*flushCounter);
}
return UltCommandStreamReceiver<FamilyType>::flush(batchBuffer, allocationsForResidency); return UltCommandStreamReceiver<FamilyType>::flush(batchBuffer, allocationsForResidency);
} }

View File

@@ -885,7 +885,7 @@ HWTEST_F(CommandQueueTests, givenMultipleCommandQueuesWhenMarkerIsEmittedThenGra
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get())); auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
MockContext context(device.get()); MockContext context(device.get());
std::unique_ptr<CommandQueue> commandQ(new MockCommandQueue(&context, device.get(), 0, false)); std::unique_ptr<CommandQueue> commandQ(new MockCommandQueue(&context, device.get(), 0, false));
*device->getDefaultEngine().commandStreamReceiver->getTagAddress() = 0; *device->getDefaultEngine().commandStreamReceiver->getTagAddress() = commandQ->getHeaplessStateInitEnabled() ? 1 : 0;
commandQ->enqueueMarkerWithWaitList(0, nullptr, nullptr); commandQ->enqueueMarkerWithWaitList(0, nullptr, nullptr);
commandQ->enqueueMarkerWithWaitList(0, nullptr, nullptr); commandQ->enqueueMarkerWithWaitList(0, nullptr, nullptr);
@@ -2984,8 +2984,16 @@ HWTEST_F(CommandQueueOnSpecificEngineTests, givenNotInitializedCcsOsContextWhenC
MockContext context{}; MockContext context{};
cl_command_queue_properties properties[5] = {}; cl_command_queue_properties properties[5] = {};
auto &compilerProductHelper = context.getDevice(0)->getCompilerProductHelper();
auto heaplessModeEnabled = compilerProductHelper.isHeaplessModeEnabled();
auto heaplessStateInit = compilerProductHelper.isHeaplessStateInitEnabled(heaplessModeEnabled);
OsContext &osContext = *context.getDevice(0)->getEngine(aub_stream::ENGINE_CCS, EngineUsage::regular).osContext; OsContext &osContext = *context.getDevice(0)->getEngine(aub_stream::ENGINE_CCS, EngineUsage::regular).osContext;
EXPECT_FALSE(osContext.isInitialized()); if (heaplessStateInit) {
EXPECT_TRUE(osContext.isInitialized());
} else {
EXPECT_FALSE(osContext.isInitialized());
}
debugManager.flags.NodeOrdinal.set(static_cast<int32_t>(aub_stream::EngineType::ENGINE_CCS)); debugManager.flags.NodeOrdinal.set(static_cast<int32_t>(aub_stream::EngineType::ENGINE_CCS));
const auto rcsFamilyIndex = static_cast<cl_uint>(context.getDevice(0)->getDevice().getEngineGroupIndexFromEngineGroupType(EngineGroupType::renderCompute)); const auto rcsFamilyIndex = static_cast<cl_uint>(context.getDevice(0)->getDevice().getEngineGroupIndexFromEngineGroupType(EngineGroupType::renderCompute));

View File

@@ -582,7 +582,7 @@ HWTEST_F(EnqueueFillBufferCmdTests, givenEnqueueFillBufferWhenPatternAllocationI
ASSERT_FALSE(csr.getAllocationsForReuse().peekIsEmpty()); ASSERT_FALSE(csr.getAllocationsForReuse().peekIsEmpty());
GraphicsAllocation *patternAllocation = csr.getAllocationsForReuse().peekHead(); GraphicsAllocation *patternAllocation = pCmdQ->getHeaplessStateInitEnabled() ? csr.getAllocationsForReuse().peekTail() : csr.getAllocationsForReuse().peekHead();
ASSERT_NE(nullptr, patternAllocation); ASSERT_NE(nullptr, patternAllocation);
EXPECT_EQ(AllocationType::fillPattern, patternAllocation->getAllocationType()); EXPECT_EQ(AllocationType::fillPattern, patternAllocation->getAllocationType());

View File

@@ -115,6 +115,7 @@ struct EnqueueHandlerWithAubSubCaptureTests : public EnqueueHandlerTest {
MockCmdQWithAubSubCapture(Context *context, ClDevice *device) : CommandQueueHw<FamilyType>(context, device, nullptr, false) {} MockCmdQWithAubSubCapture(Context *context, ClDevice *device) : CommandQueueHw<FamilyType>(context, device, nullptr, false) {}
WaitStatus waitUntilComplete(TaskCountType gpgpuTaskCountToWait, Range<CopyEngineState> copyEnginesToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep, bool cleanTemporaryAllocationList, bool skipWait) override { WaitStatus waitUntilComplete(TaskCountType gpgpuTaskCountToWait, Range<CopyEngineState> copyEnginesToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep, bool cleanTemporaryAllocationList, bool skipWait) override {
waitUntilCompleteCalled = true; waitUntilCompleteCalled = true;
return CommandQueueHw<FamilyType>::waitUntilComplete(gpgpuTaskCountToWait, copyEnginesToWait, flushStampToWait, useQuickKmdSleep, cleanTemporaryAllocationList, skipWait); return CommandQueueHw<FamilyType>::waitUntilComplete(gpgpuTaskCountToWait, copyEnginesToWait, flushStampToWait, useQuickKmdSleep, cleanTemporaryAllocationList, skipWait);
} }
@@ -133,6 +134,7 @@ HWTEST_F(EnqueueHandlerWithAubSubCaptureTests, givenEnqueueHandlerWithAubSubCapt
DebugManagerStateRestore stateRestore; DebugManagerStateRestore stateRestore;
debugManager.flags.AUBDumpSubCaptureMode.set(1); debugManager.flags.AUBDumpSubCaptureMode.set(1);
UnitTestSetter::disableHeaplessStateInit(stateRestore);
auto aubCsr = new MockAubCsr<FamilyType>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto aubCsr = new MockAubCsr<FamilyType>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
pDevice->resetCommandStreamReceiver(aubCsr); pDevice->resetCommandStreamReceiver(aubCsr);
@@ -145,6 +147,7 @@ HWTEST_F(EnqueueHandlerWithAubSubCaptureTests, givenEnqueueHandlerWithAubSubCapt
MockCmdQWithAubSubCapture<FamilyType> cmdQ(context, pClDevice); MockCmdQWithAubSubCapture<FamilyType> cmdQ(context, pClDevice);
MockKernelWithInternals mockKernel(*pClDevice); MockKernelWithInternals mockKernel(*pClDevice);
size_t gws[3] = {1, 0, 0}; size_t gws[3] = {1, 0, 0};
cmdQ.enqueueKernel(mockKernel.mockKernel, 1, nullptr, gws, nullptr, 0, nullptr, nullptr); cmdQ.enqueueKernel(mockKernel.mockKernel, 1, nullptr, gws, nullptr, 0, nullptr, nullptr);
EXPECT_TRUE(cmdQ.waitUntilCompleteCalled); EXPECT_TRUE(cmdQ.waitUntilCompleteCalled);
@@ -174,6 +177,8 @@ HWTEST_F(EnqueueHandlerWithAubSubCaptureTests, givenEnqueueHandlerWithAubSubCapt
debugManager.flags.AUBDumpSubCaptureMode.set(1); debugManager.flags.AUBDumpSubCaptureMode.set(1);
debugManager.flags.EnableTimestampPacket.set(true); debugManager.flags.EnableTimestampPacket.set(true);
UnitTestSetter::disableHeaplessStateInit(stateRestore);
auto aubCsr = new MockAubCsr<FamilyType>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto aubCsr = new MockAubCsr<FamilyType>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
pDevice->resetCommandStreamReceiver(aubCsr); pDevice->resetCommandStreamReceiver(aubCsr);
@@ -207,6 +212,7 @@ HWTEST_F(EnqueueHandlerWithAubSubCaptureTests, givenInputEventsWhenDispatchingEn
DebugManagerStateRestore stateRestore; DebugManagerStateRestore stateRestore;
debugManager.flags.AUBDumpSubCaptureMode.set(1); debugManager.flags.AUBDumpSubCaptureMode.set(1);
debugManager.flags.EnableTimestampPacket.set(true); debugManager.flags.EnableTimestampPacket.set(true);
UnitTestSetter::disableHeaplessStateInit(stateRestore);
auto defaultEngine = defaultHwInfo->capabilityTable.defaultEngineType; auto defaultEngine = defaultHwInfo->capabilityTable.defaultEngineType;
@@ -497,6 +503,9 @@ HWTEST2_F(EnqueueHandlerTest, givenEnqueueHandlerWhenAddPatchInfoCommentsForAUBD
MockKernelWithInternals mockKernel(*pClDevice); MockKernelWithInternals mockKernel(*pClDevice);
auto mockCmdQ = std::unique_ptr<MockCommandQueueHw<FamilyType>>(new MockCommandQueueHw<FamilyType>(context, pClDevice, 0)); auto mockCmdQ = std::unique_ptr<MockCommandQueueHw<FamilyType>>(new MockCommandQueueHw<FamilyType>(context, pClDevice, 0));
if (mockCmdQ->getHeaplessModeEnabled()) {
GTEST_SKIP();
}
size_t gws[] = {1, 1, 1}; size_t gws[] = {1, 1, 1};

View File

@@ -1040,7 +1040,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, EnqueueKernelTest, givenTwoEnqueueProgrammedWithinS
hwParse.parseCommands<FamilyType>(*pCmdQ); hwParse.parseCommands<FamilyType>(*pCmdQ);
auto bbsCommands = findAll<typename FamilyType::MI_BATCH_BUFFER_START *>(hwParse.cmdList.begin(), hwParse.cmdList.end()); auto bbsCommands = findAll<typename FamilyType::MI_BATCH_BUFFER_START *>(hwParse.cmdList.begin(), hwParse.cmdList.end());
EXPECT_EQ(bbsCommands.size(), 1u); EXPECT_EQ(pCmdQ->getHeaplessStateInitEnabled() ? 0u : 1u, bbsCommands.size());
} }
HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenFinishIsCalledThenBatchesSubmissionsAreFlushed) { HWTEST_F(EnqueueKernelTest, givenCsrInBatchingModeWhenFinishIsCalledThenBatchesSubmissionsAreFlushed) {
@@ -2040,14 +2040,14 @@ HWTEST_F(PauseOnGpuTests, givenGpuScratchWriteEnabledWhenDispatchWalkersThenInse
findLoadRegImms<FamilyType>(hwParser.cmdList); findLoadRegImms<FamilyType>(hwParser.cmdList);
EXPECT_EQ(0u, loadRegImmsFound); EXPECT_EQ(pCmdQ->getHeaplessStateInitEnabled() ? 1u : 0u, loadRegImmsFound);
pCmdQ->enqueueKernel(mockKernel.mockKernel, 1, off, gws, nullptr, 0, nullptr, nullptr); pCmdQ->enqueueKernel(mockKernel.mockKernel, 1, off, gws, nullptr, 0, nullptr, nullptr);
hwParser.parseCommands<FamilyType>(*pCmdQ); hwParser.parseCommands<FamilyType>(*pCmdQ);
findLoadRegImms<FamilyType>(hwParser.cmdList); findLoadRegImms<FamilyType>(hwParser.cmdList);
EXPECT_EQ(1u, loadRegImmsFound); EXPECT_EQ(pCmdQ->getHeaplessStateInitEnabled() ? 2u : 1u, loadRegImmsFound);
} }
HWTEST_F(PauseOnGpuTests, givenGpuScratchWriteEnabledWhenDispatcMultiplehWalkersThenInsertLoadRegisterImmCommandOnlyOnce) { HWTEST_F(PauseOnGpuTests, givenGpuScratchWriteEnabledWhenDispatcMultiplehWalkersThenInsertLoadRegisterImmCommandOnlyOnce) {

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2023 Intel Corporation * Copyright (C) 2018-2024 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -63,5 +63,5 @@ HWTEST_F(IOQWithTwoWalkers, GivenTwoCommandQueuesWhenEnqueuingKernelThenOnePipeC
EXPECT_EQ(PIPE_CONTROL::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA, pipeControl->getPostSyncOperation()); EXPECT_EQ(PIPE_CONTROL::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA, pipeControl->getPostSyncOperation());
// The PC address should match the CS tag address // The PC address should match the CS tag address
EXPECT_EQ(commandStreamReceiver.getTagAllocation()->getGpuAddress(), NEO::UnitTestHelper<FamilyType>::getPipeControlPostSyncAddress(*pipeControl)); EXPECT_EQ(commandStreamReceiver.getTagAllocation()->getGpuAddress(), NEO::UnitTestHelper<FamilyType>::getPipeControlPostSyncAddress(*pipeControl));
EXPECT_EQ(1u, pipeControl->getImmediateData()); EXPECT_EQ(commandStreamReceiver.heaplessStateInitialized ? 2u : 1u, pipeControl->getImmediateData());
} }

View File

@@ -22,7 +22,7 @@ using namespace NEO;
using MarkerTest = Test<CommandEnqueueFixture>; using MarkerTest = Test<CommandEnqueueFixture>;
HWTEST_F(MarkerTest, GivenCsrAndCmdqWithSameTaskLevelWhenEnqueingMarkerThenPipeControlIsAdded) { HWTEST_F(MarkerTest, GivenCsrAndCmdqWithSameTaskLevelWhenEnqueingMarkerThenPipeControlIsAdded) {
typedef typename FamilyType::PIPE_CONTROL PIPE_CONTROL; using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
// Set task levels to known values. // Set task levels to known values.
@@ -51,7 +51,12 @@ HWTEST_F(MarkerTest, GivenCsrAndCmdqWithSameTaskLevelWhenEnqueingMarkerThenPipeC
// If CSR == CQ then a PC is required. // If CSR == CQ then a PC is required.
auto itorCmd = reverseFind<PIPE_CONTROL *>(cmdList.rbegin(), cmdList.rend()); auto itorCmd = reverseFind<PIPE_CONTROL *>(cmdList.rbegin(), cmdList.rend());
EXPECT_EQ(cmdList.rend(), itorCmd);
if (mockCmdQ->getHeaplessStateInitEnabled()) {
EXPECT_NE(cmdList.rend(), itorCmd);
} else {
EXPECT_EQ(cmdList.rend(), itorCmd);
}
} }
HWTEST_F(MarkerTest, GivenCsrAndCmdqWithDifferentTaskLevelsWhenEnqueingMarkerThenPipeControlIsNotAdded) { HWTEST_F(MarkerTest, GivenCsrAndCmdqWithDifferentTaskLevelsWhenEnqueingMarkerThenPipeControlIsNotAdded) {
@@ -241,7 +246,8 @@ TEST_F(MarkerTest, givenMultipleEventsAndCompletedUserEventWhenTheyArePassedToMa
&userEvent}; &userEvent};
cl_uint numEventsInWaitList = sizeof(eventWaitList) / sizeof(eventWaitList[0]); cl_uint numEventsInWaitList = sizeof(eventWaitList) / sizeof(eventWaitList[0]);
cl_event event = nullptr; cl_event event = nullptr;
auto initialTaskCount = pCmdQ->taskCount;
auto initialTaskCount = std::max(pCmdQ->getGpgpuCommandStreamReceiver().peekTaskCount(), pCmdQ->taskCount);
pCmdQ->enqueueMarkerWithWaitList( pCmdQ->enqueueMarkerWithWaitList(
numEventsInWaitList, numEventsInWaitList,

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2019-2023 Intel Corporation * Copyright (C) 2019-2024 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -53,7 +53,8 @@ HWTEST_F(ResourceBarrierTest, whenEnqueueResourceBarrierCalledThenUpdateQueueCom
BarrierCommand barrierCommand(pCmdQ, &descriptor, 1); BarrierCommand barrierCommand(pCmdQ, &descriptor, 1);
auto previousTaskCount = pCmdQ->taskCount; auto &csr = pCmdQ->getGpgpuCommandStreamReceiver();
auto previousTaskCount = std::max(pCmdQ->taskCount, csr.peekTaskCount());
auto previousTaskLevel = pCmdQ->taskLevel; auto previousTaskLevel = pCmdQ->taskLevel;
const auto enqueueResult = pCmdQ->enqueueResourceBarrier(&barrierCommand, 0, nullptr, nullptr); const auto enqueueResult = pCmdQ->enqueueResourceBarrier(&barrierCommand, 0, nullptr, nullptr);

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2023 Intel Corporation * Copyright (C) 2018-2024 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -8,6 +8,7 @@
#include "shared/source/command_stream/command_stream_receiver_hw.h" #include "shared/source/command_stream/command_stream_receiver_hw.h"
#include "shared/source/command_stream/submission_status.h" #include "shared/source/command_stream/submission_status.h"
#include "shared/source/helpers/aligned_memory.h" #include "shared/source/helpers/aligned_memory.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/memory_manager/memory_manager.h" #include "shared/source/memory_manager/memory_manager.h"
#include "shared/test/common/libult/ult_command_stream_receiver.h" #include "shared/test/common/libult/ult_command_stream_receiver.h"
#include "shared/test/common/test_macros/hw_test.h" #include "shared/test/common/test_macros/hw_test.h"
@@ -32,20 +33,27 @@ class CommandStreamReceiverMock : public UltCommandStreamReceiver<FamilyType> {
std::vector<GraphicsAllocation *> toFree; // pointers to be freed on destruction std::vector<GraphicsAllocation *> toFree; // pointers to be freed on destruction
Device *pDevice; Device *pDevice;
ClDevice *pClDevice; ClDevice *pClDevice;
bool heaplessStateInit = false;
public: public:
size_t expectedToFreeCount = (size_t)-1; size_t expectedToFreeCount = (size_t)-1;
CommandStreamReceiverMock(Device *pDevice) : UltCommandStreamReceiver<FamilyType>(*pDevice->getExecutionEnvironment(), pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()) { CommandStreamReceiverMock(Device *pDevice) : UltCommandStreamReceiver<FamilyType>(*pDevice->getExecutionEnvironment(), pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()) {
this->pDevice = pDevice; this->pDevice = pDevice;
this->pClDevice = pDevice->getSpecializedDevice<ClDevice>(); this->pClDevice = pDevice->getSpecializedDevice<ClDevice>();
auto &compilerProductHelper = pDevice->getCompilerProductHelper();
auto heapless = compilerProductHelper.isHeaplessModeEnabled();
this->heaplessStateInit = compilerProductHelper.isHeaplessStateInitEnabled(heapless);
} }
SubmissionStatus flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override { SubmissionStatus flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override {
EXPECT_NE(nullptr, batchBuffer.commandBufferAllocation->getUnderlyingBuffer()); EXPECT_NE(nullptr, batchBuffer.commandBufferAllocation->getUnderlyingBuffer());
toFree.push_back(batchBuffer.commandBufferAllocation); if (!heaplessStateInit) {
batchBuffer.stream->replaceBuffer(nullptr, 0); toFree.push_back(batchBuffer.commandBufferAllocation);
batchBuffer.stream->replaceGraphicsAllocation(nullptr); batchBuffer.stream->replaceBuffer(nullptr, 0);
batchBuffer.stream->replaceGraphicsAllocation(nullptr);
}
EXPECT_TRUE(this->ownershipMutex.try_lock()); EXPECT_TRUE(this->ownershipMutex.try_lock());
this->ownershipMutex.unlock(); this->ownershipMutex.unlock();
@@ -54,10 +62,13 @@ class CommandStreamReceiverMock : public UltCommandStreamReceiver<FamilyType> {
~CommandStreamReceiverMock() override { ~CommandStreamReceiverMock() override {
EXPECT_FALSE(pClDevice->hasOwnership()); EXPECT_FALSE(pClDevice->hasOwnership());
if (expectedToFreeCount == (size_t)-1) {
EXPECT_GT(toFree.size(), 0u); // make sure flush was called if (!heaplessStateInit) {
} else { if (expectedToFreeCount == (size_t)-1) {
EXPECT_EQ(toFree.size(), expectedToFreeCount); EXPECT_GT(toFree.size(), 0u); // make sure flush was called
} else {
EXPECT_EQ(toFree.size(), expectedToFreeCount);
}
} }
auto memoryManager = this->getMemoryManager(); auto memoryManager = this->getMemoryManager();

View File

@@ -43,6 +43,10 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenForceCsrReprogrammingDebugVar
DebugManagerStateRestore restore; DebugManagerStateRestore restore;
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessStateInitialized) {
GTEST_SKIP();
}
debugManager.flags.ForceCsrReprogramming.set(true); debugManager.flags.ForceCsrReprogramming.set(true);
flushTask(commandStreamReceiver); flushTask(commandStreamReceiver);
@@ -449,6 +453,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, whenSamplerCach
HWTEST_F(CommandStreamReceiverFlushTaskTests, whenSamplerCacheFlushBeforeThenSendPipecontrol) { HWTEST_F(CommandStreamReceiverFlushTaskTests, whenSamplerCacheFlushBeforeThenSendPipecontrol) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessStateInitialized) {
GTEST_SKIP();
}
commandStreamReceiver.isPreambleSent = true; commandStreamReceiver.isPreambleSent = true;
commandStreamReceiver.setSamplerCacheFlushRequired(CommandStreamReceiver::SamplerCacheFlushState::samplerCacheFlushBefore); commandStreamReceiver.setSamplerCacheFlushRequired(CommandStreamReceiver::SamplerCacheFlushState::samplerCacheFlushBefore);
configureCSRtoNonDirtyState<FamilyType>(false); configureCSRtoNonDirtyState<FamilyType>(false);
@@ -493,6 +500,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, whenSamplerCach
HWTEST_F(CommandStreamReceiverFlushTaskTests, whenSamplerCacheFlushAfterThenSendPipecontrol) { HWTEST_F(CommandStreamReceiverFlushTaskTests, whenSamplerCacheFlushAfterThenSendPipecontrol) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessStateInitialized) {
GTEST_SKIP();
}
commandStreamReceiver.isPreambleSent = true; commandStreamReceiver.isPreambleSent = true;
commandStreamReceiver.setSamplerCacheFlushRequired(CommandStreamReceiver::SamplerCacheFlushState::samplerCacheFlushAfter); commandStreamReceiver.setSamplerCacheFlushRequired(CommandStreamReceiver::SamplerCacheFlushState::samplerCacheFlushAfter);
configureCSRtoNonDirtyState<FamilyType>(false); configureCSRtoNonDirtyState<FamilyType>(false);
@@ -537,6 +547,10 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, WhenFlushingTaskThenCompletionStam
HWTEST_F(CommandStreamReceiverFlushTaskTests, WhenFlushingTaskThenStateBaseAddressIsCorrect) { HWTEST_F(CommandStreamReceiverFlushTaskTests, WhenFlushingTaskThenStateBaseAddressIsCorrect) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessModeEnabled) {
GTEST_SKIP();
}
flushTask(commandStreamReceiver); flushTask(commandStreamReceiver);
if (!pDevice->getHardwareInfo().capabilityTable.supportsImages) { if (!pDevice->getHardwareInfo().capabilityTable.supportsImages) {
EXPECT_TRUE(commandStreamReceiver.dshState.updateAndCheck(&dsh)); EXPECT_TRUE(commandStreamReceiver.dshState.updateAndCheck(&dsh));
@@ -581,6 +595,10 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenDebugVariableSetWhenProgrammi
debugManager.flags.ForceStatelessMocsEncryptionBit.set(1); debugManager.flags.ForceStatelessMocsEncryptionBit.set(1);
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessStateInitialized) {
GTEST_SKIP();
}
flushTask(commandStreamReceiver); flushTask(commandStreamReceiver);
auto &commandStreamCSR = commandStreamReceiver.commandStream; auto &commandStreamCSR = commandStreamReceiver.commandStream;
@@ -668,6 +686,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenNotApplicableGrfConfigWhenFlu
HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenPreambleNotSentWhenFlushingTaskThenPreambleIsSent) { HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenPreambleNotSentWhenFlushingTaskThenPreambleIsSent) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessStateInitialized) {
GTEST_SKIP();
}
commandStreamReceiver.isPreambleSent = false; commandStreamReceiver.isPreambleSent = false;
flushTask(commandStreamReceiver); flushTask(commandStreamReceiver);
@@ -678,6 +699,10 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenPreambleNotSentWhenFlushingTa
HWTEST_F(CommandStreamReceiverFlushTaskTests, givenFlushTaskWhenInitProgrammingFlagsIsCalledThenBindingTableBaseAddressRequiredIsSetCorrecty) { HWTEST_F(CommandStreamReceiverFlushTaskTests, givenFlushTaskWhenInitProgrammingFlagsIsCalledThenBindingTableBaseAddressRequiredIsSetCorrecty) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessStateInitialized) {
GTEST_SKIP();
}
commandStreamReceiver.initProgrammingFlags(); commandStreamReceiver.initProgrammingFlags();
EXPECT_TRUE(commandStreamReceiver.bindingTableBaseAddressRequired); EXPECT_TRUE(commandStreamReceiver.bindingTableBaseAddressRequired);
@@ -968,6 +993,11 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenEnoughMemoryOnlyForPreambleAn
hardwareInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 1; hardwareInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 1;
auto mockDevice = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hardwareInfo, 0u)); auto mockDevice = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hardwareInfo, 0u));
auto &commandStreamReceiver = mockDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = mockDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessStateInitialized) {
GTEST_SKIP();
}
commandStreamReceiver.timestampPacketWriteEnabled = false; commandStreamReceiver.timestampPacketWriteEnabled = false;
// Force a PIPE_CONTROL through a taskLevel transition // Force a PIPE_CONTROL through a taskLevel transition
taskLevel = commandStreamReceiver.peekTaskLevel() + 1; taskLevel = commandStreamReceiver.peekTaskLevel() + 1;
@@ -1033,9 +1063,12 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenBothCsWhenFlushingTaskThenFlu
} }
HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenBothCsWhenFlushingTaskThenChainWithBatchBufferStart) { HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenBothCsWhenFlushingTaskThenChainWithBatchBufferStart) {
typedef typename FamilyType::MI_BATCH_BUFFER_START MI_BATCH_BUFFER_START; using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START;
typedef typename FamilyType::MI_NOOP MI_NOOP; using MI_NOOP = typename FamilyType::MI_NOOP;
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessStateInitialized) {
GTEST_SKIP();
}
// Reserve space for 16 NOOPs // Reserve space for 16 NOOPs
commandStream.getSpace(16 * sizeof(MI_NOOP)); commandStream.getSpace(16 * sizeof(MI_NOOP));

View File

@@ -9,6 +9,7 @@
#include "shared/source/command_stream/scratch_space_controller.h" #include "shared/source/command_stream/scratch_space_controller.h"
#include "shared/source/gen_common/reg_configs_common.h" #include "shared/source/gen_common/reg_configs_common.h"
#include "shared/source/gmm_helper/gmm_helper.h" #include "shared/source/gmm_helper/gmm_helper.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/helpers/gfx_core_helper.h"
#include "shared/source/helpers/state_base_address.h" #include "shared/source/helpers/state_base_address.h"
#include "shared/source/memory_manager/internal_allocation_storage.h" #include "shared/source/memory_manager/internal_allocation_storage.h"
@@ -985,6 +986,12 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenForced32BitAllocationsModeSto
auto commandStreamReceiver = new MockCsrHw<FamilyType>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); auto commandStreamReceiver = new MockCsrHw<FamilyType>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
auto &compilerProductHelper = pDevice->getCompilerProductHelper();
auto heaplessEnabled = compilerProductHelper.isHeaplessModeEnabled();
if (compilerProductHelper.isHeaplessStateInitEnabled(heaplessEnabled)) {
GTEST_SKIP();
}
pDevice->getMemoryManager()->setForce32BitAllocations(true); pDevice->getMemoryManager()->setForce32BitAllocations(true);
pDevice->resetCommandStreamReceiver(commandStreamReceiver); pDevice->resetCommandStreamReceiver(commandStreamReceiver);

View File

@@ -686,14 +686,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInDefaultModeWhenFlushTask
auto &csr = commandQueue.getGpgpuCommandStreamReceiver(); auto &csr = commandQueue.getGpgpuCommandStreamReceiver();
csr.flushTask(commandStream, flushTaskMethod<FamilyType>(csr, commandStream, 0, &dsh, &ioh, &ssh, taskLevel, dispatchFlags, *pDevice);
0,
&dsh,
&ioh,
&ssh,
taskLevel,
dispatchFlags,
*pDevice);
EXPECT_EQ(heaplessStateInit ? 2u : 1u, csr.peekLatestSentTaskCount()); EXPECT_EQ(heaplessStateInit ? 2u : 1u, csr.peekLatestSentTaskCount());
EXPECT_EQ(heaplessStateInit ? 2u : 1u, csr.peekLatestFlushedTaskCount()); EXPECT_EQ(heaplessStateInit ? 2u : 1u, csr.peekLatestFlushedTaskCount());
@@ -715,44 +708,23 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenFlushTas
csr.useGpuIdleImplicitFlush = false; csr.useGpuIdleImplicitFlush = false;
dispatchFlags.implicitFlush = false; dispatchFlags.implicitFlush = false;
csr.flushTask(commandStream, flushTaskMethod<FamilyType>(csr, commandStream, 0, &dsh, &ioh, &ssh, taskLevel, dispatchFlags, *pDevice);
0,
&dsh,
&ioh,
&ssh,
taskLevel,
dispatchFlags,
*pDevice);
EXPECT_EQ(csr.heaplessStateInitialized ? 2u : 1u, csr.peekLatestSentTaskCount()); EXPECT_EQ(csr.heaplessStateInitialized ? 2u : 1u, csr.peekLatestSentTaskCount());
EXPECT_EQ(csr.heaplessStateInitialized ? 1u : 0u, csr.peekLatestFlushedTaskCount()); EXPECT_EQ(csr.heaplessStateInitialized ? 2u : 0u, csr.peekLatestFlushedTaskCount());
dispatchFlags.implicitFlush = false; dispatchFlags.implicitFlush = false;
csr.flushTask(commandStream, flushTaskMethod<FamilyType>(csr, commandStream, 0, &dsh, &ioh, &ssh, taskLevel, dispatchFlags, *pDevice);
0,
&dsh,
&ioh,
&ssh,
taskLevel,
dispatchFlags,
*pDevice);
EXPECT_EQ(csr.heaplessStateInitialized ? 3u : 2u, csr.peekLatestSentTaskCount()); EXPECT_EQ(csr.heaplessStateInitialized ? 3u : 2u, csr.peekLatestSentTaskCount());
EXPECT_EQ(2u, csr.peekLatestFlushedTaskCount()); EXPECT_EQ(2u, csr.peekLatestFlushedTaskCount());
dispatchFlags.implicitFlush = false; dispatchFlags.implicitFlush = false;
csr.flushTask(commandStream, flushTaskMethod<FamilyType>(csr, commandStream, 0, &dsh, &ioh, &ssh, taskLevel, dispatchFlags, *pDevice);
0,
&dsh,
&ioh,
&ssh,
taskLevel,
dispatchFlags,
*pDevice);
EXPECT_EQ(csr.heaplessStateInitialized ? 4u : 3u, csr.peekLatestSentTaskCount()); EXPECT_EQ(csr.heaplessStateInitialized ? 4u : 3u, csr.peekLatestSentTaskCount());
EXPECT_EQ(csr.heaplessStateInitialized ? 3u : 2u, csr.peekLatestFlushedTaskCount()); EXPECT_EQ(csr.heaplessStateInitialized ? 4u : 2u, csr.peekLatestFlushedTaskCount());
} }
HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenWaitForTaskCountIsCalledWithTaskCountThatWasNotYetFlushedThenBatchedCommandBuffersAreSubmitted) { HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenWaitForTaskCountIsCalledWithTaskCountThatWasNotYetFlushedThenBatchedCommandBuffersAreSubmitted) {
@@ -1914,6 +1886,15 @@ class UltCommandStreamReceiverForDispatchFlags : public UltCommandStreamReceiver
return BaseClass::flushTask(commandStream, commandStreamStart, return BaseClass::flushTask(commandStream, commandStreamStart,
dsh, ioh, ssh, taskLevel, dispatchFlags, device); dsh, ioh, ssh, taskLevel, dispatchFlags, device);
} }
CompletionStamp flushTaskStateless(LinearStream &commandStream, size_t commandStreamStart,
const IndirectHeap *dsh, const IndirectHeap *ioh, const IndirectHeap *ssh,
TaskCountType taskLevel, DispatchFlags &dispatchFlags, Device &device) override {
savedDispatchFlags = dispatchFlags;
return BaseClass::flushTaskStateless(commandStream, commandStreamStart,
dsh, ioh, ssh, taskLevel, dispatchFlags, device);
}
DispatchFlags savedDispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags(); DispatchFlags savedDispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags();
}; };

View File

@@ -742,6 +742,10 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenEnqueueWithoutArbitrationPoli
debugManager.flags.ForceThreadArbitrationPolicyProgrammingWithScm.set(1); debugManager.flags.ForceThreadArbitrationPolicyProgrammingWithScm.set(1);
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessStateInitialized) {
GTEST_SKIP();
}
commandStreamReceiver.streamProperties.initSupport(pDevice->getRootDeviceEnvironment()); commandStreamReceiver.streamProperties.initSupport(pDevice->getRootDeviceEnvironment());
auto &csrThreadArbitrationPolicy = commandStreamReceiver.streamProperties.stateComputeMode.threadArbitrationPolicy.value; auto &csrThreadArbitrationPolicy = commandStreamReceiver.streamProperties.stateComputeMode.threadArbitrationPolicy.value;

View File

@@ -32,7 +32,9 @@ typedef UltCommandStreamReceiverTest CommandStreamReceiverFlushTaskXeHPAndLaterT
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, whenReprogrammingSshThenBindingTablePoolIsProgrammed) { HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, whenReprogrammingSshThenBindingTablePoolIsProgrammed) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessModeEnabled) {
GTEST_SKIP();
}
flushTask(commandStreamReceiver); flushTask(commandStreamReceiver);
parseCommands<FamilyType>(commandStreamReceiver.getCS(0)); parseCommands<FamilyType>(commandStreamReceiver.getCS(0));
auto bindingTablePoolAlloc = getCommand<typename FamilyType::_3DSTATE_BINDING_TABLE_POOL_ALLOC>(); auto bindingTablePoolAlloc = getCommand<typename FamilyType::_3DSTATE_BINDING_TABLE_POOL_ALLOC>();
@@ -48,6 +50,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, wh
debugManager.flags.DisableCachingForHeaps.set(1); debugManager.flags.DisableCachingForHeaps.set(1);
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessModeEnabled) {
GTEST_SKIP();
}
flushTask(commandStreamReceiver); flushTask(commandStreamReceiver);
parseCommands<FamilyType>(commandStreamReceiver.getCS(0)); parseCommands<FamilyType>(commandStreamReceiver.getCS(0));
@@ -61,6 +66,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, wh
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, whenNotReprogrammingSshThenBindingTablePoolIsNotProgrammed) { HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, whenNotReprogrammingSshThenBindingTablePoolIsNotProgrammed) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessModeEnabled) {
GTEST_SKIP();
}
flushTask(commandStreamReceiver); flushTask(commandStreamReceiver);
parseCommands<FamilyType>(commandStreamReceiver.getCS(0)); parseCommands<FamilyType>(commandStreamReceiver.getCS(0));
@@ -159,7 +167,9 @@ HWTEST2_F(CommandStreamReceiverFlushTaskXeHPAndLaterTests, givenSBACommandToProg
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, whenNotReprogrammingSshButInitProgrammingFlagsThenBindingTablePoolIsProgrammed) { HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, whenNotReprogrammingSshButInitProgrammingFlagsThenBindingTablePoolIsProgrammed) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessModeEnabled) {
GTEST_SKIP();
}
flushTask(commandStreamReceiver); flushTask(commandStreamReceiver);
parseCommands<FamilyType>(commandStreamReceiver.getCS(0)); parseCommands<FamilyType>(commandStreamReceiver.getCS(0));
auto stateBaseAddress = getCommand<typename FamilyType::STATE_BASE_ADDRESS>(); auto stateBaseAddress = getCommand<typename FamilyType::STATE_BASE_ADDRESS>();
@@ -221,8 +231,13 @@ HWTEST2_F(CommandStreamReceiverFlushTaskXeHPAndLaterTests, whenFlushAllCachesVar
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, givenconfigureCSRtoNonDirtyStateWhenFlushTaskIsCalledThenNoCommandsAreAdded) { HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, givenconfigureCSRtoNonDirtyStateWhenFlushTaskIsCalledThenNoCommandsAreAdded) {
configureCSRtoNonDirtyState<FamilyType>(true); configureCSRtoNonDirtyState<FamilyType>(true);
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
auto sizeUsedBefore = commandStreamReceiver.commandStream.getUsed();
flushTask(commandStreamReceiver); flushTask(commandStreamReceiver);
EXPECT_EQ(commandStreamReceiver.heaplessStateInitialized ? 1u : 0u, commandStreamReceiver.commandStream.getUsed());
auto sizeUsedAfter = commandStreamReceiver.commandStream.getUsed();
EXPECT_EQ(sizeUsedBefore, sizeUsedAfter);
} }
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, givenCsrInBatchingModeWhenTaskIsSubmittedViaCsrThenBbEndCoversPaddingEnoughToFitMiBatchBufferStart) { HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, givenCsrInBatchingModeWhenTaskIsSubmittedViaCsrThenBbEndCoversPaddingEnoughToFitMiBatchBufferStart) {
@@ -235,6 +250,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, gi
mockCsr.getCS(1024u); mockCsr.getCS(1024u);
auto &csrCommandStream = mockCsr.commandStream; auto &csrCommandStream = mockCsr.commandStream;
auto usedBefore = mockCsr.commandStream.getUsed();
// we do level change that will emit PPC, fill all the space so only BB end fits. // we do level change that will emit PPC, fill all the space so only BB end fits.
taskLevel++; taskLevel++;
auto ppcSize = MemorySynchronizationCommands<FamilyType>::getSizeForSingleBarrier(false); auto ppcSize = MemorySynchronizationCommands<FamilyType>::getSizeForSingleBarrier(false);
@@ -244,7 +261,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, gi
flushTask(mockCsr); flushTask(mockCsr);
EXPECT_EQ(expectedUsedSize, mockCsr.commandStream.getUsed()); auto usedAfter = mockCsr.commandStream.getUsed();
auto sizeUsed = usedAfter - usedBefore;
EXPECT_EQ(expectedUsedSize, sizeUsed);
} }
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, GivenSameTaskLevelThenDontSendPipeControl) { HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, GivenSameTaskLevelThenDontSendPipeControl) {
@@ -281,7 +300,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, gi
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, givenCommandStreamReceiverWithInstructionCacheRequestWhenFlushTaskIsCalledThenPipeControlWithInstructionCacheIsEmitted) { HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, givenCommandStreamReceiverWithInstructionCacheRequestWhenFlushTaskIsCalledThenPipeControlWithInstructionCacheIsEmitted) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessStateInitialized) {
GTEST_SKIP();
}
auto startRecursiveLockCounter = commandStreamReceiver.recursiveLockCounter.load(); auto startRecursiveLockCounter = commandStreamReceiver.recursiveLockCounter.load();
configureCSRtoNonDirtyState<FamilyType>(true); configureCSRtoNonDirtyState<FamilyType>(true);
@@ -307,9 +328,10 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, gi
commandStreamReceiver.taskLevel = taskLevel; commandStreamReceiver.taskLevel = taskLevel;
taskLevel++; // submit with higher taskLevel taskLevel++; // submit with higher taskLevel
auto offset = commandStreamReceiver.commandStream.getUsed();
flushTask(commandStreamReceiver); flushTask(commandStreamReceiver);
parseCommands<FamilyType>(commandStreamReceiver.commandStream, 0); parseCommands<FamilyType>(commandStreamReceiver.commandStream, offset);
auto itorPC = find<typename FamilyType::PIPE_CONTROL *>(cmdList.begin(), cmdList.end()); auto itorPC = find<typename FamilyType::PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
EXPECT_EQ(cmdList.end(), itorPC); EXPECT_EQ(cmdList.end(), itorPC);
@@ -801,6 +823,9 @@ struct CommandStreamReceiverFlushTaskXeHPAndLaterMultiTileTests : public Command
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTileTests, HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTileTests,
givenMultipleStaticActivePartitionsWhenFlushingTaskThenExpectTagUpdatePipeControlWithPartitionFlagOnAndActivePartitionConfig) { givenMultipleStaticActivePartitionsWhenFlushingTaskThenExpectTagUpdatePipeControlWithPartitionFlagOnAndActivePartitionConfig) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessStateInitialized) {
GTEST_SKIP();
}
EXPECT_EQ(1u, commandStreamReceiver.activePartitionsConfig); EXPECT_EQ(1u, commandStreamReceiver.activePartitionsConfig);
commandStreamReceiver.activePartitions = 2; commandStreamReceiver.activePartitions = 2;
@@ -822,6 +847,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTile
debugManager.flags.UpdateTaskCountFromWait.set(3); debugManager.flags.UpdateTaskCountFromWait.set(3);
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessStateInitialized) {
GTEST_SKIP();
}
EXPECT_EQ(1u, commandStreamReceiver.activePartitionsConfig); EXPECT_EQ(1u, commandStreamReceiver.activePartitionsConfig);
commandStreamReceiver.activePartitions = 2; commandStreamReceiver.activePartitions = 2;
@@ -838,7 +866,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTile
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTileTests, HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTileTests,
givenSingleStaticActivePartitionWhenFlushingTaskThenExpectTagUpdatePipeControlWithoutPartitionFlagOnAndNoActivePartitionConfig) { givenSingleStaticActivePartitionWhenFlushingTaskThenExpectTagUpdatePipeControlWithoutPartitionFlagOnAndNoActivePartitionConfig) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessStateInitialized) {
GTEST_SKIP();
}
commandStreamReceiver.activePartitions = 1; commandStreamReceiver.activePartitions = 1;
commandStreamReceiver.taskCount = 3; commandStreamReceiver.taskCount = 3;
flushTask(commandStreamReceiver, true); flushTask(commandStreamReceiver, true);
@@ -859,6 +889,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTile
debugManager.flags.UpdateTaskCountFromWait.set(3); debugManager.flags.UpdateTaskCountFromWait.set(3);
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessStateInitialized) {
GTEST_SKIP();
}
EXPECT_EQ(1u, commandStreamReceiver.activePartitionsConfig); EXPECT_EQ(1u, commandStreamReceiver.activePartitionsConfig);
commandStreamReceiver.activePartitions = 2; commandStreamReceiver.activePartitions = 2;
@@ -888,7 +921,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTile
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTileTests, HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTileTests,
givenMultipleDynamicActivePartitionsWhenFlushingTaskTwiceThenExpectTagUpdatePipeControlWithoutPartitionFlagAndPartitionRegisters) { givenMultipleDynamicActivePartitionsWhenFlushingTaskTwiceThenExpectTagUpdatePipeControlWithoutPartitionFlagAndPartitionRegisters) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessStateInitialized) {
GTEST_SKIP();
}
commandStreamReceiver.activePartitions = 2; commandStreamReceiver.activePartitions = 2;
commandStreamReceiver.taskCount = 3; commandStreamReceiver.taskCount = 3;
commandStreamReceiver.staticWorkPartitioningEnabled = false; commandStreamReceiver.staticWorkPartitioningEnabled = false;
@@ -908,7 +943,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTile
debugManager.flags.UpdateTaskCountFromWait.set(1); debugManager.flags.UpdateTaskCountFromWait.set(1);
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessStateInitialized) {
GTEST_SKIP();
}
commandStreamReceiver.activePartitions = 2; commandStreamReceiver.activePartitions = 2;
commandStreamReceiver.taskCount = 3; commandStreamReceiver.taskCount = 3;
commandStreamReceiver.staticWorkPartitioningEnabled = false; commandStreamReceiver.staticWorkPartitioningEnabled = false;
@@ -921,7 +958,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTile
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTileTests, HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterMultiTileTests,
givenMultipleStaticActivePartitionsAndDirectSubmissionActiveWhenFlushingTaskThenExpectTagUpdatePipeControlWithPartitionFlagOnAndNoActivePartitionConfig) { givenMultipleStaticActivePartitionsAndDirectSubmissionActiveWhenFlushingTaskThenExpectTagUpdatePipeControlWithPartitionFlagOnAndNoActivePartitionConfig) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessStateInitialized) {
GTEST_SKIP();
}
commandStreamReceiver.directSubmission = std::make_unique<MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>>>(commandStreamReceiver); commandStreamReceiver.directSubmission = std::make_unique<MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>>>(commandStreamReceiver);
commandStreamReceiver.directSubmissionAvailable = true; commandStreamReceiver.directSubmissionAvailable = true;

View File

@@ -1052,8 +1052,14 @@ HWTEST2_F(RelaxedOrderingBcsTests, givenDependenciesWhenFlushingThenProgramCorre
// First submission with global state // First submission with global state
flushBcsTask(&csr, blitProperties, false, *pDevice); flushBcsTask(&csr, blitProperties, false, *pDevice);
EXPECT_TRUE(csr.latestFlushedBatchBuffer.hasStallingCmds);
EXPECT_FALSE(csr.latestFlushedBatchBuffer.hasRelaxedOrderingDependencies); if (csr.heaplessStateInitialized) {
EXPECT_FALSE(csr.latestFlushedBatchBuffer.hasStallingCmds);
EXPECT_TRUE(csr.latestFlushedBatchBuffer.hasRelaxedOrderingDependencies);
} else {
EXPECT_TRUE(csr.latestFlushedBatchBuffer.hasStallingCmds);
EXPECT_FALSE(csr.latestFlushedBatchBuffer.hasRelaxedOrderingDependencies);
}
auto cmdsOffset = csr.commandStream.getUsed(); auto cmdsOffset = csr.commandStream.getUsed();
@@ -1136,8 +1142,14 @@ HWTEST2_F(RelaxedOrderingBcsTests, givenTagUpdateWhenFlushingThenDisableRelaxedO
// First submission with global state // First submission with global state
flushBcsTask(&csr, blitProperties, false, *pDevice); flushBcsTask(&csr, blitProperties, false, *pDevice);
EXPECT_TRUE(csr.latestFlushedBatchBuffer.hasStallingCmds);
EXPECT_FALSE(csr.latestFlushedBatchBuffer.hasRelaxedOrderingDependencies); if (csr.heaplessStateInitialized) {
EXPECT_FALSE(csr.latestFlushedBatchBuffer.hasStallingCmds);
EXPECT_TRUE(csr.latestFlushedBatchBuffer.hasRelaxedOrderingDependencies);
} else {
EXPECT_TRUE(csr.latestFlushedBatchBuffer.hasStallingCmds);
EXPECT_FALSE(csr.latestFlushedBatchBuffer.hasRelaxedOrderingDependencies);
}
debugManager.flags.UpdateTaskCountFromWait.set(0); debugManager.flags.UpdateTaskCountFromWait.set(0);
@@ -1173,6 +1185,10 @@ HWTEST_F(BcsTests, givenBltSizeWithLeftoverWhenDispatchedThenProgramAllRequiredC
uint32_t newTaskCount = 19; uint32_t newTaskCount = 19;
csr.taskCount = newTaskCount - 1; csr.taskCount = newTaskCount - 1;
uint32_t expectedResursiveLockCount = csr.resourcesInitialized ? 1u : 0u; uint32_t expectedResursiveLockCount = csr.resourcesInitialized ? 1u : 0u;
if (csr.heaplessStateInitialized) {
expectedResursiveLockCount++;
}
EXPECT_EQ(expectedResursiveLockCount, csr.recursiveLockCounter.load()); EXPECT_EQ(expectedResursiveLockCount, csr.recursiveLockCounter.load());
auto bufferGpuVa = ptrOffset(buffer->getGraphicsAllocation(pDevice->getRootDeviceIndex())->getGpuAddress(), buffer->getOffset()); auto bufferGpuVa = ptrOffset(buffer->getGraphicsAllocation(pDevice->getRootDeviceIndex())->getGpuAddress(), buffer->getOffset());
auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::hostPtrToBuffer, auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::hostPtrToBuffer,

View File

@@ -763,7 +763,8 @@ HWTEST_F(BcsTests, givenInputAllocationsWhenBlitDispatchedThenMakeAllAllocations
auto hostAllocationPtr2 = allocateAlignedMemory(hostAllocationSize, MemoryConstants::pageSize); auto hostAllocationPtr2 = allocateAlignedMemory(hostAllocationSize, MemoryConstants::pageSize);
void *hostPtr2 = reinterpret_cast<void *>(hostAllocationPtr2.get()); void *hostPtr2 = reinterpret_cast<void *>(hostAllocationPtr2.get());
EXPECT_EQ(0u, csr.makeSurfacePackNonResidentCalled); auto expectedCalled = csr.heaplessStateInitialized ? 1u : 0u;
EXPECT_EQ(expectedCalled, csr.makeSurfacePackNonResidentCalled);
auto graphicsAllocation1 = buffer1->getGraphicsAllocation(pDevice->getRootDeviceIndex()); auto graphicsAllocation1 = buffer1->getGraphicsAllocation(pDevice->getRootDeviceIndex());
auto graphicsAllocation2 = buffer2->getGraphicsAllocation(pDevice->getRootDeviceIndex()); auto graphicsAllocation2 = buffer2->getGraphicsAllocation(pDevice->getRootDeviceIndex());
@@ -783,12 +784,13 @@ HWTEST_F(BcsTests, givenInputAllocationsWhenBlitDispatchedThenMakeAllAllocations
csr.flushBcsTask(blitPropertiesContainer, false, false, *pDevice); csr.flushBcsTask(blitPropertiesContainer, false, false, *pDevice);
expectedCalled++;
uint32_t residentAllocationsNum = 5u; uint32_t residentAllocationsNum = 5u;
EXPECT_TRUE(csr.isMadeResident(graphicsAllocation1)); EXPECT_TRUE(csr.isMadeResident(graphicsAllocation1));
EXPECT_TRUE(csr.isMadeResident(graphicsAllocation2)); EXPECT_TRUE(csr.isMadeResident(graphicsAllocation2));
EXPECT_TRUE(csr.isMadeResident(csr.getTagAllocation())); EXPECT_TRUE(csr.isMadeResident(csr.getTagAllocation()));
EXPECT_TRUE(csr.isMadeResident(csr.getTagAllocation())); EXPECT_TRUE(csr.isMadeResident(csr.getTagAllocation()));
EXPECT_EQ(1u, csr.makeSurfacePackNonResidentCalled); EXPECT_EQ(expectedCalled, csr.makeSurfacePackNonResidentCalled);
auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironmentRef(); auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironmentRef();
if (getHelper<ProductHelper>().isDummyBlitWaRequired()) { if (getHelper<ProductHelper>().isDummyBlitWaRequired()) {
residentAllocationsNum++; residentAllocationsNum++;
@@ -883,7 +885,7 @@ HWTEST_F(BcsTests, givenBufferWhenBlitCalledThenFlushCommandBuffer) {
auto &commandStream = csr.getCS(MemoryConstants::pageSize); auto &commandStream = csr.getCS(MemoryConstants::pageSize);
size_t commandStreamOffset = 4; size_t commandStreamOffset = 4;
commandStream.getSpace(commandStreamOffset); commandStream.getSpace(commandStreamOffset);
commandStreamOffset = commandStream.getUsed();
uint32_t newTaskCount = 17; uint32_t newTaskCount = 17;
csr.taskCount = newTaskCount - 1; csr.taskCount = newTaskCount - 1;
@@ -922,6 +924,7 @@ HWTEST_F(BcsTests, givenTaskStreamWhenFlushingThenStoreTaskStartAddress) {
auto &commandStream = csr.getCS(MemoryConstants::pageSize); auto &commandStream = csr.getCS(MemoryConstants::pageSize);
size_t commandStreamOffset = 4; size_t commandStreamOffset = 4;
commandStream.getSpace(commandStreamOffset); commandStream.getSpace(commandStreamOffset);
commandStreamOffset = commandStream.getUsed();
auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::hostPtrToBuffer, auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::hostPtrToBuffer,
csr, graphicsAllocation, nullptr, hostPtr, csr, graphicsAllocation, nullptr, hostPtr,

View File

@@ -20,6 +20,9 @@ HWTEST2_F(CommandStreamReceiverXe2AndLater, GivenPreambleNotSentAndDebugFlagEnab
debugManager.flags.PipelinedPipelineSelect.set(true); debugManager.flags.PipelinedPipelineSelect.set(true);
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessStateInitialized) {
GTEST_SKIP();
}
commandStreamReceiver.isPreambleSent = false; commandStreamReceiver.isPreambleSent = false;
flushTask(commandStreamReceiver); flushTask(commandStreamReceiver);

View File

@@ -296,6 +296,7 @@ TEST(DeviceCreation, givenMultiRootDeviceWhenTheyAreCreatedThenEachOsContextHasU
executionEnvironment->rootDeviceEnvironments[i]->initGmm(); executionEnvironment->rootDeviceEnvironments[i]->initGmm();
executionEnvironment->rootDeviceEnvironments[i]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true; executionEnvironment->rootDeviceEnvironments[i]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true;
} }
executionEnvironment->calculateMaxOsContextCount();
auto device1 = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 0u)); auto device1 = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 0u));
auto device2 = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 1u)); auto device2 = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 1u));
@@ -355,8 +356,12 @@ TEST(DeviceCreation, givenMultiRootDeviceWhenTheyAreCreatedThenEachDeviceHasSepe
executionEnvironment->prepareRootDeviceEnvironments(numDevices); executionEnvironment->prepareRootDeviceEnvironments(numDevices);
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) { for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(defaultHwInfo.get()); executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->initGmm(); executionEnvironment->rootDeviceEnvironments[i]->initGmm();
} }
executionEnvironment->calculateMaxOsContextCount();
auto device = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 0u)); auto device = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 0u));
auto device2 = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 1u)); auto device2 = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 1u));
@@ -373,6 +378,7 @@ TEST(DeviceCreation, givenMultiRootDeviceWhenTheyAreCreatedThenEachDeviceHasSepe
executionEnvironment->rootDeviceEnvironments[i]->initGmm(); executionEnvironment->rootDeviceEnvironments[i]->initGmm();
executionEnvironment->rootDeviceEnvironments[i]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true; executionEnvironment->rootDeviceEnvironments[i]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true;
} }
executionEnvironment->calculateMaxOsContextCount();
auto &gfxCoreHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper<GfxCoreHelper>(); auto &gfxCoreHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper<GfxCoreHelper>();
const auto &numGpgpuEngines = gfxCoreHelper.getGpgpuEngineInstances(*executionEnvironment->rootDeviceEnvironments[0]).size(); const auto &numGpgpuEngines = gfxCoreHelper.getGpgpuEngineInstances(*executionEnvironment->rootDeviceEnvironments[0]).size();

View File

@@ -73,6 +73,8 @@ TEST(SubDevicesTest, givenDeviceWithSubDevicesWhenSubDeviceApiRefCountsAreChange
std::unordered_map<std::string, std::string> mockableEnvs = {{"ZE_FLAT_DEVICE_HIERARCHY", "COMPOSITE"}}; std::unordered_map<std::string, std::string> mockableEnvs = {{"ZE_FLAT_DEVICE_HIERARCHY", "COMPOSITE"}};
VariableBackup<std::unordered_map<std::string, std::string> *> mockableEnvValuesBackup(&IoFunctions::mockableEnvValues, &mockableEnvs); VariableBackup<std::unordered_map<std::string, std::string> *> mockableEnvValuesBackup(&IoFunctions::mockableEnvValues, &mockableEnvs);
debugManager.flags.CreateMultipleSubDevices.set(2); debugManager.flags.CreateMultipleSubDevices.set(2);
UnitTestSetter::disableHeaplessStateInit(restorer);
VariableBackup<bool> mockDeviceFlagBackup(&MockDevice::createSingleDevice, false); VariableBackup<bool> mockDeviceFlagBackup(&MockDevice::createSingleDevice, false);
initPlatform(); initPlatform();
auto nonDefaultPlatform = std::make_unique<MockPlatform>(*platform()->peekExecutionEnvironment()); auto nonDefaultPlatform = std::make_unique<MockPlatform>(*platform()->peekExecutionEnvironment());
@@ -108,7 +110,9 @@ TEST(SubDevicesTest, givenDeviceWithSubDevicesWhenSubDeviceApiRefCountsAreChange
TEST(SubDevicesTest, givenDeviceWithSubDevicesAndSubDevicesAsDevicesIsSetWhenSubDeviceApiRefCountsAreChangedThenChangeIsNotPropagatedToRootDevice) { TEST(SubDevicesTest, givenDeviceWithSubDevicesAndSubDevicesAsDevicesIsSetWhenSubDeviceApiRefCountsAreChangedThenChangeIsNotPropagatedToRootDevice) {
DebugManagerStateRestore restorer; DebugManagerStateRestore restorer;
debugManager.flags.CreateMultipleSubDevices.set(2); debugManager.flags.CreateMultipleSubDevices.set(2);
UnitTestSetter::disableHeaplessStateInit(restorer);
VariableBackup<bool> mockDeviceFlagBackup(&MockDevice::createSingleDevice, false); VariableBackup<bool> mockDeviceFlagBackup(&MockDevice::createSingleDevice, false);
initPlatform(); initPlatform();
platform()->peekExecutionEnvironment()->setExposeSubDevicesAsDevices(1); platform()->peekExecutionEnvironment()->setExposeSubDevicesAsDevices(1);
auto nonDefaultPlatform = std::make_unique<MockPlatform>(*platform()->peekExecutionEnvironment()); auto nonDefaultPlatform = std::make_unique<MockPlatform>(*platform()->peekExecutionEnvironment());
@@ -144,6 +148,7 @@ TEST(SubDevicesTest, givenDeviceWithSubDevicesAndSubDevicesAsDevicesIsSetWhenSub
TEST(SubDevicesTest, givenDeviceWithSubDevicesWhenSubDeviceInternalRefCountsAreChangedThenChangeIsPropagatedToRootDevice) { TEST(SubDevicesTest, givenDeviceWithSubDevicesWhenSubDeviceInternalRefCountsAreChangedThenChangeIsPropagatedToRootDevice) {
DebugManagerStateRestore restorer; DebugManagerStateRestore restorer;
debugManager.flags.CreateMultipleSubDevices.set(2); debugManager.flags.CreateMultipleSubDevices.set(2);
VariableBackup<bool> mockDeviceFlagBackup(&MockDevice::createSingleDevice, false); VariableBackup<bool> mockDeviceFlagBackup(&MockDevice::createSingleDevice, false);
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get())); auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
device->incRefInternal(); device->incRefInternal();

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2023 Intel Corporation * Copyright (C) 2018-2024 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -62,7 +62,7 @@ class AsyncEventsHandlerTests : public ::testing::Test {
commandQueue = makeReleaseable<MockCommandQueue>(context.get(), context->getDevice(0), nullptr, false); commandQueue = makeReleaseable<MockCommandQueue>(context.get(), context->getDevice(0), nullptr, false);
*(commandQueue->getGpgpuCommandStreamReceiver().getTagAddress()) = 0; *(commandQueue->getGpgpuCommandStreamReceiver().getTagAddress()) = commandQueue->getHeaplessStateInitEnabled() ? 1 : 0;
event1 = makeReleaseable<MyEvent>(context.get(), commandQueue.get(), CL_COMMAND_BARRIER, CompletionStamp::notReady, CompletionStamp::notReady); event1 = makeReleaseable<MyEvent>(context.get(), commandQueue.get(), CL_COMMAND_BARRIER, CompletionStamp::notReady, CompletionStamp::notReady);
event2 = makeReleaseable<MyEvent>(context.get(), commandQueue.get(), CL_COMMAND_BARRIER, CompletionStamp::notReady, CompletionStamp::notReady); event2 = makeReleaseable<MyEvent>(context.get(), commandQueue.get(), CL_COMMAND_BARRIER, CompletionStamp::notReady, CompletionStamp::notReady);
@@ -81,6 +81,7 @@ class AsyncEventsHandlerTests : public ::testing::Test {
}; };
TEST_F(AsyncEventsHandlerTests, givenEventsWhenListIsProcessedThenUpdateExecutionStatus) { TEST_F(AsyncEventsHandlerTests, givenEventsWhenListIsProcessedThenUpdateExecutionStatus) {
event1->setTaskStamp(0, 0); event1->setTaskStamp(0, 0);
event2->setTaskStamp(0, 0); event2->setTaskStamp(0, 0);
@@ -314,9 +315,9 @@ TEST_F(AsyncEventsHandlerTests, givenUserEventWhenCallbackIsAddedThenDontRegiste
TEST_F(AsyncEventsHandlerTests, givenRegistredEventsWhenProcessIsCalledThenReturnCandidateWithLowestTaskCount) { TEST_F(AsyncEventsHandlerTests, givenRegistredEventsWhenProcessIsCalledThenReturnCandidateWithLowestTaskCount) {
int event1Counter(0), event2Counter(0), event3Counter(0); int event1Counter(0), event2Counter(0), event3Counter(0);
event1->setTaskStamp(0, 1); event1->setTaskStamp(0, commandQueue->getHeaplessStateInitEnabled() ? 2 : 1);
event2->setTaskStamp(0, 2); event2->setTaskStamp(0, commandQueue->getHeaplessStateInitEnabled() ? 3 : 2);
event3->setTaskStamp(0, 3); event3->setTaskStamp(0, commandQueue->getHeaplessStateInitEnabled() ? 4 : 3);
event2->addCallback(&this->callbackFcn, CL_COMPLETE, &event2Counter); event2->addCallback(&this->callbackFcn, CL_COMPLETE, &event2Counter);
handler->registerEvent(event2.get()); handler->registerEvent(event2.get());
@@ -334,8 +335,8 @@ TEST_F(AsyncEventsHandlerTests, givenRegistredEventsWhenProcessIsCalledThenRetur
} }
TEST_F(AsyncEventsHandlerTests, givenEventWithoutCallbacksWhenProcessedThenDontReturnAsSleepCandidate) { TEST_F(AsyncEventsHandlerTests, givenEventWithoutCallbacksWhenProcessedThenDontReturnAsSleepCandidate) {
event1->setTaskStamp(0, 1); event1->setTaskStamp(0, commandQueue->getHeaplessStateInitEnabled() ? 2 : 1);
event2->setTaskStamp(0, 2); event2->setTaskStamp(0, commandQueue->getHeaplessStateInitEnabled() ? 3 : 2);
handler->registerEvent(event1.get()); handler->registerEvent(event1.get());
event2->addCallback(&this->callbackFcn, CL_COMPLETE, &counter); event2->addCallback(&this->callbackFcn, CL_COMPLETE, &counter);
@@ -348,7 +349,7 @@ TEST_F(AsyncEventsHandlerTests, givenEventWithoutCallbacksWhenProcessedThenDontR
} }
TEST_F(AsyncEventsHandlerTests, givenNoGpuHangAndSleepCandidateWhenProcessedThenCallWaitWithQuickKmdSleepRequest) { TEST_F(AsyncEventsHandlerTests, givenNoGpuHangAndSleepCandidateWhenProcessedThenCallWaitWithQuickKmdSleepRequest) {
event1->setTaskStamp(0, 1); event1->setTaskStamp(0, commandQueue->getHeaplessStateInitEnabled() ? 2 : 1);
event1->addCallback(&this->callbackFcn, CL_COMPLETE, &counter); event1->addCallback(&this->callbackFcn, CL_COMPLETE, &counter);
event1->handler->registerEvent(event1.get()); event1->handler->registerEvent(event1.get());
event1->handler->allowAsyncProcess.store(true); event1->handler->allowAsyncProcess.store(true);
@@ -362,7 +363,7 @@ TEST_F(AsyncEventsHandlerTests, givenNoGpuHangAndSleepCandidateWhenProcessedThen
} }
TEST_F(AsyncEventsHandlerTests, givenSleepCandidateAndGpuHangWhenProcessedThenCallWaitAndSetExecutionStatusToAbortedDueToGpuHang) { TEST_F(AsyncEventsHandlerTests, givenSleepCandidateAndGpuHangWhenProcessedThenCallWaitAndSetExecutionStatusToAbortedDueToGpuHang) {
event1->setTaskStamp(0, 1); event1->setTaskStamp(0, commandQueue->getHeaplessStateInitEnabled() ? 2 : 1);
event1->addCallback(&this->callbackFcn, CL_COMPLETE, &counter); event1->addCallback(&this->callbackFcn, CL_COMPLETE, &counter);
event1->handler->registerEvent(event1.get()); event1->handler->registerEvent(event1.get());
event1->handler->allowAsyncProcess.store(true); event1->handler->allowAsyncProcess.store(true);

View File

@@ -587,7 +587,7 @@ TEST_F(InternalsEventTest, givenBlockedKernelWithPrintfWhenSubmittedThenPrintOut
event.submitCommand(false); event.submitCommand(false);
EXPECT_EQ(1u, mockCmdQueue.latestTaskCountWaited); EXPECT_EQ(mockCmdQueue.getHeaplessStateInitEnabled() ? 2u : 1u, mockCmdQueue.latestTaskCountWaited);
std::string output = testing::internal::GetCapturedStdout(); std::string output = testing::internal::GetCapturedStdout();
EXPECT_STREQ("test", output.c_str()); EXPECT_STREQ("test", output.c_str());

View File

@@ -12,6 +12,7 @@
#include "shared/source/command_stream/preemption.h" #include "shared/source/command_stream/preemption.h"
#include "shared/source/gmm_helper/gmm_helper.h" #include "shared/source/gmm_helper/gmm_helper.h"
#include "shared/source/helpers/cache_policy.h" #include "shared/source/helpers/cache_policy.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/helpers/gfx_core_helper.h"
#include "shared/source/helpers/preamble.h" #include "shared/source/helpers/preamble.h"
#include "shared/source/memory_manager/graphics_allocation.h" #include "shared/source/memory_manager/graphics_allocation.h"
@@ -48,6 +49,11 @@ struct UltCommandStreamReceiverTest
flushTaskFlags.threadArbitrationPolicy = gfxCoreHelper.getDefaultThreadArbitrationPolicy(); flushTaskFlags.threadArbitrationPolicy = gfxCoreHelper.getDefaultThreadArbitrationPolicy();
pDevice->getGpgpuCommandStreamReceiver().setupContext(*pDevice->getDefaultEngine().osContext); pDevice->getGpgpuCommandStreamReceiver().setupContext(*pDevice->getDefaultEngine().osContext);
auto &compilerProductHelper = pDevice->getCompilerProductHelper();
auto heaplessEnabled = compilerProductHelper.isHeaplessModeEnabled();
this->heaplessStateEnabled = compilerProductHelper.isHeaplessStateInitEnabled(heaplessEnabled);
} }
void initHeaps() { void initHeaps() {
@@ -88,6 +94,19 @@ struct UltCommandStreamReceiverTest
ClDeviceFixture::tearDown(); ClDeviceFixture::tearDown();
} }
template <typename GfxFamily, typename CommandStreamReceiverType>
CompletionStamp flushTaskMethod(CommandStreamReceiverType &commandStreamReceiver, LinearStream &commandStream, size_t commandStreamStart,
const IndirectHeap *dsh, const IndirectHeap *ioh, const IndirectHeap *ssh,
TaskCountType taskLevel, DispatchFlags &dispatchFlags, Device &device) {
if (reinterpret_cast<UltCommandStreamReceiver<GfxFamily> *>(&commandStreamReceiver)->heaplessStateInitialized) {
return commandStreamReceiver.flushTaskStateless(commandStream, commandStreamStart, dsh, ioh, ssh, taskLevel, dispatchFlags, device);
} else {
return commandStreamReceiver.flushTask(commandStream, commandStreamStart, dsh, ioh, ssh, taskLevel, dispatchFlags, device);
}
}
template <typename CommandStreamReceiverType> template <typename CommandStreamReceiverType>
CompletionStamp flushTask(CommandStreamReceiverType &commandStreamReceiver, CompletionStamp flushTask(CommandStreamReceiverType &commandStreamReceiver,
bool block = false, bool block = false,
@@ -95,19 +114,35 @@ struct UltCommandStreamReceiverTest
bool requiresCoherency = false, bool requiresCoherency = false,
bool lowPriority = false) { bool lowPriority = false) {
flushTaskFlags.blocking = block; if (commandStreamReceiver.heaplessStateInitialized) {
flushTaskFlags.lowPriority = lowPriority; flushTaskFlags.blocking = block;
flushTaskFlags.preemptionMode = PreemptionHelper::getDefaultPreemptionMode(pDevice->getHardwareInfo()); flushTaskFlags.lowPriority = lowPriority;
flushTaskFlags.preemptionMode = PreemptionHelper::getDefaultPreemptionMode(pDevice->getHardwareInfo());
return commandStreamReceiver.flushTask( return commandStreamReceiver.flushTaskStateless(
commandStream, commandStream,
startOffset, startOffset,
&dsh, &dsh,
&ioh, &ioh,
&ssh, &ssh,
taskLevel, taskLevel,
flushTaskFlags, flushTaskFlags,
*pDevice); *pDevice);
} else {
flushTaskFlags.blocking = block;
flushTaskFlags.lowPriority = lowPriority;
flushTaskFlags.preemptionMode = PreemptionHelper::getDefaultPreemptionMode(pDevice->getHardwareInfo());
return commandStreamReceiver.flushTask(
commandStream,
startOffset,
&dsh,
&ioh,
&ssh,
taskLevel,
flushTaskFlags,
*pDevice);
}
} }
template <typename CommandStreamReceiverType> template <typename CommandStreamReceiverType>
@@ -181,5 +216,6 @@ struct UltCommandStreamReceiverTest
const size_t sizeStream = 512; const size_t sizeStream = 512;
const size_t alignmentStream = 0x1000; const size_t alignmentStream = 0x1000;
bool heaplessStateEnabled = false;
}; };
} // namespace NEO } // namespace NEO

View File

@@ -27,10 +27,9 @@ using namespace NEO;
TEST(CommandTest, GivenNoTerminateFlagWhenSubmittingMapUnmapThenCsrIsFlushed) { TEST(CommandTest, GivenNoTerminateFlagWhenSubmittingMapUnmapThenCsrIsFlushed) {
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr)); auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
std::unique_ptr<MockCommandQueue> cmdQ(new MockCommandQueue(nullptr, device.get(), nullptr, false)); std::unique_ptr<MockCommandQueue> cmdQ(new MockCommandQueue(nullptr, device.get(), nullptr, false));
MockCommandStreamReceiver csr(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield());
MockBuffer buffer;
auto initialTaskCount = csr.peekTaskCount(); MockBuffer buffer;
auto initialTaskCount = 0u;
MemObjSizeArray size = {{1, 1, 1}}; MemObjSizeArray size = {{1, 1, 1}};
MemObjOffsetArray offset = {{0, 0, 0}}; MemObjOffsetArray offset = {{0, 0, 0}};
@@ -38,7 +37,7 @@ TEST(CommandTest, GivenNoTerminateFlagWhenSubmittingMapUnmapThenCsrIsFlushed) {
CompletionStamp completionStamp = command->submit(20, false); CompletionStamp completionStamp = command->submit(20, false);
auto expectedTaskCount = initialTaskCount + 1; auto expectedTaskCount = initialTaskCount + 1;
if (csr.heaplessStateInitialized) { if (cmdQ->heaplessStateInitEnabled) {
expectedTaskCount++; expectedTaskCount++;
} }
EXPECT_EQ(expectedTaskCount, completionStamp.taskCount); EXPECT_EQ(expectedTaskCount, completionStamp.taskCount);
@@ -67,22 +66,15 @@ TEST(CommandTest, GivenTerminateFlagWhenSubmittingMapUnmapThenFlushIsAborted) {
TEST(CommandTest, GivenNoTerminateFlagWhenSubmittingMarkerThenCsrIsNotFlushed) { TEST(CommandTest, GivenNoTerminateFlagWhenSubmittingMarkerThenCsrIsNotFlushed) {
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr)); auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
std::unique_ptr<MockCommandQueue> cmdQ(new MockCommandQueue(nullptr, device.get(), nullptr, false)); std::unique_ptr<MockCommandQueue> cmdQ(new MockCommandQueue(nullptr, device.get(), nullptr, false));
MockCommandStreamReceiver csr(*device->getExecutionEnvironment(), device->getRootDeviceIndex(), device->getDeviceBitfield());
MockBuffer buffer; MockBuffer buffer;
auto initialTaskCount = csr.peekTaskCount(); auto heaplessStateInit = cmdQ->getHeaplessStateInitEnabled();
auto initialTaskCount = heaplessStateInit ? 1u : 0u;
std::unique_ptr<Command> command(new CommandWithoutKernel(*cmdQ)); std::unique_ptr<Command> command(new CommandWithoutKernel(*cmdQ));
CompletionStamp completionStamp = command->submit(20, false); CompletionStamp completionStamp = command->submit(20, false);
auto heaplessStateInit = cmdQ->getHeaplessStateInitEnabled(); EXPECT_EQ(initialTaskCount, completionStamp.taskCount);
if (heaplessStateInit) {
EXPECT_EQ(1u, initialTaskCount);
} else {
EXPECT_EQ(0u, initialTaskCount);
}
EXPECT_EQ(0u, completionStamp.taskCount);
EXPECT_EQ(initialTaskCount, csr.peekTaskCount());
} }
TEST(CommandTest, GivenTerminateFlagWhenSubmittingMarkerThenFlushIsAborted) { TEST(CommandTest, GivenTerminateFlagWhenSubmittingMarkerThenFlushIsAborted) {

View File

@@ -355,6 +355,10 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, givenDebug
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
if (commandStreamReceiver.heaplessStateInitialized) {
GTEST_SKIP();
}
debugManager.flags.ForceMultiGpuAtomics.set(0); debugManager.flags.ForceMultiGpuAtomics.set(0);
debugManager.flags.ForceMultiGpuPartialWrites.set(0); debugManager.flags.ForceMultiGpuPartialWrites.set(0);
flushTask(commandStreamReceiver); flushTask(commandStreamReceiver);

View File

@@ -920,17 +920,17 @@ HWTEST_F(TimestampPacketTests, givenEventWhenReleasingThenCheckQueueResources) {
cmdQ->flush(); cmdQ->flush();
auto tagAddress = csr.getTagAddress(); auto tagAddress = csr.getTagAddress();
*tagAddress = 1; *tagAddress = csr.heaplessStateInitialized ? 2 : 1;
EXPECT_EQ(2u, csr.taskCount); EXPECT_EQ(csr.heaplessStateInitialized ? 3u : 2u, csr.taskCount);
EXPECT_EQ(2u, cmdQ->taskCount); EXPECT_EQ(csr.heaplessStateInitialized ? 3u : 2u, cmdQ->taskCount);
clWaitForEvents(1, &clEvent); clWaitForEvents(1, &clEvent);
EXPECT_EQ(1u, deferredTimestampPackets->peekNodes().size()); EXPECT_EQ(1u, deferredTimestampPackets->peekNodes().size());
EXPECT_EQ(1u, timestampPacketContainer->peekNodes().size()); EXPECT_EQ(1u, timestampPacketContainer->peekNodes().size());
*tagAddress = 2; *tagAddress = csr.heaplessStateInitialized ? 3 : 2;
clReleaseEvent(clEvent); clReleaseEvent(clEvent);
@@ -964,10 +964,10 @@ HWTEST_F(TimestampPacketTests, givenAllEnginesReadyWhenWaitingForEventThenClearD
cmdQ->flush(); cmdQ->flush();
EXPECT_EQ(2u, csr.taskCount); EXPECT_EQ(cmdQ->heaplessStateInitEnabled ? 3u : 2u, csr.taskCount);
auto tagAddress = csr.getTagAddress(); auto tagAddress = csr.getTagAddress();
*tagAddress = 1; *tagAddress = cmdQ->heaplessStateInitEnabled ? 2 : 1;
auto eventObj1 = castToObjectOrAbort<Event>(event1); auto eventObj1 = castToObjectOrAbort<Event>(event1);
auto eventObj2 = castToObjectOrAbort<Event>(event2); auto eventObj2 = castToObjectOrAbort<Event>(event2);
@@ -985,7 +985,7 @@ HWTEST_F(TimestampPacketTests, givenAllEnginesReadyWhenWaitingForEventThenClearD
EXPECT_EQ(1u, deferredTimestampPackets->peekNodes().size()); EXPECT_EQ(1u, deferredTimestampPackets->peekNodes().size());
EXPECT_EQ(1u, timestampPacketContainer->peekNodes().size()); EXPECT_EQ(1u, timestampPacketContainer->peekNodes().size());
*tagAddress = 2; *tagAddress = cmdQ->heaplessStateInitEnabled ? 3 : 2;
eventObj1->wait(false, false); eventObj1->wait(false, false);
EXPECT_EQ(0u, deferredTimestampPackets->peekNodes().size()); EXPECT_EQ(0u, deferredTimestampPackets->peekNodes().size());
@@ -1031,11 +1031,11 @@ HWTEST_F(TimestampPacketTests, givenNewSubmissionWhileWaitingThenDontReleaseDefe
cmdQ->flush(); cmdQ->flush();
EXPECT_EQ(2u, csr.taskCount); EXPECT_EQ(cmdQ->getHeaplessStateInitEnabled() ? 3u : 2u, csr.taskCount);
EXPECT_EQ(2u, cmdQ->taskCount); EXPECT_EQ(cmdQ->getHeaplessStateInitEnabled() ? 3u : 2u, cmdQ->taskCount);
auto tagAddress = csr.getTagAddress(); auto tagAddress = csr.getTagAddress();
*tagAddress = 2; *tagAddress = cmdQ->getHeaplessStateInitEnabled() ? 3 : 2;
cmdQ->finish(); cmdQ->finish();
@@ -1083,20 +1083,20 @@ HWTEST_F(TimestampPacketTests, givenNewBcsSubmissionWhileWaitingThenDontReleaseD
cmdQ->flush(); cmdQ->flush();
EXPECT_EQ(2u, csr.taskCount); EXPECT_EQ(cmdQ->getHeaplessStateInitEnabled() ? 3u : 2u, csr.taskCount);
cmdQ->bcsStates[0].taskCount = 2; cmdQ->bcsStates[0].taskCount = cmdQ->getHeaplessStateInitEnabled() ? 3 : 2;
auto tagAddress = csr.getTagAddress(); auto tagAddress = csr.getTagAddress();
*tagAddress = 2; *tagAddress = cmdQ->getHeaplessStateInitEnabled() ? 3 : 2;
cmdQ->finish(); cmdQ->finish();
EXPECT_EQ(3u, cmdQ->bcsStates[0].taskCount); EXPECT_EQ(cmdQ->getHeaplessStateInitEnabled() ? 4u : 3u, cmdQ->bcsStates[0].taskCount);
EXPECT_EQ(1u, deferredTimestampPackets->peekNodes().size()); EXPECT_EQ(1u, deferredTimestampPackets->peekNodes().size());
EXPECT_EQ(1u, timestampPacketContainer->peekNodes().size()); EXPECT_EQ(1u, timestampPacketContainer->peekNodes().size());
*tagAddress = 3; *tagAddress = cmdQ->getHeaplessStateInitEnabled() ? 4 : 3;
cmdQ->bcsEngines[0] = nullptr; cmdQ->bcsEngines[0] = nullptr;
cmdQ->bcsStates[0].engineType = aub_stream::EngineType::NUM_ENGINES; cmdQ->bcsStates[0].engineType = aub_stream::EngineType::NUM_ENGINES;
@@ -1140,10 +1140,10 @@ HWTEST_F(TimestampPacketTests, givenEnableTimestampWaitForQueuesWhenFinishThenCa
VariableBackup<std::function<void()>> backupSetupPauseAddress(&CpuIntrinsicsTests::setupPauseAddress); VariableBackup<std::function<void()>> backupSetupPauseAddress(&CpuIntrinsicsTests::setupPauseAddress);
auto &csr = cmdQ->getGpgpuCommandStreamReceiver(); auto &csr = cmdQ->getGpgpuCommandStreamReceiver();
*csr.getTagAddress() = 0; *csr.getTagAddress() = cmdQ->getHeaplessStateInitEnabled() ? 1 : 0;
CpuIntrinsicsTests::pauseAddress = csr.getTagAddress(); CpuIntrinsicsTests::pauseAddress = csr.getTagAddress();
CpuIntrinsicsTests::pauseValue = 3u; CpuIntrinsicsTests::pauseValue = cmdQ->getHeaplessStateInitEnabled() ? 4u : 3u;
CpuIntrinsicsTests::setupPauseAddress = [&]() { CpuIntrinsicsTests::setupPauseAddress = [&]() {
CpuIntrinsicsTests::pauseAddress = csr.getTagAddress(); CpuIntrinsicsTests::pauseAddress = csr.getTagAddress();
}; };

View File

@@ -69,6 +69,27 @@ class MockCommandStreamReceiverHW : public UltCommandStreamReceiver<FamilyType>
dispatchFlags, dispatchFlags,
device); device);
} }
CompletionStamp flushTaskStateless(
LinearStream &commandStream,
size_t commandStreamStart,
const IndirectHeap *dsh,
const IndirectHeap *ioh,
const IndirectHeap *ssh,
TaskCountType taskLevel,
DispatchFlags &dispatchFlags,
Device &device) override {
stream = &commandStream;
return UltCommandStreamReceiver<FamilyType>::flushTaskStateless(
commandStream,
commandStreamStart,
dsh,
ioh,
ssh,
taskLevel,
dispatchFlags,
device);
}
LinearStream *stream = nullptr; LinearStream *stream = nullptr;
}; };
@@ -419,7 +440,12 @@ HWTEST_F(TimestampPacketTests, givenPipeControlRequestWhenFlushingThenProgramPip
auto pipeControl = genCmdCast<typename FamilyType::PIPE_CONTROL *>(*hwParser.pipeControlList.begin()); auto pipeControl = genCmdCast<typename FamilyType::PIPE_CONTROL *>(*hwParser.pipeControlList.begin());
ASSERT_NE(nullptr, pipeControl); ASSERT_NE(nullptr, pipeControl);
EXPECT_EQ(PIPE_CONTROL::POST_SYNC_OPERATION::POST_SYNC_OPERATION_NO_WRITE, pipeControl->getPostSyncOperation());
if (cmdQ.heaplessStateInitEnabled) {
EXPECT_EQ(PIPE_CONTROL::POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA, pipeControl->getPostSyncOperation());
} else {
EXPECT_EQ(PIPE_CONTROL::POST_SYNC_OPERATION::POST_SYNC_OPERATION_NO_WRITE, pipeControl->getPostSyncOperation());
}
EXPECT_TRUE(pipeControl->getCommandStreamerStallEnable()); EXPECT_TRUE(pipeControl->getCommandStreamerStallEnable());
cmdQ.enqueueKernel(mockKernel.mockKernel, 1, nullptr, gws, nullptr, 0, nullptr, nullptr); cmdQ.enqueueKernel(mockKernel.mockKernel, 1, nullptr, gws, nullptr, 0, nullptr, nullptr);

View File

@@ -804,6 +804,7 @@ HWTEST_TEMPLATED_F(BcsBufferTests, givenPipeControlRequestWhenDispatchingBlitEnq
resetCopyEngineSelector(); resetCopyEngineSelector();
auto cmdQ = clUniquePtr(new MockCommandQueueHw<FamilyType>(bcsMockContext.get(), device.get(), nullptr)); auto cmdQ = clUniquePtr(new MockCommandQueueHw<FamilyType>(bcsMockContext.get(), device.get(), nullptr));
auto bcsCsr = static_cast<UltCommandStreamReceiver<FamilyType> *>(this->bcsCsr); auto bcsCsr = static_cast<UltCommandStreamReceiver<FamilyType> *>(this->bcsCsr);
auto queueCsr = static_cast<UltCommandStreamReceiver<FamilyType> *>(&cmdQ->getGpgpuCommandStreamReceiver()); auto queueCsr = static_cast<UltCommandStreamReceiver<FamilyType> *>(&cmdQ->getGpgpuCommandStreamReceiver());
@@ -814,10 +815,11 @@ HWTEST_TEMPLATED_F(BcsBufferTests, givenPipeControlRequestWhenDispatchingBlitEnq
buffer->forceDisallowCPUCopy = true; buffer->forceDisallowCPUCopy = true;
void *hostPtr = reinterpret_cast<void *>(0x12340000); void *hostPtr = reinterpret_cast<void *>(0x12340000);
auto offset = queueCsr->commandStream.getUsed();
cmdQ->enqueueWriteBuffer(buffer.get(), true, 0, 1, hostPtr, nullptr, 0, nullptr, nullptr); cmdQ->enqueueWriteBuffer(buffer.get(), true, 0, 1, hostPtr, nullptr, 0, nullptr, nullptr);
HardwareParse hwParser; HardwareParse hwParser;
hwParser.parseCommands<FamilyType>(queueCsr->commandStream); hwParser.parseCommands<FamilyType>(queueCsr->commandStream, offset);
uint64_t pipeControlWriteAddress = 0; uint64_t pipeControlWriteAddress = 0;
for (auto &cmd : hwParser.cmdList) { for (auto &cmd : hwParser.cmdList) {
@@ -843,6 +845,7 @@ HWTEST_TEMPLATED_F(BcsBufferTests, givenPipeControlRequestWhenDispatchingBlitEnq
EXPECT_EQ(pipeControlWriteAddress, genCmdCast<MI_SEMAPHORE_WAIT *>(*(semaphores[1]))->getSemaphoreGraphicsAddress()); EXPECT_EQ(pipeControlWriteAddress, genCmdCast<MI_SEMAPHORE_WAIT *>(*(semaphores[1]))->getSemaphoreGraphicsAddress());
} else { } else {
EXPECT_EQ(UnitTestHelper<FamilyType>::isAdditionalMiSemaphoreWaitRequired(device->getRootDeviceEnvironment()) ? 3u : 1u, semaphores.size()); EXPECT_EQ(UnitTestHelper<FamilyType>::isAdditionalMiSemaphoreWaitRequired(device->getRootDeviceEnvironment()) ? 3u : 1u, semaphores.size());
EXPECT_EQ(pipeControlWriteAddress, genCmdCast<MI_SEMAPHORE_WAIT *>(*(semaphores[0]))->getSemaphoreGraphicsAddress()); EXPECT_EQ(pipeControlWriteAddress, genCmdCast<MI_SEMAPHORE_WAIT *>(*(semaphores[0]))->getSemaphoreGraphicsAddress());
} }
} }
@@ -890,12 +893,14 @@ HWTEST_TEMPLATED_F(BcsBufferTests, givenStallingCommandsOnNextFlushWhenReleasing
}; };
auto &csrStream = cmdQ->getGpgpuCommandStreamReceiver().getCS(0); auto &csrStream = cmdQ->getGpgpuCommandStreamReceiver().getCS(0);
auto csrOffset = csrStream.getUsed();
EXPECT_TRUE(cmdQ->isStallingCommandsOnNextFlushRequired()); EXPECT_TRUE(cmdQ->isStallingCommandsOnNextFlushRequired());
userEvent0.setStatus(CL_COMPLETE); userEvent0.setStatus(CL_COMPLETE);
EXPECT_FALSE(cmdQ->isStallingCommandsOnNextFlushRequired()); EXPECT_FALSE(cmdQ->isStallingCommandsOnNextFlushRequired());
EXPECT_TRUE(pipeControlLookup(csrStream, 0, device->getRootDeviceEnvironment())); EXPECT_TRUE(pipeControlLookup(csrStream, csrOffset, device->getRootDeviceEnvironment()));
auto csrOffset = csrStream.getUsed(); csrOffset = csrStream.getUsed();
userEvent1.setStatus(CL_COMPLETE); userEvent1.setStatus(CL_COMPLETE);
EXPECT_FALSE(pipeControlLookup(csrStream, csrOffset, device->getRootDeviceEnvironment())); EXPECT_FALSE(pipeControlLookup(csrStream, csrOffset, device->getRootDeviceEnvironment()));
cmdQ->isQueueBlocked(); cmdQ->isQueueBlocked();
@@ -977,6 +982,8 @@ HWTEST_TEMPLATED_F(BcsBufferTests, givenOutputTimestampPacketWhenBlitCalledThenp
HardwareParse hwParser; HardwareParse hwParser;
hwParser.parseCommands<FamilyType>(csr->commandStream); hwParser.parseCommands<FamilyType>(csr->commandStream);
auto heaplessStateInit = cmdQ->getHeaplessStateInitEnabled();
uint32_t miFlushDwCmdsWithOutputCount = 0; uint32_t miFlushDwCmdsWithOutputCount = 0;
bool blitCmdFound = false; bool blitCmdFound = false;
for (auto &cmd : hwParser.cmdList) { for (auto &cmd : hwParser.cmdList) {
@@ -985,19 +992,21 @@ HWTEST_TEMPLATED_F(BcsBufferTests, givenOutputTimestampPacketWhenBlitCalledThenp
continue; continue;
} }
EXPECT_EQ(miFlushDwCmdsWithOutputCount == 0, bool correctMiFlushDwCmdsWithOutputCount = heaplessStateInit ? miFlushDwCmdsWithOutputCount == 1 : miFlushDwCmdsWithOutputCount == 0;
EXPECT_EQ(correctMiFlushDwCmdsWithOutputCount,
timestampPacketGpuWriteAddress == miFlushDwCmd->getDestinationAddress()); timestampPacketGpuWriteAddress == miFlushDwCmd->getDestinationAddress());
EXPECT_EQ(miFlushDwCmdsWithOutputCount == 0, EXPECT_EQ(correctMiFlushDwCmdsWithOutputCount,
0u == miFlushDwCmd->getImmediateData()); 0u == miFlushDwCmd->getImmediateData());
miFlushDwCmdsWithOutputCount++; miFlushDwCmdsWithOutputCount++;
} else if (genCmdCast<typename FamilyType::XY_COPY_BLT *>(cmd)) { } else if (genCmdCast<typename FamilyType::XY_COPY_BLT *>(cmd)) {
blitCmdFound = true; blitCmdFound = true;
EXPECT_EQ(0u, miFlushDwCmdsWithOutputCount); EXPECT_EQ(heaplessStateInit ? 1u : 0u, miFlushDwCmdsWithOutputCount);
} }
} }
EXPECT_EQ(2u, miFlushDwCmdsWithOutputCount); // TimestampPacket + taskCount EXPECT_EQ(heaplessStateInit ? 3u : 2u, miFlushDwCmdsWithOutputCount); // TimestampPacket + taskCount
EXPECT_TRUE(blitCmdFound); EXPECT_TRUE(blitCmdFound);
} }

View File

@@ -939,16 +939,18 @@ TEST(UnifiedSharedMemoryTransferCalls, givenHostUsmAllocationWhenPointerIsUsedFo
ASSERT_EQ(CL_SUCCESS, status); ASSERT_EQ(CL_SUCCESS, status);
auto neoQueue = castToObject<CommandQueue>(commandQueue); auto neoQueue = castToObject<CommandQueue>(commandQueue);
auto heaplessStateInit = neoQueue->getHeaplessStateInitEnabled();
auto &temporaryAllocations = neoQueue->getGpgpuCommandStreamReceiver().getTemporaryAllocations(); auto &temporaryAllocations = neoQueue->getGpgpuCommandStreamReceiver().getTemporaryAllocations();
EXPECT_TRUE(temporaryAllocations.peekIsEmpty()); EXPECT_TRUE(temporaryAllocations.peekIsEmpty());
auto osContextId = neoQueue->getGpgpuCommandStreamReceiver().getOsContext().getContextId(); auto osContextId = neoQueue->getGpgpuCommandStreamReceiver().getOsContext().getContextId();
EXPECT_EQ(1u, gpuAllocation->getTaskCount(osContextId)); EXPECT_EQ(heaplessStateInit ? 2u : 1u, gpuAllocation->getTaskCount(osContextId));
status = clEnqueueReadBuffer(commandQueue, buffer, false, 0u, 4096u, hostMemory, 0u, nullptr, nullptr); status = clEnqueueReadBuffer(commandQueue, buffer, false, 0u, 4096u, hostMemory, 0u, nullptr, nullptr);
ASSERT_EQ(CL_SUCCESS, status); ASSERT_EQ(CL_SUCCESS, status);
EXPECT_TRUE(temporaryAllocations.peekIsEmpty()); EXPECT_TRUE(temporaryAllocations.peekIsEmpty());
EXPECT_EQ(2u, gpuAllocation->getTaskCount(osContextId)); EXPECT_EQ(heaplessStateInit ? 3u : 2u, gpuAllocation->getTaskCount(osContextId));
status = clReleaseMemObject(buffer); status = clReleaseMemObject(buffer);
ASSERT_EQ(CL_SUCCESS, status); ASSERT_EQ(CL_SUCCESS, status);
@@ -979,16 +981,18 @@ TEST(UnifiedSharedMemoryTransferCalls, givenDeviceUsmAllocationWhenPtrIsUsedForT
ASSERT_EQ(CL_SUCCESS, status); ASSERT_EQ(CL_SUCCESS, status);
auto neoQueue = castToObject<CommandQueue>(commandQueue); auto neoQueue = castToObject<CommandQueue>(commandQueue);
auto heaplessStateInit = neoQueue->getHeaplessStateInitEnabled();
auto &temporaryAllocations = neoQueue->getGpgpuCommandStreamReceiver().getTemporaryAllocations(); auto &temporaryAllocations = neoQueue->getGpgpuCommandStreamReceiver().getTemporaryAllocations();
EXPECT_TRUE(temporaryAllocations.peekIsEmpty()); EXPECT_TRUE(temporaryAllocations.peekIsEmpty());
auto osContextId = neoQueue->getGpgpuCommandStreamReceiver().getOsContext().getContextId(); auto osContextId = neoQueue->getGpgpuCommandStreamReceiver().getOsContext().getContextId();
EXPECT_EQ(1u, gpuAllocation->getTaskCount(osContextId)); EXPECT_EQ(heaplessStateInit ? 2u : 1u, gpuAllocation->getTaskCount(osContextId));
status = clEnqueueReadBuffer(commandQueue, buffer, false, 0u, 4096u, deviceMemory, 0u, nullptr, nullptr); status = clEnqueueReadBuffer(commandQueue, buffer, false, 0u, 4096u, deviceMemory, 0u, nullptr, nullptr);
ASSERT_EQ(CL_SUCCESS, status); ASSERT_EQ(CL_SUCCESS, status);
EXPECT_EQ(2u, gpuAllocation->getTaskCount(osContextId)); EXPECT_EQ(heaplessStateInit ? 3u : 2u, gpuAllocation->getTaskCount(osContextId));
status = clReleaseMemObject(buffer); status = clReleaseMemObject(buffer);
ASSERT_EQ(CL_SUCCESS, status); ASSERT_EQ(CL_SUCCESS, status);
@@ -1019,16 +1023,18 @@ TEST(UnifiedSharedMemoryTransferCalls, givenDeviceUsmAllocationWhenPtrIsUsedForT
ASSERT_EQ(CL_SUCCESS, status); ASSERT_EQ(CL_SUCCESS, status);
auto neoQueue = castToObject<CommandQueue>(commandQueue); auto neoQueue = castToObject<CommandQueue>(commandQueue);
auto heaplessStateInit = neoQueue->getHeaplessStateInitEnabled();
auto &temporaryAllocations = neoQueue->getGpgpuCommandStreamReceiver().getTemporaryAllocations(); auto &temporaryAllocations = neoQueue->getGpgpuCommandStreamReceiver().getTemporaryAllocations();
EXPECT_TRUE(temporaryAllocations.peekIsEmpty()); EXPECT_TRUE(temporaryAllocations.peekIsEmpty());
auto osContextId = neoQueue->getGpgpuCommandStreamReceiver().getOsContext().getContextId(); auto osContextId = neoQueue->getGpgpuCommandStreamReceiver().getOsContext().getContextId();
EXPECT_EQ(1u, gpuAllocation->getTaskCount(osContextId)); EXPECT_EQ(heaplessStateInit ? 2u : 1u, gpuAllocation->getTaskCount(osContextId));
status = clEnqueueReadBuffer(commandQueue, buffer, true, 0u, 4096u, deviceMemory, 0u, nullptr, nullptr); status = clEnqueueReadBuffer(commandQueue, buffer, true, 0u, 4096u, deviceMemory, 0u, nullptr, nullptr);
ASSERT_EQ(CL_SUCCESS, status); ASSERT_EQ(CL_SUCCESS, status);
EXPECT_EQ(2u, gpuAllocation->getTaskCount(osContextId)); EXPECT_EQ(heaplessStateInit ? 3u : 2u, gpuAllocation->getTaskCount(osContextId));
status = clReleaseMemObject(buffer); status = clReleaseMemObject(buffer);
ASSERT_EQ(CL_SUCCESS, status); ASSERT_EQ(CL_SUCCESS, status);
@@ -1142,16 +1148,18 @@ TEST(UnifiedSharedMemoryTransferCalls, givenSharedUsmAllocationWithoutLocalMemor
ASSERT_EQ(CL_SUCCESS, status); ASSERT_EQ(CL_SUCCESS, status);
auto neoQueue = castToObject<CommandQueue>(commandQueue); auto neoQueue = castToObject<CommandQueue>(commandQueue);
auto heaplessStateInit = neoQueue->getHeaplessStateInitEnabled();
auto &temporaryAllocations = neoQueue->getGpgpuCommandStreamReceiver().getTemporaryAllocations(); auto &temporaryAllocations = neoQueue->getGpgpuCommandStreamReceiver().getTemporaryAllocations();
EXPECT_TRUE(temporaryAllocations.peekIsEmpty()); EXPECT_TRUE(temporaryAllocations.peekIsEmpty());
auto osContextId = neoQueue->getGpgpuCommandStreamReceiver().getOsContext().getContextId(); auto osContextId = neoQueue->getGpgpuCommandStreamReceiver().getOsContext().getContextId();
EXPECT_EQ(1u, gpuAllocation->getTaskCount(osContextId)); EXPECT_EQ(heaplessStateInit ? 2u : 1u, gpuAllocation->getTaskCount(osContextId));
status = clEnqueueReadBuffer(commandQueue, buffer, false, 0u, 4096u, sharedMemory, 0u, nullptr, nullptr); status = clEnqueueReadBuffer(commandQueue, buffer, false, 0u, 4096u, sharedMemory, 0u, nullptr, nullptr);
ASSERT_EQ(CL_SUCCESS, status); ASSERT_EQ(CL_SUCCESS, status);
EXPECT_TRUE(temporaryAllocations.peekIsEmpty()); EXPECT_TRUE(temporaryAllocations.peekIsEmpty());
EXPECT_EQ(2u, gpuAllocation->getTaskCount(osContextId)); EXPECT_EQ(heaplessStateInit ? 3u : 2u, gpuAllocation->getTaskCount(osContextId));
status = clReleaseMemObject(buffer); status = clReleaseMemObject(buffer);
ASSERT_EQ(CL_SUCCESS, status); ASSERT_EQ(CL_SUCCESS, status);
@@ -1182,6 +1190,7 @@ TEST(UnifiedSharedMemoryTransferCalls, givenSharedUsmAllocationWithLocalMemoryWh
auto neoQueue = castToObject<CommandQueue>(commandQueue); auto neoQueue = castToObject<CommandQueue>(commandQueue);
auto osContextId = neoQueue->getGpgpuCommandStreamReceiver().getOsContext().getContextId(); auto osContextId = neoQueue->getGpgpuCommandStreamReceiver().getOsContext().getContextId();
auto heaplessStateInit = neoQueue->getHeaplessStateInitEnabled();
EXPECT_EQ(GraphicsAllocation::objectNotUsed, svmAllocation->cpuAllocation->getTaskCount(osContextId)); EXPECT_EQ(GraphicsAllocation::objectNotUsed, svmAllocation->cpuAllocation->getTaskCount(osContextId));
@@ -1191,12 +1200,12 @@ TEST(UnifiedSharedMemoryTransferCalls, givenSharedUsmAllocationWithLocalMemoryWh
auto &temporaryAllocations = neoQueue->getGpgpuCommandStreamReceiver().getTemporaryAllocations(); auto &temporaryAllocations = neoQueue->getGpgpuCommandStreamReceiver().getTemporaryAllocations();
EXPECT_TRUE(temporaryAllocations.peekIsEmpty()); EXPECT_TRUE(temporaryAllocations.peekIsEmpty());
EXPECT_EQ(1u, svmAllocation->cpuAllocation->getTaskCount(osContextId)); EXPECT_EQ(heaplessStateInit ? 2u : 1u, svmAllocation->cpuAllocation->getTaskCount(osContextId));
status = clEnqueueReadBuffer(commandQueue, buffer, false, 0u, 4096u, sharedMemory, 0u, nullptr, nullptr); status = clEnqueueReadBuffer(commandQueue, buffer, false, 0u, 4096u, sharedMemory, 0u, nullptr, nullptr);
ASSERT_EQ(CL_SUCCESS, status); ASSERT_EQ(CL_SUCCESS, status);
EXPECT_TRUE(temporaryAllocations.peekIsEmpty()); EXPECT_TRUE(temporaryAllocations.peekIsEmpty());
EXPECT_EQ(2u, svmAllocation->cpuAllocation->getTaskCount(osContextId)); EXPECT_EQ(heaplessStateInit ? 3u : 2u, svmAllocation->cpuAllocation->getTaskCount(osContextId));
status = clReleaseMemObject(buffer); status = clReleaseMemObject(buffer);
ASSERT_EQ(CL_SUCCESS, status); ASSERT_EQ(CL_SUCCESS, status);

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020 Intel Corporation * Copyright (C) 2020-2024 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -8,7 +8,11 @@
#include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/mocks/mock_platform.h"
#include "shared/source/device/device.h" #include "shared/source/device/device.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/memory_manager/memory_manager.h"
#include "shared/source/os_interface/device_factory.h" #include "shared/source/os_interface/device_factory.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/helpers/unit_test_helper.h"
#include "opencl/test/unit_test/mocks/mock_cl_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_cl_execution_environment.h"
@@ -20,6 +24,17 @@ bool initPlatform() {
} }
bool MockPlatform::initializeWithNewDevices() { bool MockPlatform::initializeWithNewDevices() {
executionEnvironment.prepareRootDeviceEnvironments(1u); executionEnvironment.prepareRootDeviceEnvironments(1u);
for (auto i = 0u; i < executionEnvironment.rootDeviceEnvironments.size(); i++) {
executionEnvironment.rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(NEO::defaultHwInfo.get());
UnitTestSetter::setRcsExposure(*executionEnvironment.rootDeviceEnvironments[i]);
UnitTestSetter::setCcsExposure(*executionEnvironment.rootDeviceEnvironments[i]);
}
executionEnvironment.calculateMaxOsContextCount();
return Platform::initialize(DeviceFactory::createDevices(executionEnvironment)); return Platform::initialize(DeviceFactory::createDevices(executionEnvironment));
} }

View File

@@ -1143,7 +1143,12 @@ HWTEST_F(ProfilingWithPerfCountersTests, GivenCommandQueueWithProfilingPerfCount
ASSERT_NE(nullptr, pAfterPC); ASSERT_NE(nullptr, pAfterPC);
EXPECT_EQ(1u, pAfterPC->getCommandStreamerStallEnable()); EXPECT_EQ(1u, pAfterPC->getCommandStreamerStallEnable());
EXPECT_EQ(PIPE_CONTROL::POST_SYNC_OPERATION_NO_WRITE, pBeforePC->getPostSyncOperation()); if (pCmdQ->getHeaplessStateInitEnabled()) {
EXPECT_EQ(PIPE_CONTROL::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA, pBeforePC->getPostSyncOperation());
} else {
EXPECT_EQ(PIPE_CONTROL::POST_SYNC_OPERATION_NO_WRITE, pBeforePC->getPostSyncOperation());
}
// expect MI_REPORT_PERF_COUNT after WALKER // expect MI_REPORT_PERF_COUNT after WALKER
auto itorAfterReportPerf = find<MI_REPORT_PERF_COUNT *>(itorGPGPUWalkerCmd, cmdList.end()); auto itorAfterReportPerf = find<MI_REPORT_PERF_COUNT *>(itorGPGPUWalkerCmd, cmdList.end());

View File

@@ -70,6 +70,14 @@ struct MockAubCsr : public AUBCommandStreamReceiverHw<GfxFamily> {
return AUBCommandStreamReceiverHw<GfxFamily>::flushTask(commandStream, commandStreamStart, dsh, ioh, ssh, taskLevel, dispatchFlags, device); return AUBCommandStreamReceiverHw<GfxFamily>::flushTask(commandStream, commandStreamStart, dsh, ioh, ssh, taskLevel, dispatchFlags, device);
} }
CompletionStamp flushTaskStateless(LinearStream &commandStream, size_t commandStreamStart,
const IndirectHeap *dsh, const IndirectHeap *ioh, const IndirectHeap *ssh,
TaskCountType taskLevel, DispatchFlags &dispatchFlags, Device &device) override {
recordedDispatchFlags = dispatchFlags;
return AUBCommandStreamReceiverHw<GfxFamily>::flushTaskStateless(commandStream, commandStreamStart, dsh, ioh, ssh, taskLevel, dispatchFlags, device);
}
DispatchMode peekDispatchMode() const { DispatchMode peekDispatchMode() const {
return this->dispatchMode; return this->dispatchMode;
} }

View File

@@ -48,7 +48,7 @@ void MockSipKernel::createMockSipAllocation() {
0u, 0u,
MemoryConstants::pageSize, MemoryConstants::pageSize,
MemoryPool::system4KBPages, MemoryPool::system4KBPages,
3u); 14u);
} }
} // namespace NEO } // namespace NEO