Revert "feature: Append recorded commandlist into immediate (8/N)"

This reverts commit 9db77efd03.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2025-02-13 06:32:43 +01:00
committed by Compute-Runtime-Automation
parent f06fb6b6e8
commit b3807e7a36
16 changed files with 110 additions and 401 deletions

View File

@@ -247,7 +247,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::initialize(Device *device, NEO
this->l1CachePolicyData.init(productHelper); this->l1CachePolicyData.init(productHelper);
this->cmdListHeapAddressModel = L0GfxCoreHelper::getHeapAddressModel(rootDeviceEnvironment); this->cmdListHeapAddressModel = L0GfxCoreHelper::getHeapAddressModel(rootDeviceEnvironment);
this->dummyBlitWa.rootDeviceEnvironment = &(neoDevice->getRootDeviceEnvironmentRef()); this->dummyBlitWa.rootDeviceEnvironment = &(neoDevice->getRootDeviceEnvironmentRef());
this->dispatchCmdListBatchBufferAsPrimary = L0GfxCoreHelper::dispatchCmdListBatchBufferAsPrimary(rootDeviceEnvironment, !(isImmediateType() && this->internalUsage)); this->dispatchCmdListBatchBufferAsPrimary = L0GfxCoreHelper::dispatchCmdListBatchBufferAsPrimary(rootDeviceEnvironment, !isImmediateType());
this->useOnlyGlobalTimestamps = gfxCoreHelper.useOnlyGlobalTimestamps(); this->useOnlyGlobalTimestamps = gfxCoreHelper.useOnlyGlobalTimestamps();
this->maxFillPaternSizeForCopyEngine = productHelper.getMaxFillPaternSizeForCopyEngine(); this->maxFillPaternSizeForCopyEngine = productHelper.getMaxFillPaternSizeForCopyEngine();
this->heaplessModeEnabled = compilerProductHelper.isHeaplessModeEnabled(); this->heaplessModeEnabled = compilerProductHelper.isHeaplessModeEnabled();

View File

@@ -200,7 +200,7 @@ struct CommandListCoreFamilyImmediate : public CommandListCoreFamily<gfxCoreFami
void handleHeapsAndResidencyForImmediateRegularTask(void *&sshCpuBaseAddress); void handleHeapsAndResidencyForImmediateRegularTask(void *&sshCpuBaseAddress);
void handleDebugSurfaceStateUpdate(NEO::IndirectHeap *ssh); void handleDebugSurfaceStateUpdate(NEO::IndirectHeap *ssh);
void checkAvailableSpace(uint32_t numEvents, bool hasRelaxedOrderingDependencies, size_t commandSize, bool requestCommandBufferInLocalMem); void checkAvailableSpace(uint32_t numEvents, bool hasRelaxedOrderingDependencies, size_t commandSize);
void updateDispatchFlagsWithRequiredStreamState(NEO::DispatchFlags &dispatchFlags); void updateDispatchFlagsWithRequiredStreamState(NEO::DispatchFlags &dispatchFlags);
MOCKABLE_VIRTUAL ze_result_t flushImmediate(ze_result_t inputRet, bool performMigration, bool hasStallingCmds, bool hasRelaxedOrderingDependencies, bool kernelOperation, bool copyOffloadSubmission, ze_event_handle_t hSignalEvent, bool requireTaskCountUpdate); MOCKABLE_VIRTUAL ze_result_t flushImmediate(ze_result_t inputRet, bool performMigration, bool hasStallingCmds, bool hasRelaxedOrderingDependencies, bool kernelOperation, bool copyOffloadSubmission, ze_event_handle_t hSignalEvent, bool requireTaskCountUpdate);

View File

@@ -52,26 +52,12 @@ CommandListCoreFamilyImmediate<gfxCoreFamily>::CommandListCoreFamilyImmediate(ui
} }
template <GFXCORE_FAMILY gfxCoreFamily> template <GFXCORE_FAMILY gfxCoreFamily>
void CommandListCoreFamilyImmediate<gfxCoreFamily>::checkAvailableSpace(uint32_t numEvents, bool hasRelaxedOrderingDependencies, size_t commandSize, bool requestCommandBufferInLocalMem) { void CommandListCoreFamilyImmediate<gfxCoreFamily>::checkAvailableSpace(uint32_t numEvents, bool hasRelaxedOrderingDependencies, size_t commandSize) {
this->commandContainer.fillReusableAllocationLists(); this->commandContainer.fillReusableAllocationLists();
// Command container might have two command buffers - one in local mem (mainly for relaxed ordering and any other specific purposes) and one in system mem for copying into ring buffer. /* Command container might has two command buffers. If it has, one is in local memory, because relaxed ordering requires that and one in system for copying it into ring buffer.
// If relaxed ordering is needed in given dispatch or if we need to force Local mem usage, and current command stream is in system memory, swap of command streams is required to ensure local memory. If relaxed ordering is needed in given dispatch and current command stream is in system memory, swap of command streams is required to ensure local memory. Same in the opposite scenario. */
// If relaxed ordering is not needed and command buffer is in local mem, then also we need to swap. if (hasRelaxedOrderingDependencies == NEO::MemoryPoolHelper::isSystemMemoryPool(this->commandContainer.getCommandStream()->getGraphicsAllocation()->getMemoryPool())) {
bool swapStreams = false;
if (hasRelaxedOrderingDependencies) {
if (NEO::MemoryPoolHelper::isSystemMemoryPool(this->commandContainer.getCommandStream()->getGraphicsAllocation()->getMemoryPool())) {
swapStreams = true;
}
} else {
if (requestCommandBufferInLocalMem && NEO::MemoryPoolHelper::isSystemMemoryPool(this->commandContainer.getCommandStream()->getGraphicsAllocation()->getMemoryPool())) {
swapStreams = true;
} else if (!requestCommandBufferInLocalMem && !NEO::MemoryPoolHelper::isSystemMemoryPool(this->commandContainer.getCommandStream()->getGraphicsAllocation()->getMemoryPool())) {
swapStreams = true;
}
}
if (swapStreams) {
if (this->commandContainer.swapStreams()) { if (this->commandContainer.swapStreams()) {
this->cmdListCurrentStartOffset = this->commandContainer.getCommandStream()->getUsed(); this->cmdListCurrentStartOffset = this->commandContainer.getCommandStream()->getUsed();
} }
@@ -529,7 +515,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendLaunchKernel(
relaxedOrderingDispatch = isRelaxedOrderingDispatchAllowed(numWaitEvents, false); relaxedOrderingDispatch = isRelaxedOrderingDispatchAllowed(numWaitEvents, false);
bool stallingCmdsForRelaxedOrdering = hasStallingCmdsForRelaxedOrdering(numWaitEvents, relaxedOrderingDispatch); bool stallingCmdsForRelaxedOrdering = hasStallingCmdsForRelaxedOrdering(numWaitEvents, relaxedOrderingDispatch);
checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, commonImmediateCommandSize, false); checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, commonImmediateCommandSize);
bool hostWait = waitForEventsFromHost(); bool hostWait = waitForEventsFromHost();
if (hostWait) { if (hostWait) {
this->synchronizeEventList(numWaitEvents, phWaitEvents); this->synchronizeEventList(numWaitEvents, phWaitEvents);
@@ -586,7 +572,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendLaunchKernelInd
ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents, bool relaxedOrderingDispatch) { ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents, bool relaxedOrderingDispatch) {
relaxedOrderingDispatch = isRelaxedOrderingDispatchAllowed(numWaitEvents, false); relaxedOrderingDispatch = isRelaxedOrderingDispatchAllowed(numWaitEvents, false);
checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, commonImmediateCommandSize, false); checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, commonImmediateCommandSize);
auto ret = CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelIndirect(kernelHandle, pDispatchArgumentsBuffer, auto ret = CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelIndirect(kernelHandle, pDispatchArgumentsBuffer,
hSignalEvent, numWaitEvents, phWaitEvents, relaxedOrderingDispatch); hSignalEvent, numWaitEvents, phWaitEvents, relaxedOrderingDispatch);
@@ -613,7 +599,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendBarrier(ze_even
isStallingOperation = hasStallingCmdsForRelaxedOrdering(numWaitEvents, relaxedOrderingDispatch); isStallingOperation = hasStallingCmdsForRelaxedOrdering(numWaitEvents, relaxedOrderingDispatch);
} }
checkAvailableSpace(numWaitEvents, false, commonImmediateCommandSize, false); checkAvailableSpace(numWaitEvents, false, commonImmediateCommandSize);
ret = CommandListCoreFamily<gfxCoreFamily>::appendBarrier(hSignalEvent, numWaitEvents, phWaitEvents, relaxedOrderingDispatch); ret = CommandListCoreFamily<gfxCoreFamily>::appendBarrier(hSignalEvent, numWaitEvents, phWaitEvents, relaxedOrderingDispatch);
@@ -638,7 +624,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendMemoryCopy(
auto sizePerBlit = sizeof(typename GfxFamily::XY_COPY_BLT) + NEO::BlitCommandsHelper<GfxFamily>::estimatePostBlitCommandSize(); auto sizePerBlit = sizeof(typename GfxFamily::XY_COPY_BLT) + NEO::BlitCommandsHelper<GfxFamily>::estimatePostBlitCommandSize();
estimatedSize += nBlits * sizePerBlit; estimatedSize += nBlits * sizePerBlit;
} }
checkAvailableSpace(numWaitEvents, memoryCopyParams.relaxedOrderingDispatch, estimatedSize, false); checkAvailableSpace(numWaitEvents, memoryCopyParams.relaxedOrderingDispatch, estimatedSize);
bool hasStallindCmds = hasStallingCmdsForRelaxedOrdering(numWaitEvents, memoryCopyParams.relaxedOrderingDispatch); bool hasStallindCmds = hasStallingCmdsForRelaxedOrdering(numWaitEvents, memoryCopyParams.relaxedOrderingDispatch);
@@ -694,7 +680,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendMemoryCopyRegio
auto sizePerBlit = sizeof(typename GfxFamily::XY_COPY_BLT) + NEO::BlitCommandsHelper<GfxFamily>::estimatePostBlitCommandSize(); auto sizePerBlit = sizeof(typename GfxFamily::XY_COPY_BLT) + NEO::BlitCommandsHelper<GfxFamily>::estimatePostBlitCommandSize();
estimatedSize += xBlits * yBlits * zBlits * sizePerBlit; estimatedSize += xBlits * yBlits * zBlits * sizePerBlit;
} }
checkAvailableSpace(numWaitEvents, memoryCopyParams.relaxedOrderingDispatch, estimatedSize, false); checkAvailableSpace(numWaitEvents, memoryCopyParams.relaxedOrderingDispatch, estimatedSize);
bool hasStallindCmds = hasStallingCmdsForRelaxedOrdering(numWaitEvents, memoryCopyParams.relaxedOrderingDispatch); bool hasStallindCmds = hasStallingCmdsForRelaxedOrdering(numWaitEvents, memoryCopyParams.relaxedOrderingDispatch);
@@ -737,7 +723,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendMemoryFill(void
ze_event_handle_t *phWaitEvents, bool relaxedOrderingDispatch) { ze_event_handle_t *phWaitEvents, bool relaxedOrderingDispatch) {
relaxedOrderingDispatch = isRelaxedOrderingDispatchAllowed(numWaitEvents, false); relaxedOrderingDispatch = isRelaxedOrderingDispatchAllowed(numWaitEvents, false);
checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, commonImmediateCommandSize, false); checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, commonImmediateCommandSize);
auto ret = CommandListCoreFamily<gfxCoreFamily>::appendMemoryFill(ptr, pattern, patternSize, size, hSignalEvent, numWaitEvents, phWaitEvents, relaxedOrderingDispatch); auto ret = CommandListCoreFamily<gfxCoreFamily>::appendMemoryFill(ptr, pattern, patternSize, size, hSignalEvent, numWaitEvents, phWaitEvents, relaxedOrderingDispatch);
@@ -751,7 +737,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendSignalEvent(ze_
relaxedOrderingDispatch = isRelaxedOrderingDispatchAllowed(0, false); relaxedOrderingDispatch = isRelaxedOrderingDispatchAllowed(0, false);
bool hasStallingCmds = !Event::fromHandle(hSignalEvent)->isCounterBased() || hasStallingCmdsForRelaxedOrdering(0, relaxedOrderingDispatch); bool hasStallingCmds = !Event::fromHandle(hSignalEvent)->isCounterBased() || hasStallingCmdsForRelaxedOrdering(0, relaxedOrderingDispatch);
checkAvailableSpace(0, false, commonImmediateCommandSize, false); checkAvailableSpace(0, false, commonImmediateCommandSize);
ret = CommandListCoreFamily<gfxCoreFamily>::appendSignalEvent(hSignalEvent, relaxedOrderingDispatch); ret = CommandListCoreFamily<gfxCoreFamily>::appendSignalEvent(hSignalEvent, relaxedOrderingDispatch);
return flushImmediate(ret, true, hasStallingCmds, relaxedOrderingDispatch, false, false, hSignalEvent, false); return flushImmediate(ret, true, hasStallingCmds, relaxedOrderingDispatch, false, false, hSignalEvent, false);
} }
@@ -760,7 +746,7 @@ template <GFXCORE_FAMILY gfxCoreFamily>
ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendEventReset(ze_event_handle_t hSignalEvent) { ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendEventReset(ze_event_handle_t hSignalEvent) {
ze_result_t ret = ZE_RESULT_SUCCESS; ze_result_t ret = ZE_RESULT_SUCCESS;
checkAvailableSpace(0, false, commonImmediateCommandSize, false); checkAvailableSpace(0, false, commonImmediateCommandSize);
ret = CommandListCoreFamily<gfxCoreFamily>::appendEventReset(hSignalEvent); ret = CommandListCoreFamily<gfxCoreFamily>::appendEventReset(hSignalEvent);
return flushImmediate(ret, true, true, false, false, false, hSignalEvent, false); return flushImmediate(ret, true, true, false, false, false, hSignalEvent, false);
} }
@@ -770,7 +756,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendPageFaultCopy(N
NEO::GraphicsAllocation *srcAllocation, NEO::GraphicsAllocation *srcAllocation,
size_t size, bool flushHost) { size_t size, bool flushHost) {
checkAvailableSpace(0, false, commonImmediateCommandSize, false); checkAvailableSpace(0, false, commonImmediateCommandSize);
ze_result_t ret; ze_result_t ret;
@@ -807,7 +793,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendWaitOnEvents(ui
} }
if (!skipFlush) { if (!skipFlush) {
checkAvailableSpace(numEvents, false, commonImmediateCommandSize, false); checkAvailableSpace(numEvents, false, commonImmediateCommandSize);
} }
auto ret = CommandListCoreFamily<gfxCoreFamily>::appendWaitOnEvents(numEvents, phWaitEvents, outWaitCmds, relaxedOrderingAllowed, trackDependencies, apiRequest, skipAddingWaitEventsToResidency, false, copyOffloadOperation); auto ret = CommandListCoreFamily<gfxCoreFamily>::appendWaitOnEvents(numEvents, phWaitEvents, outWaitCmds, relaxedOrderingAllowed, trackDependencies, apiRequest, skipAddingWaitEventsToResidency, false, copyOffloadOperation);
@@ -825,7 +811,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendWriteGlobalTime
uint64_t *dstptr, ze_event_handle_t hSignalEvent, uint64_t *dstptr, ze_event_handle_t hSignalEvent,
uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents) { uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents) {
checkAvailableSpace(numWaitEvents, false, commonImmediateCommandSize, false); checkAvailableSpace(numWaitEvents, false, commonImmediateCommandSize);
auto ret = CommandListCoreFamily<gfxCoreFamily>::appendWriteGlobalTimestamp(dstptr, hSignalEvent, numWaitEvents, phWaitEvents); auto ret = CommandListCoreFamily<gfxCoreFamily>::appendWriteGlobalTimestamp(dstptr, hSignalEvent, numWaitEvents, phWaitEvents);
@@ -869,7 +855,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendImageCopyRegion
auto sizePerBlit = sizeof(typename GfxFamily::XY_BLOCK_COPY_BLT) + NEO::BlitCommandsHelper<GfxFamily>::estimatePostBlitCommandSize(); auto sizePerBlit = sizeof(typename GfxFamily::XY_BLOCK_COPY_BLT) + NEO::BlitCommandsHelper<GfxFamily>::estimatePostBlitCommandSize();
estimatedSize += nBlits * sizePerBlit; estimatedSize += nBlits * sizePerBlit;
} }
checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, estimatedSize, false); checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, estimatedSize);
auto ret = CommandListCoreFamily<gfxCoreFamily>::appendImageCopyRegion(hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, auto ret = CommandListCoreFamily<gfxCoreFamily>::appendImageCopyRegion(hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent,
numWaitEvents, phWaitEvents, relaxedOrderingDispatch); numWaitEvents, phWaitEvents, relaxedOrderingDispatch);
@@ -887,7 +873,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendImageCopyFromMe
ze_event_handle_t *phWaitEvents, bool relaxedOrderingDispatch) { ze_event_handle_t *phWaitEvents, bool relaxedOrderingDispatch) {
relaxedOrderingDispatch = isRelaxedOrderingDispatchAllowed(numWaitEvents, false); relaxedOrderingDispatch = isRelaxedOrderingDispatchAllowed(numWaitEvents, false);
checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, commonImmediateCommandSize, false); checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, commonImmediateCommandSize);
auto ret = CommandListCoreFamily<gfxCoreFamily>::appendImageCopyFromMemory(hDstImage, srcPtr, pDstRegion, hSignalEvent, auto ret = CommandListCoreFamily<gfxCoreFamily>::appendImageCopyFromMemory(hDstImage, srcPtr, pDstRegion, hSignalEvent,
numWaitEvents, phWaitEvents, relaxedOrderingDispatch); numWaitEvents, phWaitEvents, relaxedOrderingDispatch);
@@ -905,7 +891,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendImageCopyToMemo
ze_event_handle_t *phWaitEvents, bool relaxedOrderingDispatch) { ze_event_handle_t *phWaitEvents, bool relaxedOrderingDispatch) {
relaxedOrderingDispatch = isRelaxedOrderingDispatchAllowed(numWaitEvents, false); relaxedOrderingDispatch = isRelaxedOrderingDispatchAllowed(numWaitEvents, false);
checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, commonImmediateCommandSize, false); checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, commonImmediateCommandSize);
auto ret = CommandListCoreFamily<gfxCoreFamily>::appendImageCopyToMemory(dstPtr, hSrcImage, pSrcRegion, hSignalEvent, auto ret = CommandListCoreFamily<gfxCoreFamily>::appendImageCopyToMemory(dstPtr, hSrcImage, pSrcRegion, hSignalEvent,
numWaitEvents, phWaitEvents, relaxedOrderingDispatch); numWaitEvents, phWaitEvents, relaxedOrderingDispatch);
@@ -925,7 +911,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendImageCopyFromMe
ze_event_handle_t *phWaitEvents, bool relaxedOrderingDispatch) { ze_event_handle_t *phWaitEvents, bool relaxedOrderingDispatch) {
relaxedOrderingDispatch = isRelaxedOrderingDispatchAllowed(numWaitEvents, false); relaxedOrderingDispatch = isRelaxedOrderingDispatchAllowed(numWaitEvents, false);
checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, commonImmediateCommandSize, false); checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, commonImmediateCommandSize);
auto ret = CommandListCoreFamily<gfxCoreFamily>::appendImageCopyFromMemoryExt(hDstImage, srcPtr, pDstRegion, srcRowPitch, srcSlicePitch, auto ret = CommandListCoreFamily<gfxCoreFamily>::appendImageCopyFromMemoryExt(hDstImage, srcPtr, pDstRegion, srcRowPitch, srcSlicePitch,
hSignalEvent, numWaitEvents, phWaitEvents, relaxedOrderingDispatch); hSignalEvent, numWaitEvents, phWaitEvents, relaxedOrderingDispatch);
@@ -945,7 +931,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendImageCopyToMemo
ze_event_handle_t *phWaitEvents, bool relaxedOrderingDispatch) { ze_event_handle_t *phWaitEvents, bool relaxedOrderingDispatch) {
relaxedOrderingDispatch = isRelaxedOrderingDispatchAllowed(numWaitEvents, false); relaxedOrderingDispatch = isRelaxedOrderingDispatchAllowed(numWaitEvents, false);
checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, commonImmediateCommandSize, false); checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, commonImmediateCommandSize);
auto ret = CommandListCoreFamily<gfxCoreFamily>::appendImageCopyToMemoryExt(dstPtr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, auto ret = CommandListCoreFamily<gfxCoreFamily>::appendImageCopyToMemoryExt(dstPtr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch,
hSignalEvent, numWaitEvents, phWaitEvents, relaxedOrderingDispatch); hSignalEvent, numWaitEvents, phWaitEvents, relaxedOrderingDispatch);
@@ -960,7 +946,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendMemoryRangesBar
ze_event_handle_t hSignalEvent, ze_event_handle_t hSignalEvent,
uint32_t numWaitEvents, uint32_t numWaitEvents,
ze_event_handle_t *phWaitEvents) { ze_event_handle_t *phWaitEvents) {
checkAvailableSpace(numWaitEvents, false, commonImmediateCommandSize, false); checkAvailableSpace(numWaitEvents, false, commonImmediateCommandSize);
auto ret = CommandListCoreFamily<gfxCoreFamily>::appendMemoryRangesBarrier(numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents); auto ret = CommandListCoreFamily<gfxCoreFamily>::appendMemoryRangesBarrier(numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents);
return flushImmediate(ret, true, true, false, false, false, hSignalEvent, false); return flushImmediate(ret, true, true, false, false, false, hSignalEvent, false);
@@ -968,14 +954,14 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendMemoryRangesBar
template <GFXCORE_FAMILY gfxCoreFamily> template <GFXCORE_FAMILY gfxCoreFamily>
ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendWaitOnMemory(void *desc, void *ptr, uint64_t data, ze_event_handle_t signalEventHandle, bool useQwordData) { ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendWaitOnMemory(void *desc, void *ptr, uint64_t data, ze_event_handle_t signalEventHandle, bool useQwordData) {
checkAvailableSpace(0, false, commonImmediateCommandSize, false); checkAvailableSpace(0, false, commonImmediateCommandSize);
auto ret = CommandListCoreFamily<gfxCoreFamily>::appendWaitOnMemory(desc, ptr, data, signalEventHandle, useQwordData); auto ret = CommandListCoreFamily<gfxCoreFamily>::appendWaitOnMemory(desc, ptr, data, signalEventHandle, useQwordData);
return flushImmediate(ret, true, false, false, false, false, signalEventHandle, false); return flushImmediate(ret, true, false, false, false, false, signalEventHandle, false);
} }
template <GFXCORE_FAMILY gfxCoreFamily> template <GFXCORE_FAMILY gfxCoreFamily>
ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendWriteToMemory(void *desc, void *ptr, uint64_t data) { ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendWriteToMemory(void *desc, void *ptr, uint64_t data) {
checkAvailableSpace(0, false, commonImmediateCommandSize, false); checkAvailableSpace(0, false, commonImmediateCommandSize);
auto ret = CommandListCoreFamily<gfxCoreFamily>::appendWriteToMemory(desc, ptr, data); auto ret = CommandListCoreFamily<gfxCoreFamily>::appendWriteToMemory(desc, ptr, data);
return flushImmediate(ret, true, false, false, false, false, nullptr, false); return flushImmediate(ret, true, false, false, false, false, nullptr, false);
} }
@@ -985,7 +971,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendWaitExternalSem
const ze_intel_external_semaphore_wait_params_exp_t *params, ze_event_handle_t hSignalEvent, const ze_intel_external_semaphore_wait_params_exp_t *params, ze_event_handle_t hSignalEvent,
uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents) { uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents) {
checkAvailableSpace(0, false, commonImmediateCommandSize, false); checkAvailableSpace(0, false, commonImmediateCommandSize);
auto ret = ZE_RESULT_SUCCESS; auto ret = ZE_RESULT_SUCCESS;
if (numWaitEvents) { if (numWaitEvents) {
@@ -1030,7 +1016,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendSignalExternalS
const ze_intel_external_semaphore_signal_params_exp_t *params, ze_event_handle_t hSignalEvent, const ze_intel_external_semaphore_signal_params_exp_t *params, ze_event_handle_t hSignalEvent,
uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents) { uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents) {
checkAvailableSpace(0, false, commonImmediateCommandSize, false); checkAvailableSpace(0, false, commonImmediateCommandSize);
auto ret = ZE_RESULT_SUCCESS; auto ret = ZE_RESULT_SUCCESS;
if (numWaitEvents) { if (numWaitEvents) {
@@ -1677,10 +1663,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendCommandLists(ui
ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents) { ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents) {
auto ret = ZE_RESULT_SUCCESS; auto ret = ZE_RESULT_SUCCESS;
checkAvailableSpace(numWaitEvents, false, commonImmediateCommandSize);
// For API functionality, we require command buffer alloc in local mem for.
// So ensure we force it when checking available space and when allocating any new comand buffer allocs
checkAvailableSpace(numWaitEvents, false, commonImmediateCommandSize, true);
if (numWaitEvents) { if (numWaitEvents) {
ret = this->appendWaitOnEvents(numWaitEvents, phWaitEvents, nullptr, false, true, true, true, true, false); ret = this->appendWaitOnEvents(numWaitEvents, phWaitEvents, nullptr, false, true, true, true, true, false);
} }
@@ -1705,9 +1688,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendCommandLists(ui
} }
bool hasStallingCmds = true; bool hasStallingCmds = true;
ret = flushImmediate(ret, true, hasStallingCmds, relaxedOrderingDispatch, true, false, hSignalEvent, true); return flushImmediate(ret, true, hasStallingCmds, relaxedOrderingDispatch, true, false, hSignalEvent, true);
return ret;
} }
} // namespace L0 } // namespace L0

View File

@@ -98,7 +98,7 @@ ze_result_t CommandQueueImp::initialize(bool copyOnly, bool isInternal, bool imm
auto &productHelper = rootDeviceEnvironment.getHelper<NEO::ProductHelper>(); auto &productHelper = rootDeviceEnvironment.getHelper<NEO::ProductHelper>();
this->doubleSbaWa = productHelper.isAdditionalStateBaseAddressWARequired(hwInfo); this->doubleSbaWa = productHelper.isAdditionalStateBaseAddressWARequired(hwInfo);
this->cmdListHeapAddressModel = L0GfxCoreHelper::getHeapAddressModel(rootDeviceEnvironment); this->cmdListHeapAddressModel = L0GfxCoreHelper::getHeapAddressModel(rootDeviceEnvironment);
this->dispatchCmdListBatchBufferAsPrimary = L0GfxCoreHelper::dispatchCmdListBatchBufferAsPrimary(rootDeviceEnvironment, !(immediateCmdListQueue && internalUsage)); this->dispatchCmdListBatchBufferAsPrimary = L0GfxCoreHelper::dispatchCmdListBatchBufferAsPrimary(rootDeviceEnvironment, !immediateCmdListQueue);
auto &compilerProductHelper = rootDeviceEnvironment.getHelper<NEO::CompilerProductHelper>(); auto &compilerProductHelper = rootDeviceEnvironment.getHelper<NEO::CompilerProductHelper>();
this->heaplessModeEnabled = compilerProductHelper.isHeaplessModeEnabled(); this->heaplessModeEnabled = compilerProductHelper.isHeaplessModeEnabled();
this->heaplessStateInitEnabled = compilerProductHelper.isHeaplessStateInitEnabled(this->heaplessModeEnabled); this->heaplessStateInitEnabled = compilerProductHelper.isHeaplessStateInitEnabled(this->heaplessModeEnabled);

View File

@@ -113,23 +113,11 @@ ze_result_t CommandQueueHw<gfxCoreFamily>::executeCommandLists(
this->startingCmdBuffer = &this->commandStream; this->startingCmdBuffer = &this->commandStream;
NEO::LinearStream *parentStream = nullptr;
if (this->isCopyOnlyCommandQueue) { if (this->isCopyOnlyCommandQueue) {
if (NEO::debugManager.flags.ForceParentCommandStreamUsageForImmediateAppendForCopyEngine.get() == 1) { ret = this->executeCommandListsCopyOnly(ctx, numCommandLists, phCommandLists, hFence, parentImmediateCommandlistLinearStream);
parentStream = parentImmediateCommandlistLinearStream;
}
ret = this->executeCommandListsCopyOnly(ctx, numCommandLists, phCommandLists, hFence, parentStream);
} else if (this->heaplessStateInitEnabled) { } else if (this->heaplessStateInitEnabled) {
parentStream = parentImmediateCommandlistLinearStream;
if (NEO::debugManager.flags.ForceParentCommandStreamUsageForImmediateAppendForComputeEngine.get() == 0) {
parentStream = nullptr;
}
ret = this->executeCommandListsRegularHeapless(ctx, numCommandLists, phCommandLists, hFence, parentImmediateCommandlistLinearStream); ret = this->executeCommandListsRegularHeapless(ctx, numCommandLists, phCommandLists, hFence, parentImmediateCommandlistLinearStream);
} else { } else {
parentStream = parentImmediateCommandlistLinearStream;
if (NEO::debugManager.flags.ForceParentCommandStreamUsageForImmediateAppendForComputeEngine.get() == 0) {
parentStream = nullptr;
}
ret = this->executeCommandListsRegular(ctx, numCommandLists, phCommandLists, hFence, parentImmediateCommandlistLinearStream); ret = this->executeCommandListsRegular(ctx, numCommandLists, phCommandLists, hFence, parentImmediateCommandlistLinearStream);
} }
@@ -1299,6 +1287,10 @@ void CommandQueueHw<gfxCoreFamily>::programOneCmdListBatchBufferStartSecondaryBa
} }
} }
} }
if (ctx.containsParentImmediateStream) {
NEO::EncodeBatchBufferStartOrEnd<GfxFamily>::programBatchBufferEnd(commandContainer);
}
} }
template <GFXCORE_FAMILY gfxCoreFamily> template <GFXCORE_FAMILY gfxCoreFamily>

View File

@@ -1733,10 +1733,10 @@ HWTEST_F(PrimaryBatchBufferCmdListTest, givenForcedPrimaryBatchBufferWhenRegular
EXPECT_TRUE(commandList->dispatchCmdListBatchBufferAsPrimary); EXPECT_TRUE(commandList->dispatchCmdListBatchBufferAsPrimary);
EXPECT_TRUE(commandQueue->dispatchCmdListBatchBufferAsPrimary); EXPECT_TRUE(commandQueue->dispatchCmdListBatchBufferAsPrimary);
EXPECT_TRUE(commandListImmediate->dispatchCmdListBatchBufferAsPrimary); EXPECT_FALSE(commandListImmediate->dispatchCmdListBatchBufferAsPrimary);
ASSERT_NE(nullptr, commandListImmediate->cmdQImmediate); ASSERT_NE(nullptr, commandListImmediate->cmdQImmediate);
auto immediateCmdQueue = static_cast<L0::ult::CommandQueue *>(commandListImmediate->cmdQImmediate); auto immediateCmdQueue = static_cast<L0::ult::CommandQueue *>(commandListImmediate->cmdQImmediate);
EXPECT_TRUE(immediateCmdQueue->dispatchCmdListBatchBufferAsPrimary); EXPECT_FALSE(immediateCmdQueue->dispatchCmdListBatchBufferAsPrimary);
} }
HWTEST_F(PrimaryBatchBufferCmdListTest, givenPrimaryBatchBufferWhenAppendingKernelAndClosingCommandListThenExpectAlignedSpaceForBatchBufferStart) { HWTEST_F(PrimaryBatchBufferCmdListTest, givenPrimaryBatchBufferWhenAppendingKernelAndClosingCommandListThenExpectAlignedSpaceForBatchBufferStart) {
@@ -1885,62 +1885,6 @@ HWTEST2_F(PrimaryBatchBufferCmdListTest, givenRelaxedOrderingAndRegularCmdListAn
} }
} }
HWTEST2_F(PrimaryBatchBufferCmdListTest, givenRegularCmdListAndSubmittedToImmediateWhenFlushingOnCcsWithoutParentStreamThenExecutePasses, IsAtLeastXeHpcCore) {
DebugManagerStateRestore restore;
debugManager.flags.ForceParentCommandStreamUsageForImmediateAppendForComputeEngine.set(0);
ze_command_queue_desc_t desc = {};
desc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
ze_result_t returnValue = ZE_RESULT_ERROR_UNINITIALIZED;
auto immCommandList = zeUniquePtr(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::compute, returnValue));
ASSERT_NE(nullptr, immCommandList);
ze_group_count_t groupCount{1, 1, 1};
CmdListKernelLaunchParams launchParams = {};
EXPECT_EQ(ZE_RESULT_SUCCESS, commandList->appendLaunchKernel(kernel->toHandle(), groupCount, nullptr, 0, nullptr, launchParams, false));
EXPECT_EQ(ZE_RESULT_SUCCESS, commandList->close());
auto cmdListHandle = commandList->toHandle();
EXPECT_EQ(ZE_RESULT_SUCCESS, immCommandList->appendCommandLists(1, &cmdListHandle, nullptr, 0, nullptr));
}
HWTEST2_F(PrimaryBatchBufferCmdListTest, givenRegularCmdListAndSubmittedToImmediateWhenFlushingOnBcsWithoutParentStreamThenExecutePasses, IsAtLeastXeHpcCore) {
DebugManagerStateRestore restore;
debugManager.flags.ForceParentCommandStreamUsageForImmediateAppendForCopyEngine.set(0);
ze_command_queue_desc_t desc = {};
desc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
ze_result_t returnValue = ZE_RESULT_ERROR_UNINITIALIZED;
auto immCommandList = zeUniquePtr(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::copy, returnValue));
ASSERT_NE(nullptr, immCommandList);
EXPECT_EQ(ZE_RESULT_SUCCESS, commandList->appendBarrier(nullptr, 0, nullptr, false));
EXPECT_EQ(ZE_RESULT_SUCCESS, commandList->close());
auto cmdListHandle = commandList->toHandle();
EXPECT_EQ(ZE_RESULT_SUCCESS, immCommandList->appendCommandLists(1, &cmdListHandle, nullptr, 0, nullptr));
}
HWTEST2_F(PrimaryBatchBufferCmdListTest, givenRegularCmdListAndSubmittedToImmediateWhenFlushingOnBcsWithParentStreamThenExecutePasses, IsAtLeastXeHpcCore) {
DebugManagerStateRestore restore;
debugManager.flags.ForceParentCommandStreamUsageForImmediateAppendForCopyEngine.set(1);
ze_command_queue_desc_t desc = {};
desc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
ze_result_t returnValue = ZE_RESULT_ERROR_UNINITIALIZED;
auto immCommandList = zeUniquePtr(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::copy, returnValue));
ASSERT_NE(nullptr, immCommandList);
EXPECT_EQ(ZE_RESULT_SUCCESS, commandList->appendBarrier(nullptr, 0, nullptr, false));
EXPECT_EQ(ZE_RESULT_SUCCESS, commandList->close());
auto cmdListHandle = commandList->toHandle();
EXPECT_EQ(ZE_RESULT_SUCCESS, immCommandList->appendCommandLists(1, &cmdListHandle, nullptr, 0, nullptr));
}
HWTEST_F(PrimaryBatchBufferCmdListTest, givenCmdListWhenCallingSynchronizeThenUnregisterCsrClient) { HWTEST_F(PrimaryBatchBufferCmdListTest, givenCmdListWhenCallingSynchronizeThenUnregisterCsrClient) {
ze_group_count_t groupCount{1, 1, 1}; ze_group_count_t groupCount{1, 1, 1};
CmdListKernelLaunchParams launchParams = {}; CmdListKernelLaunchParams launchParams = {};

View File

@@ -919,8 +919,7 @@ HWTEST2_F(CommandListCreate, givenSecondaryCommandStreamForImmediateCmdListWhenC
CommandStreamReceiver *csr = nullptr; CommandStreamReceiver *csr = nullptr;
device->getCsrForOrdinalAndIndex(&csr, desc.ordinal, desc.index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false); device->getCsrForOrdinalAndIndex(&csr, desc.ordinal, desc.index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
reinterpret_cast<UltCommandStreamReceiver<FamilyType> *>(csr)->directSubmissionAvailable = true; reinterpret_cast<UltCommandStreamReceiver<FamilyType> *>(csr)->directSubmissionAvailable = true;
std::unique_ptr<L0::CommandList> commandList(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::compute, returnValue)); std::unique_ptr<L0::CommandList> commandList(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::copy, returnValue));
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
ASSERT_NE(nullptr, commandList); ASSERT_NE(nullptr, commandList);
EXPECT_NE(reinterpret_cast<CmdContainerMock *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList.get(), nullptr); EXPECT_NE(reinterpret_cast<CmdContainerMock *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList.get(), nullptr);
EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(reinterpret_cast<CmdContainerMock *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList->getGraphicsAllocation()->getMemoryPool())); EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(reinterpret_cast<CmdContainerMock *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList->getGraphicsAllocation()->getMemoryPool()));
@@ -928,7 +927,7 @@ HWTEST2_F(CommandListCreate, givenSecondaryCommandStreamForImmediateCmdListWhenC
auto immediateCmdList = static_cast<CommandListCoreFamilyImmediate<gfxCoreFamily> *>(commandList.get()); auto immediateCmdList = static_cast<CommandListCoreFamilyImmediate<gfxCoreFamily> *>(commandList.get());
auto secondaryCmdStream = reinterpret_cast<CmdContainerMock *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList.get(); auto secondaryCmdStream = reinterpret_cast<CmdContainerMock *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList.get();
immediateCmdList->checkAvailableSpace(0u, false, commonImmediateCommandSize, false); immediateCmdList->checkAvailableSpace(0u, false, commonImmediateCommandSize);
EXPECT_EQ(commandList->getCmdContainer().getCommandStream(), secondaryCmdStream); EXPECT_EQ(commandList->getCmdContainer().getCommandStream(), secondaryCmdStream);
EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(commandList->getCmdContainer().getCommandStream()->getGraphicsAllocation()->getMemoryPool())); EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(commandList->getCmdContainer().getCommandStream()->getGraphicsAllocation()->getMemoryPool()));
@@ -939,147 +938,6 @@ HWTEST2_F(CommandListCreate, givenSecondaryCommandStreamForImmediateCmdListWhenC
EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(reinterpret_cast<CmdContainerMock *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList->getGraphicsAllocation()->getMemoryPool())); EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(reinterpret_cast<CmdContainerMock *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList->getGraphicsAllocation()->getMemoryPool()));
} }
HWTEST2_F(CommandListCreate, givenSecondaryCommandStreamInHostMemForImmediateCmdListWhenCheckAvailableSpaceForRelaxedOrderingThenSwapCommandStreams, IsAtMostXe2HpgCore) {
auto &gfxCoreHelper = device->getGfxCoreHelper();
auto &productHelper = device->getProductHelper();
if (!gfxCoreHelper.isPlatformFlushTaskEnabled(productHelper)) {
GTEST_SKIP();
}
DebugManagerStateRestore restorer;
debugManager.flags.DirectSubmissionFlatRingBuffer.set(-1);
debugManager.flags.DirectSubmissionRelaxedOrdering.set(1);
static_cast<MockMemoryManager *>(device->getNEODevice()->getMemoryManager())->localMemorySupported[0] = true;
ze_command_queue_desc_t desc = {};
desc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
ze_result_t returnValue;
CommandStreamReceiver *csr = nullptr;
device->getCsrForOrdinalAndIndex(&csr, desc.ordinal, desc.index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
reinterpret_cast<UltCommandStreamReceiver<FamilyType> *>(csr)->directSubmissionAvailable = true;
std::unique_ptr<L0::CommandList> commandList(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::compute, returnValue));
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
ASSERT_NE(nullptr, commandList);
EXPECT_NE(reinterpret_cast<CmdContainerMock *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList.get(), nullptr);
EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(reinterpret_cast<CmdContainerMock *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList->getGraphicsAllocation()->getMemoryPool()));
auto immediateCmdList = static_cast<CommandListCoreFamilyImmediate<gfxCoreFamily> *>(commandList.get());
auto secondaryCmdStream = reinterpret_cast<CmdContainerMock *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList.get();
immediateCmdList->getCmdContainer().swapStreams();
EXPECT_EQ(commandList->getCmdContainer().getCommandStream(), secondaryCmdStream);
EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(commandList->getCmdContainer().getCommandStream()->getGraphicsAllocation()->getMemoryPool()));
immediateCmdList->checkAvailableSpace(0u, true, commonImmediateCommandSize, false);
EXPECT_NE(commandList->getCmdContainer().getCommandStream(), secondaryCmdStream);
}
struct CmdContainerMockLocalAllocTests : public CommandContainer {
using CommandContainer::secondaryCommandStreamForImmediateCmdList;
};
HWTEST2_F(CommandListCreate, givenSecondaryCommandStreamForImmediateCmdListButNotYetUsingHostAllocWhenCallingAppendCmdlistsThenDoNotSwapCommandStreams, IsPVC) {
DebugManagerStateRestore restorer;
debugManager.flags.DirectSubmissionFlatRingBuffer.set(-1);
debugManager.flags.DirectSubmissionRelaxedOrdering.set(1);
static_cast<MockMemoryManager *>(device->getNEODevice()->getMemoryManager())->localMemorySupported[0] = true;
ze_command_queue_desc_t desc = {};
desc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
ze_result_t returnValue;
CommandStreamReceiver *csr = nullptr;
device->getCsrForOrdinalAndIndex(&csr, desc.ordinal, desc.index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
reinterpret_cast<UltCommandStreamReceiver<FamilyType> *>(csr)->directSubmissionAvailable = true;
std::unique_ptr<L0::CommandList> commandList(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::copy, returnValue));
ASSERT_NE(nullptr, commandList);
EXPECT_NE(reinterpret_cast<CmdContainerMockLocalAllocTests *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList.get(), nullptr);
EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(reinterpret_cast<CmdContainerMockLocalAllocTests *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList->getGraphicsAllocation()->getMemoryPool()));
auto secondaryCmdStream = reinterpret_cast<CmdContainerMockLocalAllocTests *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList.get();
std::unique_ptr<L0::CommandList> commandListRegular(CommandList::create(productFamily, device, NEO::EngineGroupType::copy, 0u, returnValue, false));
commandListRegular->close();
auto commandListHandle = commandListRegular->toHandle();
ze_result_t result = ZE_RESULT_SUCCESS;
result = commandList->appendCommandLists(1u, &commandListHandle, nullptr, 0u, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_NE(commandList->getCmdContainer().getCommandStream(), secondaryCmdStream);
EXPECT_FALSE(MemoryPoolHelper::isSystemMemoryPool(commandList->getCmdContainer().getCommandStream()->getGraphicsAllocation()->getMemoryPool()));
}
HWTEST2_F(CommandListCreate, givenSecondaryCommandStreamForImmediateCmdListButAndUsingHostAllocWhenCallingAppendCmdlistsThenSwapCommandStreamsAndAppendSucceeds, IsAtMostXe2HpgCore) {
DebugManagerStateRestore restorer;
debugManager.flags.DirectSubmissionFlatRingBuffer.set(-1);
static_cast<MockMemoryManager *>(device->getNEODevice()->getMemoryManager())->localMemorySupported[0] = true;
ze_command_queue_desc_t desc = {};
desc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
ze_result_t returnValue;
CommandStreamReceiver *csr = nullptr;
device->getCsrForOrdinalAndIndex(&csr, desc.ordinal, desc.index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
reinterpret_cast<UltCommandStreamReceiver<FamilyType> *>(csr)->directSubmissionAvailable = true;
std::unique_ptr<L0::CommandList> commandList(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::copy, returnValue));
ASSERT_NE(nullptr, commandList);
EXPECT_NE(reinterpret_cast<CmdContainerMockLocalAllocTests *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList.get(), nullptr);
EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(reinterpret_cast<CmdContainerMockLocalAllocTests *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList->getGraphicsAllocation()->getMemoryPool()));
auto secondaryCmdStream = reinterpret_cast<CmdContainerMockLocalAllocTests *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList.get();
std::unique_ptr<L0::CommandList> commandListRegular(CommandList::create(productFamily, device, NEO::EngineGroupType::copy, 0u, returnValue, false));
commandListRegular->close();
auto commandListHandle = commandListRegular->toHandle();
commandList->getCmdContainer().swapStreams();
EXPECT_EQ(commandList->getCmdContainer().getCommandStream(), secondaryCmdStream);
ze_result_t result = ZE_RESULT_SUCCESS;
result = commandList->appendCommandLists(1u, &commandListHandle, nullptr, 0u, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_NE(commandList->getCmdContainer().getCommandStream(), secondaryCmdStream);
}
HWTEST2_F(CommandListCreate, givenSecondaryCommandStreamForImmediateCmdListAndAlreadyUsingHostAllocThenAppendingRegularCommandlistsIntoImmediateUsesLocalAndRestoresHostAlloc, MatchAny) {
if (!device->getHwInfo().featureTable.flags.ftrLocalMemory) {
GTEST_SKIP();
}
DebugManagerStateRestore restorer;
debugManager.flags.DirectSubmissionFlatRingBuffer.set(-1);
static_cast<MockMemoryManager *>(device->getNEODevice()->getMemoryManager())->localMemorySupported[0] = true;
ze_command_queue_desc_t desc = {};
desc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
ze_result_t returnValue;
CommandStreamReceiver *csr = nullptr;
device->getCsrForOrdinalAndIndex(&csr, desc.ordinal, desc.index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
reinterpret_cast<UltCommandStreamReceiver<FamilyType> *>(csr)->directSubmissionAvailable = true;
std::unique_ptr<L0::CommandList> commandList(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::copy, returnValue));
ASSERT_NE(nullptr, commandList);
EXPECT_NE(reinterpret_cast<CmdContainerMock *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList.get(), nullptr);
EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(reinterpret_cast<CmdContainerMock *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList->getGraphicsAllocation()->getMemoryPool()));
auto immediateCmdList = static_cast<CommandListCoreFamilyImmediate<gfxCoreFamily> *>(commandList.get());
auto secondaryCmdStream = reinterpret_cast<CmdContainerMock *>(&commandList->getCmdContainer())->secondaryCommandStreamForImmediateCmdList.get();
immediateCmdList->checkAvailableSpace(0u, false, commonImmediateCommandSize, false);
EXPECT_EQ(commandList->getCmdContainer().getCommandStream(), secondaryCmdStream);
EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(commandList->getCmdContainer().getCommandStream()->getGraphicsAllocation()->getMemoryPool()));
std::unique_ptr<L0::CommandList> commandListRegular(CommandList::create(productFamily, device, NEO::EngineGroupType::copy, 0u, returnValue, false));
commandListRegular->close();
auto commandListHandle = commandListRegular->toHandle();
ze_result_t result = ZE_RESULT_SUCCESS;
result = commandList->appendCommandLists(1u, &commandListHandle, nullptr, 0u, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(commandList->getCmdContainer().getCommandStream(), secondaryCmdStream);
EXPECT_TRUE(commandList->getCmdContainer().usingSecondaryCmdbufInHostMem());
}
HWTEST2_F(CommandListCreate, givenNoSecondaryCommandStreamForImmediateCmdListWhenCheckAvailableSpaceThenNotSwapCommandStreams, MatchAny) { HWTEST2_F(CommandListCreate, givenNoSecondaryCommandStreamForImmediateCmdListWhenCheckAvailableSpaceThenNotSwapCommandStreams, MatchAny) {
if (!device->getHwInfo().featureTable.flags.ftrLocalMemory) { if (!device->getHwInfo().featureTable.flags.ftrLocalMemory) {
GTEST_SKIP(); GTEST_SKIP();
@@ -1098,7 +956,7 @@ HWTEST2_F(CommandListCreate, givenNoSecondaryCommandStreamForImmediateCmdListWhe
auto immediateCmdList = static_cast<CommandListCoreFamilyImmediate<gfxCoreFamily> *>(commandList.get()); auto immediateCmdList = static_cast<CommandListCoreFamilyImmediate<gfxCoreFamily> *>(commandList.get());
auto cmdStream = commandList->getCmdContainer().getCommandStream(); auto cmdStream = commandList->getCmdContainer().getCommandStream();
immediateCmdList->checkAvailableSpace(0u, false, commonImmediateCommandSize, false); immediateCmdList->checkAvailableSpace(0u, false, commonImmediateCommandSize);
EXPECT_EQ(commandList->getCmdContainer().getCommandStream(), cmdStream); EXPECT_EQ(commandList->getCmdContainer().getCommandStream(), cmdStream);
EXPECT_FALSE(MemoryPoolHelper::isSystemMemoryPool(commandList->getCmdContainer().getCommandStream()->getGraphicsAllocation()->getMemoryPool())); EXPECT_FALSE(MemoryPoolHelper::isSystemMemoryPool(commandList->getCmdContainer().getCommandStream()->getGraphicsAllocation()->getMemoryPool()));
@@ -2131,6 +1989,7 @@ HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest,
HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest, HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest,
givenStateBaseAddressTrackingWhenImmediateCmdListAppendKernelChangesHeapsAndExecuteThenFinalBaseAddressStateIsStoredInCsr, givenStateBaseAddressTrackingWhenImmediateCmdListAppendKernelChangesHeapsAndExecuteThenFinalBaseAddressStateIsStoredInCsr,
MatchAny) { MatchAny) {
checkAndPrepareBindlessKernel(); checkAndPrepareBindlessKernel();
StackVec<size_t, 3> sbaCmdsSizes = {}; StackVec<size_t, 3> sbaCmdsSizes = {};
@@ -2298,6 +2157,7 @@ HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest,
HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest, HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest,
givenStateBaseAddressTrackingWhenRegularCmdListAppendKernelAndExecuteAndImmediateCmdListAppendKernelSharingCsrThenBaseAddressStateIsUpdatedInCsr, givenStateBaseAddressTrackingWhenRegularCmdListAppendKernelAndExecuteAndImmediateCmdListAppendKernelSharingCsrThenBaseAddressStateIsUpdatedInCsr,
MatchAny) { MatchAny) {
checkAndPrepareBindlessKernel(); checkAndPrepareBindlessKernel();
StackVec<size_t, 3> sbaCmdsSizes = {}; StackVec<size_t, 3> sbaCmdsSizes = {};
@@ -2528,6 +2388,7 @@ HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest,
HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest, HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest,
givenStateBaseAddressTrackingWhenImmediateCmdListAppendKernelAndRegularCmdListAppendKernelAndExecuteSharingCsrThenBaseAddressStateIsUpdatedInCsr, givenStateBaseAddressTrackingWhenImmediateCmdListAppendKernelAndRegularCmdListAppendKernelAndExecuteSharingCsrThenBaseAddressStateIsUpdatedInCsr,
MatchAny) { MatchAny) {
checkAndPrepareBindlessKernel(); checkAndPrepareBindlessKernel();
StackVec<size_t, 2> sbaCmdsSizes = {}; StackVec<size_t, 2> sbaCmdsSizes = {};
@@ -2755,6 +2616,7 @@ HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest,
HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest, HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest,
givenStateBaseAddressTrackingWhenRegularCmdListAppendUncachedKernelFirstAndExecuteAndImmediateCmdListAppendUncachedKernelThenMocsStateIsUpdatedInCsr, givenStateBaseAddressTrackingWhenRegularCmdListAppendUncachedKernelFirstAndExecuteAndImmediateCmdListAppendUncachedKernelThenMocsStateIsUpdatedInCsr,
MatchAny) { MatchAny) {
checkAndPrepareBindlessKernel(); checkAndPrepareBindlessKernel();
StackVec<size_t, 3> sbaCmdsSizes = {}; StackVec<size_t, 3> sbaCmdsSizes = {};
@@ -3119,6 +2981,7 @@ HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest,
HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest, HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest,
givenCommandListAppendsKernelWhenCommandListIsResetThenBaseAddressPropertiesAreResetToo, givenCommandListAppendsKernelWhenCommandListIsResetThenBaseAddressPropertiesAreResetToo,
MatchAny) { MatchAny) {
ze_group_count_t groupCount{1, 1, 1}; ze_group_count_t groupCount{1, 1, 1};
CmdListKernelLaunchParams launchParams = {}; CmdListKernelLaunchParams launchParams = {};
auto result = commandList->appendLaunchKernel(kernel->toHandle(), groupCount, nullptr, 0, nullptr, launchParams, false); auto result = commandList->appendLaunchKernel(kernel->toHandle(), groupCount, nullptr, 0, nullptr, launchParams, false);
@@ -3153,6 +3016,7 @@ HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest,
HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest, HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest,
givenCommandListAppendsKernelWhenCommandListIsResetThenStateHeapsRetainPosition, givenCommandListAppendsKernelWhenCommandListIsResetThenStateHeapsRetainPosition,
MatchAny) { MatchAny) {
ze_group_count_t groupCount{1, 1, 1}; ze_group_count_t groupCount{1, 1, 1};
CmdListKernelLaunchParams launchParams = {}; CmdListKernelLaunchParams launchParams = {};
auto result = commandList->appendLaunchKernel(kernel->toHandle(), groupCount, nullptr, 0, nullptr, launchParams, false); auto result = commandList->appendLaunchKernel(kernel->toHandle(), groupCount, nullptr, 0, nullptr, launchParams, false);
@@ -3388,6 +3252,7 @@ HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest,
HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest, HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest,
givenCommandListUsingPrivateSurfaceHeapWhenTaskCountZeroAndCommandListDestroyedThenCsrDoNotDispatchesStateCacheFlush, givenCommandListUsingPrivateSurfaceHeapWhenTaskCountZeroAndCommandListDestroyedThenCsrDoNotDispatchesStateCacheFlush,
HeapfulSupportedMatch) { HeapfulSupportedMatch) {
DebugManagerStateRestore restorer; DebugManagerStateRestore restorer;
debugManager.flags.ContextGroupSize.set(0); debugManager.flags.ContextGroupSize.set(0);
NEO::MockDevice *mockNeoDevice(NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(NEO::defaultHwInfo.get(), 0)); NEO::MockDevice *mockNeoDevice(NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(NEO::defaultHwInfo.get(), 0));

View File

@@ -1889,12 +1889,12 @@ HWTEST2_F(CommandListCreate, givenImmediateCommandListWhenThereIsNoEnoughSpaceFo
commandList->getCmdContainer().getCommandStream()->getGraphicsAllocation()->updateTaskCount(0u, 0u); commandList->getCmdContainer().getCommandStream()->getGraphicsAllocation()->updateTaskCount(0u, 0u);
commandList->getCmdContainer().getCommandStream()->getSpace(useSize); commandList->getCmdContainer().getCommandStream()->getSpace(useSize);
reinterpret_cast<CommandListCoreFamilyImmediate<gfxCoreFamily> *>(commandList.get())->checkAvailableSpace(0, false, commonImmediateCommandSize, false); reinterpret_cast<CommandListCoreFamilyImmediate<gfxCoreFamily> *>(commandList.get())->checkAvailableSpace(0, false, commonImmediateCommandSize);
EXPECT_EQ(1U, commandList->getCmdContainer().getCmdBufferAllocations().size()); EXPECT_EQ(1U, commandList->getCmdContainer().getCmdBufferAllocations().size());
commandList->getCmdContainer().getCommandStream()->getSpace(useSize); commandList->getCmdContainer().getCommandStream()->getSpace(useSize);
auto latestFlushedTaskCount = whiteBoxCmdList->getCsr(false)->peekLatestFlushedTaskCount(); auto latestFlushedTaskCount = whiteBoxCmdList->getCsr(false)->peekLatestFlushedTaskCount();
reinterpret_cast<CommandListCoreFamilyImmediate<gfxCoreFamily> *>(commandList.get())->checkAvailableSpace(0, false, commonImmediateCommandSize, false); reinterpret_cast<CommandListCoreFamilyImmediate<gfxCoreFamily> *>(commandList.get())->checkAvailableSpace(0, false, commonImmediateCommandSize);
EXPECT_EQ(1U, commandList->getCmdContainer().getCmdBufferAllocations().size()); EXPECT_EQ(1U, commandList->getCmdContainer().getCmdBufferAllocations().size());
EXPECT_EQ(latestFlushedTaskCount + 1, whiteBoxCmdList->getCsr(false)->peekLatestFlushedTaskCount()); EXPECT_EQ(latestFlushedTaskCount + 1, whiteBoxCmdList->getCsr(false)->peekLatestFlushedTaskCount());
} }
@@ -1916,12 +1916,12 @@ HWTEST2_F(CommandListCreate, givenImmediateCommandListWhenThereIsNoEnoughSpaceFo
commandList->getCmdContainer().getCommandStream()->getGraphicsAllocation()->updateTaskCount(0u, 0u); commandList->getCmdContainer().getCommandStream()->getGraphicsAllocation()->updateTaskCount(0u, 0u);
commandList->getCmdContainer().getCommandStream()->getSpace(useSize); commandList->getCmdContainer().getCommandStream()->getSpace(useSize);
reinterpret_cast<CommandListCoreFamilyImmediate<gfxCoreFamily> *>(commandList.get())->checkAvailableSpace(numEvents, false, commonImmediateCommandSize, false); reinterpret_cast<CommandListCoreFamilyImmediate<gfxCoreFamily> *>(commandList.get())->checkAvailableSpace(numEvents, false, commonImmediateCommandSize);
EXPECT_EQ(1U, commandList->getCmdContainer().getCmdBufferAllocations().size()); EXPECT_EQ(1U, commandList->getCmdContainer().getCmdBufferAllocations().size());
commandList->getCmdContainer().getCommandStream()->getSpace(useSize); commandList->getCmdContainer().getCommandStream()->getSpace(useSize);
auto latestFlushedTaskCount = whiteBoxCmdList->getCsr(false)->peekLatestFlushedTaskCount(); auto latestFlushedTaskCount = whiteBoxCmdList->getCsr(false)->peekLatestFlushedTaskCount();
reinterpret_cast<CommandListCoreFamilyImmediate<gfxCoreFamily> *>(commandList.get())->checkAvailableSpace(numEvents, false, commonImmediateCommandSize, false); reinterpret_cast<CommandListCoreFamilyImmediate<gfxCoreFamily> *>(commandList.get())->checkAvailableSpace(numEvents, false, commonImmediateCommandSize);
EXPECT_EQ(1U, commandList->getCmdContainer().getCmdBufferAllocations().size()); EXPECT_EQ(1U, commandList->getCmdContainer().getCmdBufferAllocations().size());
EXPECT_EQ(latestFlushedTaskCount + 1, whiteBoxCmdList->getCsr(false)->peekLatestFlushedTaskCount()); EXPECT_EQ(latestFlushedTaskCount + 1, whiteBoxCmdList->getCsr(false)->peekLatestFlushedTaskCount());
} }

View File

@@ -1244,7 +1244,7 @@ HWTEST2_F(MultiTileImmediateCommandListAppendLaunchKernelXeHpCoreTest, givenImpl
auto itorBbStart = find<MI_BATCH_BUFFER_START *>(cmdList.begin(), cmdList.end()); auto itorBbStart = find<MI_BATCH_BUFFER_START *>(cmdList.begin(), cmdList.end());
ASSERT_NE(cmdList.end(), itorBbStart); ASSERT_NE(cmdList.end(), itorBbStart);
auto cmdBbStart = genCmdCast<MI_BATCH_BUFFER_START *>(*itorBbStart); auto cmdBbStart = genCmdCast<MI_BATCH_BUFFER_START *>(*itorBbStart);
EXPECT_NE(MI_BATCH_BUFFER_START::SECOND_LEVEL_BATCH_BUFFER::SECOND_LEVEL_BATCH_BUFFER_SECOND_LEVEL_BATCH, cmdBbStart->getSecondLevelBatchBuffer()); EXPECT_EQ(MI_BATCH_BUFFER_START::SECOND_LEVEL_BATCH_BUFFER::SECOND_LEVEL_BATCH_BUFFER_SECOND_LEVEL_BATCH, cmdBbStart->getSecondLevelBatchBuffer());
} }
} // namespace ult } // namespace ult
} // namespace L0 } // namespace L0

View File

@@ -154,7 +154,7 @@ HWTEST2_F(CommandListAppendSignalEvent, givenCommandListWhenAppendWriteGlobalTim
EXPECT_FALSE(cmd->getDcFlushEnable()); EXPECT_FALSE(cmd->getDcFlushEnable());
} }
HWTEST2_F(CommandListAppendSignalEvent, givenImmediateCmdListAndAppendingRegularCommandlistWithWaitOnEventsAndSignalEventThenUseSemaphoreAndPipeControl, IsXeHpcCore) { HWTEST2_F(CommandListAppendSignalEvent, givenImmediateCmdListAndAppendingRegularCommandlistWithWaitOnEventsAndSignalEventThenUseSemaphoreAndPipeControl, IsAtLeastXeHpcCore) {
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
using MI_SEMAPHORE_WAIT = typename FamilyType::MI_SEMAPHORE_WAIT; using MI_SEMAPHORE_WAIT = typename FamilyType::MI_SEMAPHORE_WAIT;
using POST_SYNC_OPERATION = typename PIPE_CONTROL::POST_SYNC_OPERATION; using POST_SYNC_OPERATION = typename PIPE_CONTROL::POST_SYNC_OPERATION;
@@ -222,81 +222,6 @@ HWTEST2_F(CommandListAppendSignalEvent, givenImmediateCmdListAndAppendingRegular
ASSERT_TRUE(postSyncFound); ASSERT_TRUE(postSyncFound);
} }
HWTEST2_F(CommandListAppendSignalEvent, givenImmediateCmdListAndSecondaryDispatchModeForcedAndAppendingRegularCommandlistWithWaitOnEventsAndSignalEventThenUseSemaphoreAndPipeControl, MatchAny) {
DebugManagerStateRestore restorer;
debugManager.flags.DispatchCmdlistCmdBufferPrimary.set(0);
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
using MI_SEMAPHORE_WAIT = typename FamilyType::MI_SEMAPHORE_WAIT;
using POST_SYNC_OPERATION = typename PIPE_CONTROL::POST_SYNC_OPERATION;
using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START;
using MI_BATCH_BUFFER_END = typename FamilyType::MI_BATCH_BUFFER_END;
ze_event_pool_desc_t eventPoolDesc = {};
eventPoolDesc.count = 1;
eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE;
ze_event_desc_t eventDesc = {};
eventDesc.index = 0;
eventDesc.signal = ZE_EVENT_SCOPE_FLAG_HOST;
ze_result_t result = ZE_RESULT_SUCCESS;
auto eventPoolHostVisible = std::unique_ptr<L0::EventPool>(EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result));
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
auto eventHostVisible = std::unique_ptr<L0::Event>(Event::create<typename FamilyType::TimestampPacketType>(eventPoolHostVisible.get(), &eventDesc, device));
auto waitEventPool = std::unique_ptr<L0::EventPool>(EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result));
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
auto waitEvent = std::unique_ptr<L0::Event>(Event::create<typename FamilyType::TimestampPacketType>(waitEventPool.get(), &eventDesc, device));
ze_command_queue_desc_t desc = {};
desc.mode = ZE_COMMAND_QUEUE_MODE_SYNCHRONOUS;
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> immCommandList(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::renderCompute, returnValue));
ASSERT_NE(nullptr, immCommandList);
ze_event_handle_t hSignalEventHandle = eventHostVisible->toHandle();
ze_event_handle_t hWaitEventHandle = waitEvent->toHandle();
std::unique_ptr<L0::CommandList> commandListRegular(CommandList::create(productFamily, device, NEO::EngineGroupType::compute, 0u, returnValue, false));
commandListRegular->close();
auto commandListHandle = commandListRegular->toHandle();
auto usedSpaceBefore = immCommandList->getCmdContainer().getCommandStream()->getUsed();
result = immCommandList->appendCommandLists(1u, &commandListHandle, hSignalEventHandle, 1u, &hWaitEventHandle);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
auto usedSpaceAfter = immCommandList->getCmdContainer().getCommandStream()->getUsed();
ASSERT_GT(usedSpaceAfter, usedSpaceBefore);
GenCmdList cmdList;
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(cmdList,
immCommandList->getCmdContainer().getCommandStream()->getCpuBase(),
usedSpaceAfter));
auto itorSemaphore = find<MI_SEMAPHORE_WAIT *>(cmdList.begin(), cmdList.end());
ASSERT_NE(cmdList.end(), itorSemaphore);
auto itorBBStart = find<MI_BATCH_BUFFER_START *>(itorSemaphore, cmdList.end());
ASSERT_NE(cmdList.end(), itorBBStart);
auto itorPC = findAll<PIPE_CONTROL *>(itorBBStart, cmdList.end());
ASSERT_NE(0u, itorPC.size());
bool postSyncFound = false;
for (auto it : itorPC) {
auto cmd = genCmdCast<PIPE_CONTROL *>(*it);
if (cmd->getPostSyncOperation() == POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA) {
EXPECT_NE(cmd->getImmediateData(), Event::STATE_CLEARED);
EXPECT_TRUE(cmd->getCommandStreamerStallEnable());
EXPECT_EQ(MemorySynchronizationCommands<FamilyType>::getDcFlushEnable(true, device->getNEODevice()->getRootDeviceEnvironment()), cmd->getDcFlushEnable());
postSyncFound = true;
}
}
ASSERT_TRUE(postSyncFound);
auto itorBBEnd = find<MI_BATCH_BUFFER_END *>(itorBBStart, cmdList.end());
ASSERT_NE(cmdList.end(), itorBBEnd);
}
HWTEST2_F(CommandListAppendSignalEvent, givenImmediateCmdListWithComputeQueueAndAppendingRegularCommandlistThenCsrMakeNonTesidentSkippedFromCmdQueue, IsAtLeastXeHpcCore) { HWTEST2_F(CommandListAppendSignalEvent, givenImmediateCmdListWithComputeQueueAndAppendingRegularCommandlistThenCsrMakeNonTesidentSkippedFromCmdQueue, IsAtLeastXeHpcCore) {
ze_command_queue_desc_t desc = {}; ze_command_queue_desc_t desc = {};
desc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS; desc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
@@ -329,6 +254,7 @@ HWTEST2_F(CommandListAppendSignalEvent, givenImmediateCmdListWithComputeQueueAnd
HWTEST2_F(CommandListAppendSignalEvent, givenCopyOnlyImmediateCmdListAndAppendingRegularCommandlistWithWaitOnEventsAndSignalEventThenUseSemaphoreAndFlushDw, IsAtLeastXeHpcCore) { HWTEST2_F(CommandListAppendSignalEvent, givenCopyOnlyImmediateCmdListAndAppendingRegularCommandlistWithWaitOnEventsAndSignalEventThenUseSemaphoreAndFlushDw, IsAtLeastXeHpcCore) {
using MI_SEMAPHORE_WAIT = typename FamilyType::MI_SEMAPHORE_WAIT; using MI_SEMAPHORE_WAIT = typename FamilyType::MI_SEMAPHORE_WAIT;
using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START;
using MI_FLUSH_DW = typename FamilyType::MI_FLUSH_DW; using MI_FLUSH_DW = typename FamilyType::MI_FLUSH_DW;
ze_event_pool_desc_t eventPoolDesc = {}; ze_event_pool_desc_t eventPoolDesc = {};
@@ -357,10 +283,6 @@ HWTEST2_F(CommandListAppendSignalEvent, givenCopyOnlyImmediateCmdListAndAppendin
ze_event_handle_t hSignalEventHandle = eventHostVisible->toHandle(); ze_event_handle_t hSignalEventHandle = eventHostVisible->toHandle();
ze_event_handle_t hWaitEventHandle = waitEvent->toHandle(); ze_event_handle_t hWaitEventHandle = waitEvent->toHandle();
std::unique_ptr<L0::CommandList> commandListRegular(CommandList::create(productFamily, device, NEO::EngineGroupType::copy, 0u, returnValue, false)); std::unique_ptr<L0::CommandList> commandListRegular(CommandList::create(productFamily, device, NEO::EngineGroupType::copy, 0u, returnValue, false));
void *srcPtr = reinterpret_cast<void *>(0x1234);
void *dstPtr = reinterpret_cast<void *>(0x2345);
CmdListMemoryCopyParams copyParams = {};
commandListRegular->appendMemoryCopy(dstPtr, srcPtr, 8, nullptr, 0, nullptr, copyParams);
commandListRegular->close(); commandListRegular->close();
auto commandListHandle = commandListRegular->toHandle(); auto commandListHandle = commandListRegular->toHandle();
auto usedSpaceBefore = immCommandList->getCmdContainer().getCommandStream()->getUsed(); auto usedSpaceBefore = immCommandList->getCmdContainer().getCommandStream()->getUsed();
@@ -379,6 +301,9 @@ HWTEST2_F(CommandListAppendSignalEvent, givenCopyOnlyImmediateCmdListAndAppendin
auto itorSemaphore = find<MI_SEMAPHORE_WAIT *>(cmdList.begin(), cmdList.end()); auto itorSemaphore = find<MI_SEMAPHORE_WAIT *>(cmdList.begin(), cmdList.end());
ASSERT_NE(cmdList.end(), itorSemaphore); ASSERT_NE(cmdList.end(), itorSemaphore);
auto itorBBStart = find<MI_BATCH_BUFFER_START *>(itorSemaphore, cmdList.end());
ASSERT_NE(cmdList.end(), itorBBStart);
uint32_t expectedMiFlushCount = 1; uint32_t expectedMiFlushCount = 1;
NEO::EncodeDummyBlitWaArgs waArgs{false, &(device->getNEODevice()->getRootDeviceEnvironmentRef())}; NEO::EncodeDummyBlitWaArgs waArgs{false, &(device->getNEODevice()->getRootDeviceEnvironmentRef())};
if (MockEncodeMiFlushDW<FamilyType>::getWaSize(waArgs) > 0) { if (MockEncodeMiFlushDW<FamilyType>::getWaSize(waArgs) > 0) {
@@ -391,7 +316,7 @@ HWTEST2_F(CommandListAppendSignalEvent, givenCopyOnlyImmediateCmdListAndAppendin
EXPECT_EQ(expectedMiFlushCount, static_cast<uint32_t>(itorMiFlush.size())); EXPECT_EQ(expectedMiFlushCount, static_cast<uint32_t>(itorMiFlush.size()));
} }
HWTEST2_F(CommandListAppendSignalEvent, givenImmediateCmdListWithCopyQueueAndAppendingRegularCommandlistThenCsrMakeNonResidentFromCmdQueue, IsAtMostXeHpgCore) { HWTEST2_F(CommandListAppendSignalEvent, givenImmediateCmdListWithCopyQueueAndAppendingRegularCommandlistThenCsrMakeNonTesidentSkippedFromCmdQueue, IsAtLeastXeHpcCore) {
ze_command_queue_desc_t desc = {}; ze_command_queue_desc_t desc = {};
desc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS; desc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
@@ -403,21 +328,22 @@ HWTEST2_F(CommandListAppendSignalEvent, givenImmediateCmdListWithCopyQueueAndApp
device, device,
&desc, &desc,
false, false,
NEO::EngineGroupType::compute, NEO::EngineGroupType::copy,
returnValue))); returnValue)));
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue); EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
ASSERT_NE(nullptr, commandList0); ASSERT_NE(nullptr, commandList0);
auto &commandStreamReceiver = neoDevice->getUltCommandStreamReceiver<FamilyType>(); auto &commandStreamReceiver = neoDevice->getUltCommandStreamReceiver<FamilyType>();
auto heaplessStateInit = commandStreamReceiver.heaplessStateInitialized;
std::unique_ptr<L0::CommandList> commandListRegular(CommandList::create(productFamily, device, NEO::EngineGroupType::compute, 0u, returnValue, false)); std::unique_ptr<L0::CommandList> commandListRegular(CommandList::create(productFamily, device, NEO::EngineGroupType::copy, 0u, returnValue, false));
commandListRegular->close(); commandListRegular->close();
auto commandListHandle = commandListRegular->toHandle(); auto commandListHandle = commandListRegular->toHandle();
ze_result_t result = ZE_RESULT_SUCCESS; ze_result_t result = ZE_RESULT_SUCCESS;
result = commandList0->appendCommandLists(1u, &commandListHandle, nullptr, 0u, nullptr); result = commandList0->appendCommandLists(1u, &commandListHandle, nullptr, 0u, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(1u, commandStreamReceiver.makeSurfacePackNonResidentCalled); EXPECT_EQ(heaplessStateInit ? 2u : 1u, commandStreamReceiver.makeSurfacePackNonResidentCalled);
} }
HWTEST2_F(CommandListAppendSignalEvent, givenTimestampEventUsedInSignalThenPipeControlAppendedCorrectly, MatchAny) { HWTEST2_F(CommandListAppendSignalEvent, givenTimestampEventUsedInSignalThenPipeControlAppendedCorrectly, MatchAny) {
@@ -738,7 +664,7 @@ HWTEST2_F(CommandListAppendUsedPacketSignalEvent,
event->signalScope = ZE_EVENT_SCOPE_FLAG_HOST; event->signalScope = ZE_EVENT_SCOPE_FLAG_HOST;
commandList->partitionCount = packets; commandList->partitionCount = packets;
commandList->checkAvailableSpace(0, false, commonImmediateCommandSize, false); commandList->checkAvailableSpace(0, false, commonImmediateCommandSize);
commandList->appendSignalEventPostWalker(event.get(), nullptr, nullptr, false, false, false); commandList->appendSignalEventPostWalker(event.get(), nullptr, nullptr, false, false, false);
EXPECT_EQ(packets, event->getPacketsInUse()); EXPECT_EQ(packets, event->getPacketsInUse());

View File

@@ -202,6 +202,7 @@ HWTEST2_F(CommandListAppendWaitOnEvent, givenImmediateCmdListWithDirectSubmissio
HWTEST2_F(CommandListAppendWaitOnEvent, givenImmediateCmdListAndAppendingRegularCommandlistWithWaitOnEventsThenUseSemaphore, IsAtLeastXeHpcCore) { HWTEST2_F(CommandListAppendWaitOnEvent, givenImmediateCmdListAndAppendingRegularCommandlistWithWaitOnEventsThenUseSemaphore, IsAtLeastXeHpcCore) {
using MI_SEMAPHORE_WAIT = typename FamilyType::MI_SEMAPHORE_WAIT; using MI_SEMAPHORE_WAIT = typename FamilyType::MI_SEMAPHORE_WAIT;
using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START;
ze_command_queue_desc_t desc = {}; ze_command_queue_desc_t desc = {};
desc.mode = ZE_COMMAND_QUEUE_MODE_SYNCHRONOUS; desc.mode = ZE_COMMAND_QUEUE_MODE_SYNCHRONOUS;
@@ -211,10 +212,6 @@ HWTEST2_F(CommandListAppendWaitOnEvent, givenImmediateCmdListAndAppendingRegular
ze_event_handle_t hEventHandle = event->toHandle(); ze_event_handle_t hEventHandle = event->toHandle();
std::unique_ptr<L0::CommandList> commandListRegular(CommandList::create(productFamily, device, NEO::EngineGroupType::compute, 0u, returnValue, false)); std::unique_ptr<L0::CommandList> commandListRegular(CommandList::create(productFamily, device, NEO::EngineGroupType::compute, 0u, returnValue, false));
void *srcPtr = reinterpret_cast<void *>(0x1234);
void *dstPtr = reinterpret_cast<void *>(0x2345);
CmdListMemoryCopyParams copyParams = {};
commandListRegular->appendMemoryCopy(dstPtr, srcPtr, 8, nullptr, 0, nullptr, copyParams);
commandListRegular->close(); commandListRegular->close();
auto commandListHandle = commandListRegular->toHandle(); auto commandListHandle = commandListRegular->toHandle();
auto result = immCommandList->appendCommandLists(1u, &commandListHandle, nullptr, 1u, &hEventHandle); auto result = immCommandList->appendCommandLists(1u, &commandListHandle, nullptr, 1u, &hEventHandle);
@@ -230,6 +227,9 @@ HWTEST2_F(CommandListAppendWaitOnEvent, givenImmediateCmdListAndAppendingRegular
auto itor = find<MI_SEMAPHORE_WAIT *>(cmdList.begin(), cmdList.end()); auto itor = find<MI_SEMAPHORE_WAIT *>(cmdList.begin(), cmdList.end());
ASSERT_NE(cmdList.end(), itor); ASSERT_NE(cmdList.end(), itor);
auto itorBBStart = find<MI_BATCH_BUFFER_START *>(itor, cmdList.end());
ASSERT_NE(cmdList.end(), itorBBStart);
} }
template <GFXCORE_FAMILY gfxCoreFamily> template <GFXCORE_FAMILY gfxCoreFamily>

View File

@@ -540,6 +540,48 @@ HWTEST_F(CommandQueueCreate, givenUpdateTaskCountFromWaitAndRegularCmdListWhenDi
commandQueue->destroy(); commandQueue->destroy();
} }
HWTEST_F(CommandQueueCreate, givenUpdateTaskCountFromWaitAndImmediateCmdListWhenDispatchTaskCountWriteThenNoPipeControlFlushed) {
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
using POST_SYNC_OPERATION = typename FamilyType::PIPE_CONTROL::POST_SYNC_OPERATION;
DebugManagerStateRestore restorer;
debugManager.flags.UpdateTaskCountFromWait.set(3);
const ze_command_queue_desc_t desc = {};
ze_result_t returnValue;
auto commandQueue = whiteboxCast(CommandQueue::create(productFamily,
device,
neoDevice->getDefaultEngine().commandStreamReceiver,
&desc,
false,
false,
true,
returnValue));
auto commandList = CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::renderCompute, returnValue);
ASSERT_NE(nullptr, commandList);
ze_command_list_handle_t cmdListHandle = commandList->toHandle();
commandQueue->executeCommandLists(1, &cmdListHandle, nullptr, false, nullptr);
GenCmdList cmdList;
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), commandQueue->commandStream.getUsed()));
auto pipeControls = findAll<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
bool pipeControlsPostSync = false;
for (size_t i = 0; i < pipeControls.size(); i++) {
auto pipeControl = reinterpret_cast<PIPE_CONTROL *>(*pipeControls[i]);
if (pipeControl->getPostSyncOperation() == POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA) {
pipeControlsPostSync = true;
}
}
EXPECT_FALSE(pipeControlsPostSync);
commandList->destroy();
commandQueue->destroy();
}
HWTEST_F(CommandQueueCreate, givenContainerWithAllocationsWhenResidencyContainerIsEmptyThenMakeResidentWasNotCalled) { HWTEST_F(CommandQueueCreate, givenContainerWithAllocationsWhenResidencyContainerIsEmptyThenMakeResidentWasNotCalled) {
auto csr = std::make_unique<MockCommandStreamReceiver>(*neoDevice->getExecutionEnvironment(), 0, neoDevice->getDeviceBitfield()); auto csr = std::make_unique<MockCommandStreamReceiver>(*neoDevice->getExecutionEnvironment(), 0, neoDevice->getDeviceBitfield());
csr->setupContext(*neoDevice->getDefaultEngine().osContext); csr->setupContext(*neoDevice->getDefaultEngine().osContext);

View File

@@ -89,8 +89,6 @@ class CommandContainer : public NonCopyableOrMovableClass {
LinearStream *getCommandStream() { return commandStream.get(); } LinearStream *getCommandStream() { return commandStream.get(); }
bool usingSecondaryCmdbufInHostMem() { return useSecondaryCommandStream; }
IndirectHeap *getIndirectHeap(HeapType heapType); IndirectHeap *getIndirectHeap(HeapType heapType);
HeapHelper *getHeapHelper() { return heapHelper.get(); } HeapHelper *getHeapHelper() { return heapHelper.get(); }
@@ -121,7 +119,7 @@ class CommandContainer : public NonCopyableOrMovableClass {
GraphicsAllocation *obtainNextCommandBufferAllocation(); GraphicsAllocation *obtainNextCommandBufferAllocation();
GraphicsAllocation *obtainNextCommandBufferAllocation(bool forceHostMemory); GraphicsAllocation *obtainNextCommandBufferAllocation(bool forceHostMemory);
MOCKABLE_VIRTUAL bool swapStreams(); bool swapStreams();
void reset(); void reset();

View File

@@ -308,8 +308,6 @@ DECLARE_DEBUG_VARIABLE(int32_t, DebugUmdMaxReadWriteRetry, -1, "-1: default , >
DECLARE_DEBUG_VARIABLE(int32_t, ForceIndirectDetectionForCMKernels, -1, "-1: default , 0 : disable indirect detection for CM kernels, 1 : enable indirect detection for CM kernels") DECLARE_DEBUG_VARIABLE(int32_t, ForceIndirectDetectionForCMKernels, -1, "-1: default , 0 : disable indirect detection for CM kernels, 1 : enable indirect detection for CM kernels")
DECLARE_DEBUG_VARIABLE(int32_t, PipelinedEuThreadArbitration, -1, "-1: default. 1: Use Walker field, 0: Use StateComputeMode command to program pipelinedEuThreadArbitration") DECLARE_DEBUG_VARIABLE(int32_t, PipelinedEuThreadArbitration, -1, "-1: default. 1: Use Walker field, 0: Use StateComputeMode command to program pipelinedEuThreadArbitration")
DECLARE_DEBUG_VARIABLE(bool, ForceUseOnlyGlobalTimestamps, 0, "0- default disabled, 1: enable use only global timestamp") DECLARE_DEBUG_VARIABLE(bool, ForceUseOnlyGlobalTimestamps, 0, "0- default disabled, 1: enable use only global timestamp")
DECLARE_DEBUG_VARIABLE(int32_t, ForceParentCommandStreamUsageForImmediateAppendForCopyEngine, -1, "-1 - default (disabled), 0: disable, 1: enable")
DECLARE_DEBUG_VARIABLE(int32_t, ForceParentCommandStreamUsageForImmediateAppendForComputeEngine, -1, "-1 - default (enabled), 0: disable, 1: enable")
/*LOGGING FLAGS*/ /*LOGGING FLAGS*/
DECLARE_DEBUG_VARIABLE(int32_t, PrintDriverDiagnostics, -1, "prints driver diagnostics messages to standard output, value corresponds to hint level") DECLARE_DEBUG_VARIABLE(int32_t, PrintDriverDiagnostics, -1, "prints driver diagnostics messages to standard output, value corresponds to hint level")

View File

@@ -665,6 +665,4 @@ PipelinedEuThreadArbitration = -1
ExperimentalUSMAllocationReuseCleaner = -1 ExperimentalUSMAllocationReuseCleaner = -1
DummyPageBackingEnabled = 0 DummyPageBackingEnabled = 0
EnableDeferBacking = 0 EnableDeferBacking = 0
ForceParentCommandStreamUsageForImmediateAppendForCopyEngine = -1
ForceParentCommandStreamUsageForImmediateAppendForComputeEngine = -1
# Please don't edit below this line # Please don't edit below this line

View File

@@ -98,25 +98,6 @@ TEST_F(CommandContainerHeapStateTests, givenDirtyHeapsWhenSettingStateForSingleH
} }
} }
using CommandContainerSwapStreamTest = Test<CommandContainerFixture>;
TEST_F(CommandContainerSwapStreamTest, givenCommandContainerInitializedWithSecondaryCmdBufferAndForceSwapStreamsReturnsFalseThenCallIsUnsuccessful) {
class MyMockCommandContainer : public CommandContainer {
public:
bool swapStreams() override {
swapStreamsCalled++;
return forceSwapAction;
}
uint32_t swapStreamsCalled = 0u;
bool forceSwapAction = false;
};
MyMockCommandContainer cmdContainer;
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, true);
EXPECT_FALSE(cmdContainer.swapStreams());
}
TEST_F(CommandContainerTest, givenCmdContainerWhenCreatingCommandBufferThenCorrectAllocationTypeIsSet) { TEST_F(CommandContainerTest, givenCmdContainerWhenCreatingCommandBufferThenCorrectAllocationTypeIsSet) {
CommandContainer cmdContainer; CommandContainer cmdContainer;
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
@@ -145,22 +126,6 @@ TEST_F(CommandContainerTest, givenCreateSecondaryCmdBufferInHostMemWhenInitializ
EXPECT_EQ(cmdContainer.secondaryCommandStreamForImmediateCmdList.get(), cmdStream); EXPECT_EQ(cmdContainer.secondaryCommandStreamForImmediateCmdList.get(), cmdStream);
} }
TEST_F(CommandContainerTest, givenCreateSecondaryCmdBufferInHostMemWhenInitializeThenCreateAdditionalLinearStreamAndReturnAccordingly) {
MyMockCommandContainer cmdContainer;
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, true);
EXPECT_NE(cmdContainer.secondaryCommandStreamForImmediateCmdList.get(), nullptr);
auto secondaryCmdStream = cmdContainer.secondaryCommandStreamForImmediateCmdList.get();
auto cmdStream = cmdContainer.getCommandStream();
EXPECT_TRUE(cmdContainer.swapStreams());
EXPECT_TRUE(cmdContainer.usingSecondaryCmdbufInHostMem());
EXPECT_EQ(cmdContainer.getCommandStream(), secondaryCmdStream);
EXPECT_EQ(cmdContainer.secondaryCommandStreamForImmediateCmdList.get(), cmdStream);
}
TEST_F(CommandContainerTest, whenInitializeThenNotCreateAdditionalLinearStream) { TEST_F(CommandContainerTest, whenInitializeThenNotCreateAdditionalLinearStream) {
MyMockCommandContainer cmdContainer; MyMockCommandContainer cmdContainer;
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);