diff --git a/runtime/command_queue/dispatch_walker.h b/runtime/command_queue/dispatch_walker.h index 5541624893..387f3e5ef6 100644 --- a/runtime/command_queue/dispatch_walker.h +++ b/runtime/command_queue/dispatch_walker.h @@ -438,7 +438,7 @@ void dispatchWalker( unsigned int commandType = 0) { OCLRT::LinearStream *commandStream = nullptr; - OCLRT::IndirectHeap *dsh = nullptr, *ish = nullptr, *ioh = nullptr, *ssh = nullptr; + OCLRT::IndirectHeap *dsh = nullptr, *ioh = nullptr, *ssh = nullptr; bool executionModelKernel = multiDispatchInfo.begin()->getKernel()->isParentKernel; for (auto &dispatchInfo : multiDispatchInfo) { @@ -450,7 +450,6 @@ void dispatchWalker( } // Allocate command stream and indirect heaps - size_t cmdQInstructionHeapReservedBlockSize = 0; if (blockQueue) { using KCH = KernelCommandsHelper; commandStream = new LinearStream(alignedMalloc(MemoryConstants::pageSize, MemoryConstants::pageSize), MemoryConstants::pageSize); @@ -465,13 +464,10 @@ void dispatchWalker( dsh = allocateIndirectHeap([&multiDispatchInfo] { return KCH::getTotalSizeRequiredDSH(multiDispatchInfo); }); ioh = allocateIndirectHeap([&multiDispatchInfo] { return KCH::getTotalSizeRequiredIOH(multiDispatchInfo); }); } - ish = allocateIndirectHeap([&multiDispatchInfo] { return KCH::getTotalSizeRequiredIH(multiDispatchInfo); }); - cmdQInstructionHeapReservedBlockSize = commandQueue.getInstructionHeapReservedBlockSize(); ssh = allocateIndirectHeap([&multiDispatchInfo] { return KCH::getTotalSizeRequiredSSH(multiDispatchInfo); }); using UniqueIH = std::unique_ptr; - *blockedCommandsData = new KernelOperation(std::unique_ptr(commandStream), UniqueIH(dsh), - UniqueIH(ish), UniqueIH(ioh), UniqueIH(ssh)); + *blockedCommandsData = new KernelOperation(std::unique_ptr(commandStream), UniqueIH(dsh), UniqueIH(ioh), UniqueIH(ssh)); if (executionModelKernel) { (*blockedCommandsData)->doNotFreeISH = true; } @@ -481,7 +477,6 @@ void dispatchWalker( commandQueue.releaseIndirectHeap(IndirectHeap::SURFACE_STATE); } dsh = &getIndirectHeap(commandQueue, multiDispatchInfo); - ish = &getIndirectHeap(commandQueue, multiDispatchInfo); ioh = &getIndirectHeap(commandQueue, multiDispatchInfo); ssh = &getIndirectHeap(commandQueue, multiDispatchInfo); } @@ -680,13 +675,12 @@ void dispatchScheduler( using MI_BATCH_BUFFER_START = typename GfxFamily::MI_BATCH_BUFFER_START; OCLRT::LinearStream *commandStream = nullptr; - OCLRT::IndirectHeap *dsh = nullptr, *ish = nullptr, *ioh = nullptr, *ssh = nullptr; + OCLRT::IndirectHeap *dsh = nullptr, *ioh = nullptr, *ssh = nullptr; commandStream = &commandQueue.getCS(0); // note : below code assumes that caller to dispatchScheduler "preallocated" memory // required for execution model in below heap managers dsh = devQueueHw.getIndirectHeap(IndirectHeap::DYNAMIC_STATE); - ish = &commandQueue.getIndirectHeap(IndirectHeap::INSTRUCTION); ssh = &commandQueue.getIndirectHeap(IndirectHeap::SURFACE_STATE); bool dcFlush = false; @@ -919,14 +913,13 @@ IndirectHeap &getIndirectHeap(CommandQueue &commandQueue, const MultiDispatchInf // clang-format off switch(heapType) { case IndirectHeap::DYNAMIC_STATE: expectedSize = KernelCommandsHelper::getTotalSizeRequiredDSH(multiDispatchInfo); break; - case IndirectHeap::INSTRUCTION: expectedSize = KernelCommandsHelper::getTotalSizeRequiredIH( multiDispatchInfo); break; case IndirectHeap::INDIRECT_OBJECT: expectedSize = KernelCommandsHelper::getTotalSizeRequiredIOH(multiDispatchInfo); break; case IndirectHeap::SURFACE_STATE: expectedSize = KernelCommandsHelper::getTotalSizeRequiredSSH(multiDispatchInfo); break; } // clang-format on if (multiDispatchInfo.begin()->getKernel()->isParentKernel) { - if (heapType == IndirectHeap::INSTRUCTION || heapType == IndirectHeap::SURFACE_STATE) { + if (heapType == IndirectHeap::SURFACE_STATE) { expectedSize += KernelCommandsHelper::template getSizeRequiredForExecutionModel(const_cast(*(multiDispatchInfo.begin()->getKernel()))); } else //if (heapType == IndirectHeap::DYNAMIC_STATE || heapType == IndirectHeap::INDIRECT_OBJECT) { diff --git a/runtime/command_queue/enqueue_common.h b/runtime/command_queue/enqueue_common.h index b9b8a8b612..c271e08a2b 100644 --- a/runtime/command_queue/enqueue_common.h +++ b/runtime/command_queue/enqueue_common.h @@ -271,12 +271,10 @@ void CommandQueueHw::enqueueHandler(Surface **surfacesForResidency, CompletionStamp completionStamp; if (!blockQueue) { if (executionModelKernel) { - size_t minSizeISHForEM = KernelCommandsHelper::template getSizeRequiredForExecutionModel(const_cast(*(multiDispatchInfo.begin()->getKernel()))); size_t minSizeSSHForEM = KernelCommandsHelper::template getSizeRequiredForExecutionModel(const_cast(*(multiDispatchInfo.begin()->getKernel()))); uint32_t taskCount = commandStreamReceiver.peekTaskCount() + 1; - devQueueHw->setupExecutionModelDispatch(getIndirectHeap(IndirectHeap::INSTRUCTION, minSizeISHForEM), - getIndirectHeap(IndirectHeap::SURFACE_STATE, minSizeSSHForEM), + devQueueHw->setupExecutionModelDispatch(getIndirectHeap(IndirectHeap::SURFACE_STATE, minSizeSSHForEM), multiDispatchInfo.begin()->getKernel(), (uint32_t)multiDispatchInfo.size(), taskCount, @@ -385,9 +383,7 @@ void CommandQueueHw::enqueueHandler(Surface **surfacesForResidency, if (blockQueue) { if (executionModelKernel) { - size_t minSizeISHForEM = KernelCommandsHelper::template getSizeRequiredForExecutionModel(const_cast(*(multiDispatchInfo.begin()->getKernel()))); size_t minSizeSSHForEM = KernelCommandsHelper::template getSizeRequiredForExecutionModel(const_cast(*(multiDispatchInfo.begin()->getKernel()))); - blockedCommandsData->instructionHeapSizeEM = minSizeISHForEM; blockedCommandsData->surfaceStateHeapSizeEM = minSizeSSHForEM; } diff --git a/runtime/device_queue/device_queue.cpp b/runtime/device_queue/device_queue.cpp index 32cd53bdd9..a821bc9960 100644 --- a/runtime/device_queue/device_queue.cpp +++ b/runtime/device_queue/device_queue.cpp @@ -156,12 +156,12 @@ void DeviceQueue::initDeviceQueue() { igilEventPool->m_size = caps.maxOnDeviceEvents; } -void DeviceQueue::setupExecutionModelDispatch(IndirectHeap &instructionHeap, IndirectHeap &surfaceStateHeap, Kernel *parentKernel, uint32_t parentCount, uint32_t taskCount, HwTimeStamps *hwTimeStamp) { - setupIndirectState(instructionHeap, surfaceStateHeap, parentKernel, parentCount); +void DeviceQueue::setupExecutionModelDispatch(IndirectHeap &surfaceStateHeap, Kernel *parentKernel, uint32_t parentCount, uint32_t taskCount, HwTimeStamps *hwTimeStamp) { + setupIndirectState(surfaceStateHeap, parentKernel, parentCount); addExecutionModelCleanUpSection(parentKernel, hwTimeStamp, taskCount); } -void DeviceQueue::setupIndirectState(IndirectHeap &instructionHeap, IndirectHeap &surfaceStateHeap, Kernel *parentKernel, uint32_t parentIDCount) { +void DeviceQueue::setupIndirectState(IndirectHeap &surfaceStateHeap, Kernel *parentKernel, uint32_t parentIDCount) { return; } diff --git a/runtime/device_queue/device_queue.h b/runtime/device_queue/device_queue.h index 39c136f968..b1a299013e 100644 --- a/runtime/device_queue/device_queue.h +++ b/runtime/device_queue/device_queue.h @@ -81,9 +81,9 @@ class DeviceQueue : public BaseObject<_device_queue> { size_t paramValueSize, void *paramValue, size_t *paramValueSizeRet); - void setupExecutionModelDispatch(IndirectHeap &instructionHeap, IndirectHeap &surfaceStateHeap, Kernel *parentKernel, uint32_t parentCount, uint32_t taskCount, HwTimeStamps *hwTimeStamp); + void setupExecutionModelDispatch(IndirectHeap &surfaceStateHeap, Kernel *parentKernel, uint32_t parentCount, uint32_t taskCount, HwTimeStamps *hwTimeStamp); - virtual void setupIndirectState(IndirectHeap &instructionHeap, IndirectHeap &surfaceStateHeap, Kernel *parentKernel, uint32_t parentIDCount); + virtual void setupIndirectState(IndirectHeap &surfaceStateHeap, Kernel *parentKernel, uint32_t parentIDCount); virtual void addExecutionModelCleanUpSection(Kernel *parentKernel, HwTimeStamps *hwTimeStamp, uint32_t taskCount); MOCKABLE_VIRTUAL bool isEMCriticalSectionFree() { diff --git a/runtime/device_queue/device_queue_hw.h b/runtime/device_queue/device_queue_hw.h index 911c488b95..3a72297cb4 100644 --- a/runtime/device_queue/device_queue_hw.h +++ b/runtime/device_queue/device_queue_hw.h @@ -72,7 +72,7 @@ class DeviceQueueHw : public DeviceQueue { size_t setSchedulerCrossThreadData(SchedulerKernel &scheduler); - void setupIndirectState(IndirectHeap &instructionHeap, IndirectHeap &surfaceStateHeap, Kernel *parentKernel, uint32_t parentIDCount) override; + void setupIndirectState(IndirectHeap &surfaceStateHeap, Kernel *parentKernel, uint32_t parentIDCount) override; void addExecutionModelCleanUpSection(Kernel *parentKernel, HwTimeStamps *hwTimeStamp, uint32_t taskCount) override; void resetDeviceQueue() override; diff --git a/runtime/device_queue/device_queue_hw.inl b/runtime/device_queue/device_queue_hw.inl index dcb53325c7..5a0d953af9 100644 --- a/runtime/device_queue/device_queue_hw.inl +++ b/runtime/device_queue/device_queue_hw.inl @@ -291,7 +291,7 @@ IndirectHeap *DeviceQueueHw::getIndirectHeap(IndirectHeap::Type type) } template -void DeviceQueueHw::setupIndirectState(IndirectHeap &instructionHeap, IndirectHeap &surfaceStateHeap, Kernel *parentKernel, uint32_t parentIDCount) { +void DeviceQueueHw::setupIndirectState(IndirectHeap &surfaceStateHeap, Kernel *parentKernel, uint32_t parentIDCount) { void *pDSH = dshBuffer->getUnderlyingBuffer(); // Heap and dshBuffer shoud be the same if heap is created diff --git a/runtime/helpers/kernel_commands.h b/runtime/helpers/kernel_commands.h index 46bd8201c2..4cd59a5650 100644 --- a/runtime/helpers/kernel_commands.h +++ b/runtime/helpers/kernel_commands.h @@ -105,8 +105,6 @@ struct KernelCommandsHelper : public PerThreadDataHelper { static bool isPipeControlWArequired(); static size_t getSizeRequiredDSH( const Kernel &kernel); - static size_t getSizeRequiredIH( - const Kernel &kernel); static size_t getSizeRequiredIOH( const Kernel &kernel, size_t localWorkSize = 256); @@ -115,8 +113,6 @@ struct KernelCommandsHelper : public PerThreadDataHelper { static size_t getTotalSizeRequiredDSH( const MultiDispatchInfo &multiDispatchInfo); - static size_t getTotalSizeRequiredIH( - const MultiDispatchInfo &multiDispatchInfo); static size_t getTotalSizeRequiredIOH( const MultiDispatchInfo &multiDispatchInfo); static size_t getTotalSizeRequiredSSH( @@ -127,46 +123,33 @@ struct KernelCommandsHelper : public PerThreadDataHelper { typedef typename GfxFamily::BINDING_TABLE_STATE BINDING_TABLE_STATE; size_t totalSize = 0; - if (kernel.isParentKernel) { - BlockKernelManager *blockManager = kernel.getProgram()->getBlockKernelManager(); - uint32_t blockCount = static_cast(blockManager->getCount()); - uint32_t maxBindingTableCount = 0; + BlockKernelManager *blockManager = kernel.getProgram()->getBlockKernelManager(); + uint32_t blockCount = static_cast(blockManager->getCount()); + uint32_t maxBindingTableCount = 0; - if (heapType == IndirectHeap::SURFACE_STATE || heapType == IndirectHeap::INSTRUCTION) { - if (heapType == IndirectHeap::SURFACE_STATE) { - totalSize = BINDING_TABLE_STATE::SURFACESTATEPOINTER_ALIGN_SIZE - 1; - } else { - totalSize = Kernel::kernelBinaryAlignement - 1; - } + if (heapType == IndirectHeap::SURFACE_STATE) { + totalSize = BINDING_TABLE_STATE::SURFACESTATEPOINTER_ALIGN_SIZE - 1; - for (uint32_t i = 0; i < blockCount; i++) { - const KernelInfo *pBlockInfo = blockManager->getBlockKernelInfo(i); - if (heapType == IndirectHeap::SURFACE_STATE) { - totalSize += pBlockInfo->heapInfo.pKernelHeader->SurfaceStateHeapSize; - totalSize = alignUp(totalSize, BINDING_TABLE_STATE::SURFACESTATEPOINTER_ALIGN_SIZE); + for (uint32_t i = 0; i < blockCount; i++) { + const KernelInfo *pBlockInfo = blockManager->getBlockKernelInfo(i); + totalSize += pBlockInfo->heapInfo.pKernelHeader->SurfaceStateHeapSize; + totalSize = alignUp(totalSize, BINDING_TABLE_STATE::SURFACESTATEPOINTER_ALIGN_SIZE); - maxBindingTableCount = std::max(maxBindingTableCount, pBlockInfo->patchInfo.bindingTableState->Count); - } else { - totalSize += pBlockInfo->heapInfo.pKernelHeader->KernelHeapSize; - totalSize = alignUp(totalSize, Kernel::kernelBinaryAlignement); - } - } + maxBindingTableCount = std::max(maxBindingTableCount, pBlockInfo->patchInfo.bindingTableState->Count); } + } - if (heapType == IndirectHeap::INSTRUCTION || heapType == IndirectHeap::INDIRECT_OBJECT || heapType == IndirectHeap::SURFACE_STATE) { - BuiltIns &builtIns = BuiltIns::getInstance(); - SchedulerKernel &scheduler = builtIns.getSchedulerKernel(kernel.getContext()); + if (heapType == IndirectHeap::INDIRECT_OBJECT || heapType == IndirectHeap::SURFACE_STATE) { + BuiltIns &builtIns = BuiltIns::getInstance(); + SchedulerKernel &scheduler = builtIns.getSchedulerKernel(kernel.getContext()); - if (heapType == IndirectHeap::INSTRUCTION) { - totalSize += getSizeRequiredIH(scheduler); - } else if (heapType == IndirectHeap::INDIRECT_OBJECT) { - totalSize += getSizeRequiredIOH(scheduler); - } else { - totalSize += getSizeRequiredSSH(scheduler); + if (heapType == IndirectHeap::INDIRECT_OBJECT) { + totalSize += getSizeRequiredIOH(scheduler); + } else { + totalSize += getSizeRequiredSSH(scheduler); - totalSize += maxBindingTableCount * sizeof(BINDING_TABLE_STATE) * DeviceQueue::interfaceDescriptorEntries; - totalSize = alignUp(totalSize, BINDING_TABLE_STATE::SURFACESTATEPOINTER_ALIGN_SIZE); - } + totalSize += maxBindingTableCount * sizeof(BINDING_TABLE_STATE) * DeviceQueue::interfaceDescriptorEntries; + totalSize = alignUp(totalSize, BINDING_TABLE_STATE::SURFACESTATEPOINTER_ALIGN_SIZE); } } return totalSize; diff --git a/runtime/helpers/kernel_commands.inl b/runtime/helpers/kernel_commands.inl index 5899bb8150..29a40d109e 100644 --- a/runtime/helpers/kernel_commands.inl +++ b/runtime/helpers/kernel_commands.inl @@ -93,13 +93,6 @@ size_t KernelCommandsHelper::getSizeRequiredIOH( GPGPU_WALKER::INDIRECTDATASTARTADDRESS_ALIGN_SIZE); } -template -size_t KernelCommandsHelper::getSizeRequiredIH( - const Kernel &kernel) { - typedef typename GfxFamily::INTERFACE_DESCRIPTOR_DATA INTERFACE_DESCRIPTOR_DATA; - return kernel.getKernelHeapSize() + INTERFACE_DESCRIPTOR_DATA::KERNELSTARTPOINTER_ALIGN_SIZE; -} - template size_t KernelCommandsHelper::getSizeRequiredSSH( const Kernel &kernel) { @@ -126,12 +119,6 @@ size_t KernelCommandsHelper::getTotalSizeRequiredDSH( return getSizeRequired(multiDispatchInfo, [](const DispatchInfo &dispatchInfo) { return getSizeRequiredDSH(*dispatchInfo.getKernel()); }); } -template -size_t KernelCommandsHelper::getTotalSizeRequiredIH( - const MultiDispatchInfo &multiDispatchInfo) { - return getSizeRequired(multiDispatchInfo, [](const DispatchInfo &dispatchInfo) { return getSizeRequiredIH(*dispatchInfo.getKernel()); }); -} - template size_t KernelCommandsHelper::getTotalSizeRequiredIOH( const MultiDispatchInfo &multiDispatchInfo) { diff --git a/runtime/helpers/task_information.cpp b/runtime/helpers/task_information.cpp index 11b3697ecb..d8148b1ca9 100644 --- a/runtime/helpers/task_information.cpp +++ b/runtime/helpers/task_information.cpp @@ -36,7 +36,6 @@ namespace OCLRT { KernelOperation::~KernelOperation() { alignedFree(dsh->getCpuBase()); - alignedFree(ish->getCpuBase()); if (doNotFreeISH) { ioh.release(); } else { @@ -165,7 +164,6 @@ CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminate memcpy_s(pDst, commandsSize, commandStream.getCpuBase(), commandsSize); size_t requestedDshSize = kernelOperation->dsh->getUsed(); - size_t requestedIshSize = kernelOperation->ish->getUsed() + kernelOperation->instructionHeapSizeEM; size_t requestedIohSize = kernelOperation->ioh->getUsed(); size_t requestedSshSize = kernelOperation->ssh->getUsed() + kernelOperation->surfaceStateHeapSizeEM; @@ -180,10 +178,6 @@ CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminate } } - if (commandQueue.getIndirectHeap(IndirectHeap::INSTRUCTION, 0).getUsed() > commandQueue.getInstructionHeapReservedBlockSize()) { - commandQueue.releaseIndirectHeap(IndirectHeap::INSTRUCTION); - } - if (executionModelKernel) { dsh = devQueue->getIndirectHeap(IndirectHeap::DYNAMIC_STATE); // In ExecutionModel IOH is the same as DSH to eliminate StateBaseAddress reprogramming for scheduler kernel and blocks. @@ -202,12 +196,8 @@ CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminate ioh->getSpace(requestedIohSize); } - IndirectHeap &ish = commandQueue.getIndirectHeap(IndirectHeap::INSTRUCTION, requestedIshSize); IndirectHeap &ssh = commandQueue.getIndirectHeap(IndirectHeap::SURFACE_STATE, requestedSshSize); - memcpy_s(ptrOffset(ish.getCpuBase(), commandQueue.getInstructionHeapReservedBlockSize()), requestedIshSize, kernelOperation->ish->getCpuBase(), kernelOperation->ish->getUsed()); - ish.getSpace(kernelOperation->ish->getUsed()); - memcpy_s(ssh.getCpuBase(), requestedSshSize, kernelOperation->ssh->getCpuBase(), kernelOperation->ssh->getUsed()); ssh.getSpace(kernelOperation->ssh->getUsed()); @@ -224,7 +214,7 @@ CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminate if (executionModelKernel) { uint32_t taskCount = commandStreamReceiver.peekTaskCount() + 1; - devQueue->setupExecutionModelDispatch(ish, ssh, kernel, kernelCount, taskCount, timestamp); + devQueue->setupExecutionModelDispatch(ssh, kernel, kernelCount, taskCount, timestamp); BuiltIns &builtIns = BuiltIns::getInstance(); SchedulerKernel &scheduler = builtIns.getSchedulerKernel(commandQueue.getContext()); diff --git a/runtime/helpers/task_information.h b/runtime/helpers/task_information.h index 2b5cb13a62..6ce554d6dc 100644 --- a/runtime/helpers/task_information.h +++ b/runtime/helpers/task_information.h @@ -77,22 +77,19 @@ class CommandMapUnmap : public Command { }; struct KernelOperation { - KernelOperation(std::unique_ptr commandStream, std::unique_ptr dsh, std::unique_ptr ish, - std::unique_ptr ioh, std::unique_ptr ssh) + KernelOperation(std::unique_ptr commandStream, std::unique_ptr dsh, std::unique_ptr ioh, std::unique_ptr ssh) : commandStream(std::move(commandStream)), dsh(std::move(dsh)), - ish(std::move(ish)), ioh(std::move(ioh)), ssh(std::move(ssh)), - instructionHeapSizeEM(0), surfaceStateHeapSizeEM(0), doNotFreeISH(false) { + ioh(std::move(ioh)), ssh(std::move(ssh)), + surfaceStateHeapSizeEM(0), doNotFreeISH(false) { } ~KernelOperation(); std::unique_ptr commandStream; std::unique_ptr dsh; - std::unique_ptr ish; std::unique_ptr ioh; std::unique_ptr ssh; - size_t instructionHeapSizeEM; size_t surfaceStateHeapSizeEM; bool doNotFreeISH; }; diff --git a/unit_tests/command_queue/command_queue_hw_tests.cpp b/unit_tests/command_queue/command_queue_hw_tests.cpp index 21ff3eb697..3dcdfe3738 100644 --- a/unit_tests/command_queue/command_queue_hw_tests.cpp +++ b/unit_tests/command_queue/command_queue_hw_tests.cpp @@ -413,8 +413,7 @@ HWTEST_F(BlockedCommandQueueTest, givenCommandQueueWhichHasSomeUsedHeapsWhenBloc mockKernelWithInternals.kernelHeader.KernelHeapSize = sizeof(mockKernelWithInternals.kernelIsa); auto mockKernel = mockKernelWithInternals.mockKernel; - IndirectHeap::Type heaps[] = {IndirectHeap::INSTRUCTION, IndirectHeap::INDIRECT_OBJECT, - IndirectHeap::DYNAMIC_STATE, IndirectHeap::SURFACE_STATE}; + IndirectHeap::Type heaps[] = {IndirectHeap::INDIRECT_OBJECT, IndirectHeap::DYNAMIC_STATE, IndirectHeap::SURFACE_STATE}; size_t prealocatedHeapSize = 2 * 64 * KB; for (auto heapType : heaps) { @@ -428,14 +427,8 @@ HWTEST_F(BlockedCommandQueueTest, givenCommandQueueWhichHasSomeUsedHeapsWhenBloc DebugManager.flags.DisableResourceRecycling.set(false); std::set reusableHeaps; - for (unsigned int i = 0; i < 5; ++i) { + for (unsigned int i = 0; i < 4; ++i) { auto allocSize = prealocatedHeapSize; - - //make sure that one of those allocations is larger so ISH can be recycled. - if (i == 4) { - allocSize = optimalInstructionHeapSize; - } - void *mem = alignedMalloc(allocSize, 64); reusableHeaps.insert(mem); memset(mem, 0, allocSize); @@ -452,7 +445,6 @@ HWTEST_F(BlockedCommandQueueTest, givenCommandQueueWhichHasSomeUsedHeapsWhenBloc userEvent.setStatus(CL_COMPLETE); // make sure used heaps are from preallocated pool - EXPECT_NE(reusableHeaps.end(), reusableHeaps.find(pCmdQ->getIndirectHeap(IndirectHeap::INSTRUCTION, 0).getCpuBase())); EXPECT_NE(reusableHeaps.end(), reusableHeaps.find(pCmdQ->getIndirectHeap(IndirectHeap::INDIRECT_OBJECT, 0).getCpuBase())); EXPECT_NE(reusableHeaps.end(), reusableHeaps.find(pCmdQ->getIndirectHeap(IndirectHeap::DYNAMIC_STATE, 0).getCpuBase())); EXPECT_NE(reusableHeaps.end(), reusableHeaps.find(pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE, 0).getCpuBase())); @@ -479,8 +471,6 @@ HWTEST_F(BlockedCommandQueueTest, givenCommandQueueWhichHasSomeUsedHeapsWhenBloc } // expecting blocked command to be programmed indentically to a non-blocked counterpart - EXPECT_THAT(nonblockedCommandHeaps[static_cast(IndirectHeap::INSTRUCTION)], - testing::ContainerEq(blockedCommandHeaps[static_cast(IndirectHeap::INSTRUCTION)])); EXPECT_THAT(nonblockedCommandHeaps[static_cast(IndirectHeap::INDIRECT_OBJECT)], testing::ContainerEq(blockedCommandHeaps[static_cast(IndirectHeap::INDIRECT_OBJECT)])); EXPECT_THAT(nonblockedCommandHeaps[static_cast(IndirectHeap::DYNAMIC_STATE)], @@ -506,12 +496,10 @@ HWTEST_F(BlockedCommandQueueTest, givenCommandQueueWhichHasSomeUnusedHeapsWhenBl cl_event blockedEvent = &userEvent; - auto &ish = pCmdQ->getIndirectHeap(IndirectHeap::INSTRUCTION, 4096u); auto &ioh = pCmdQ->getIndirectHeap(IndirectHeap::INDIRECT_OBJECT, 4096u); auto &dsh = pCmdQ->getIndirectHeap(IndirectHeap::DYNAMIC_STATE, 4096u); auto &ssh = pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE, 4096u); - auto ishBase = ish.getCpuBase(); auto iohBase = ioh.getCpuBase(); auto dshBase = dsh.getCpuBase(); auto sshBase = ssh.getCpuBase(); @@ -519,7 +507,6 @@ HWTEST_F(BlockedCommandQueueTest, givenCommandQueueWhichHasSomeUnusedHeapsWhenBl pCmdQ->enqueueKernel(mockKernel, 1, &offset, &size, &size, 1, &blockedEvent, nullptr); userEvent.setStatus(CL_COMPLETE); - EXPECT_EQ(ishBase, ish.getCpuBase()); EXPECT_EQ(iohBase, ioh.getCpuBase()); EXPECT_EQ(dshBase, dsh.getCpuBase()); EXPECT_EQ(sshBase, ssh.getCpuBase()); diff --git a/unit_tests/command_queue/dispatch_walker_tests.cpp b/unit_tests/command_queue/dispatch_walker_tests.cpp index 57b4488d8c..4fbd591618 100644 --- a/unit_tests/command_queue/dispatch_walker_tests.cpp +++ b/unit_tests/command_queue/dispatch_walker_tests.cpp @@ -651,7 +651,6 @@ HWTEST_F(DispatchWalkerTest, dispatchWalkerDoesntConsumeCommandStreamWhenQueueIs EXPECT_NE(nullptr, blockedCommandsData); EXPECT_NE(nullptr, blockedCommandsData->commandStream); EXPECT_NE(nullptr, blockedCommandsData->dsh); - EXPECT_NE(nullptr, blockedCommandsData->ish); EXPECT_NE(nullptr, blockedCommandsData->ioh); EXPECT_NE(nullptr, blockedCommandsData->ssh); @@ -691,13 +690,11 @@ HWTEST_F(DispatchWalkerTest, dispatchWalkerShouldGetRequiredHeapSizesFromKernelW auto expectedSizeCS = MemoryConstants::pageSize; //can get estimated more precisely auto expectedSizeDSH = KernelCommandsHelper::getSizeRequiredDSH(kernel); - auto expectedSizeISH = KernelCommandsHelper::getSizeRequiredIH(kernel); auto expectedSizeIOH = KernelCommandsHelper::getSizeRequiredIOH(kernel, Math::computeTotalElementsCount(localWorkgroupSize)); auto expectedSizeSSH = KernelCommandsHelper::getSizeRequiredSSH(kernel); EXPECT_EQ(expectedSizeCS, blockedCommandsData->commandStream->getMaxAvailableSpace()); EXPECT_EQ(expectedSizeDSH, blockedCommandsData->dsh->getMaxAvailableSpace()); - EXPECT_EQ(expectedSizeISH, blockedCommandsData->ish->getMaxAvailableSpace()); EXPECT_EQ(expectedSizeIOH, blockedCommandsData->ioh->getMaxAvailableSpace()); EXPECT_EQ(expectedSizeSSH, blockedCommandsData->ssh->getMaxAvailableSpace()); @@ -728,13 +725,11 @@ HWTEST_F(DispatchWalkerTest, dispatchWalkerShouldGetRequiredHeapSizesFromMdiWhen auto expectedSizeCS = MemoryConstants::pageSize; //can get estimated more precisely auto expectedSizeDSH = KernelCommandsHelper::getTotalSizeRequiredDSH(multiDispatchInfo); - auto expectedSizeISH = KernelCommandsHelper::getTotalSizeRequiredIH(multiDispatchInfo); auto expectedSizeIOH = KernelCommandsHelper::getTotalSizeRequiredIOH(multiDispatchInfo); auto expectedSizeSSH = KernelCommandsHelper::getTotalSizeRequiredSSH(multiDispatchInfo); EXPECT_EQ(expectedSizeCS, blockedCommandsData->commandStream->getMaxAvailableSpace()); EXPECT_EQ(expectedSizeDSH, blockedCommandsData->dsh->getMaxAvailableSpace()); - EXPECT_EQ(expectedSizeISH, blockedCommandsData->ish->getMaxAvailableSpace()); EXPECT_EQ(expectedSizeIOH, blockedCommandsData->ioh->getMaxAvailableSpace()); EXPECT_EQ(expectedSizeSSH, blockedCommandsData->ssh->getMaxAvailableSpace()); diff --git a/unit_tests/command_queue/get_size_required_buffer_tests.cpp b/unit_tests/command_queue/get_size_required_buffer_tests.cpp index 1c4ad7c1d8..6d2fc822ec 100644 --- a/unit_tests/command_queue/get_size_required_buffer_tests.cpp +++ b/unit_tests/command_queue/get_size_required_buffer_tests.cpp @@ -84,11 +84,9 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueFillBuffer) { auto &commandStream = pCmdQ->getCS(); auto usedBeforeCS = commandStream.getUsed(); auto &dsh = pCmdQ->getIndirectHeap(IndirectHeap::DYNAMIC_STATE); - auto &ih = pCmdQ->getIndirectHeap(IndirectHeap::INSTRUCTION); auto &ioh = pCmdQ->getIndirectHeap(IndirectHeap::INDIRECT_OBJECT); auto &ssh = pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE); auto usedBeforeDSH = dsh.getUsed(); - auto usedBeforeIH = ih.getUsed(); auto usedBeforeIOH = ioh.getUsed(); auto usedBeforeSSH = ssh.getUsed(); @@ -112,13 +110,11 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueFillBuffer) { auto usedAfterCS = commandStream.getUsed(); auto usedAfterDSH = dsh.getUsed(); - auto usedAfterIH = ih.getUsed(); auto usedAfterIOH = ioh.getUsed(); auto usedAfterSSH = ssh.getUsed(); auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(false, false, *pCmdQ, multiDispatchInfo); auto expectedSizeDSH = KernelCommandsHelper::getTotalSizeRequiredDSH(multiDispatchInfo); - auto expectedSizeIH = KernelCommandsHelper::getTotalSizeRequiredIH(multiDispatchInfo); auto expectedSizeIOH = KernelCommandsHelper::getTotalSizeRequiredIOH(multiDispatchInfo); auto expectedSizeSSH = KernelCommandsHelper::getTotalSizeRequiredSSH(multiDispatchInfo); @@ -131,7 +127,6 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueFillBuffer) { EXPECT_EQ(expectedSizeCS, usedAfterCS - usedBeforeCS); EXPECT_GE(expectedSizeDSH, usedAfterDSH - usedBeforeDSH); - EXPECT_GE(expectedSizeIH, usedAfterIH - usedBeforeIH); EXPECT_GE(expectedSizeIOH, usedAfterIOH - usedBeforeIOH); EXPECT_GE(expectedSizeSSH, usedAfterSSH - usedBeforeSSH); } @@ -141,11 +136,9 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueCopyBuffer) { auto &commandStream = pCmdQ->getCS(); auto usedBeforeCS = commandStream.getUsed(); auto &dsh = pCmdQ->getIndirectHeap(IndirectHeap::DYNAMIC_STATE); - auto &ih = pCmdQ->getIndirectHeap(IndirectHeap::INSTRUCTION); auto &ioh = pCmdQ->getIndirectHeap(IndirectHeap::INDIRECT_OBJECT); auto &ssh = pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE); auto usedBeforeDSH = dsh.getUsed(); - auto usedBeforeIH = ih.getUsed(); auto usedBeforeIOH = ioh.getUsed(); auto usedBeforeSSH = ssh.getUsed(); @@ -168,13 +161,11 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueCopyBuffer) { auto usedAfterCS = commandStream.getUsed(); auto usedAfterDSH = dsh.getUsed(); - auto usedAfterIH = ih.getUsed(); auto usedAfterIOH = ioh.getUsed(); auto usedAfterSSH = ssh.getUsed(); auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(false, false, *pCmdQ, multiDispatchInfo); auto expectedSizeDSH = KernelCommandsHelper::getTotalSizeRequiredDSH(multiDispatchInfo); - auto expectedSizeIH = KernelCommandsHelper::getTotalSizeRequiredIH(multiDispatchInfo); auto expectedSizeIOH = KernelCommandsHelper::getTotalSizeRequiredIOH(multiDispatchInfo); auto expectedSizeSSH = KernelCommandsHelper::getTotalSizeRequiredSSH(multiDispatchInfo); @@ -187,7 +178,6 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueCopyBuffer) { EXPECT_EQ(expectedSizeCS, usedAfterCS - usedBeforeCS); EXPECT_GE(expectedSizeDSH, usedAfterDSH - usedBeforeDSH); - EXPECT_GE(expectedSizeIH, usedAfterIH - usedBeforeIH); EXPECT_GE(expectedSizeIOH, usedAfterIOH - usedBeforeIOH); EXPECT_GE(expectedSizeSSH, usedAfterSSH - usedBeforeSSH); } @@ -197,11 +187,9 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueReadBufferNonBlocking) { auto &commandStream = pCmdQ->getCS(); auto usedBeforeCS = commandStream.getUsed(); auto &dsh = pCmdQ->getIndirectHeap(IndirectHeap::DYNAMIC_STATE); - auto &ih = pCmdQ->getIndirectHeap(IndirectHeap::INSTRUCTION); auto &ioh = pCmdQ->getIndirectHeap(IndirectHeap::INDIRECT_OBJECT); auto &ssh = pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE); auto usedBeforeDSH = dsh.getUsed(); - auto usedBeforeIH = ih.getUsed(); auto usedBeforeIOH = ioh.getUsed(); auto usedBeforeSSH = ssh.getUsed(); @@ -225,13 +213,11 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueReadBufferNonBlocking) { auto usedAfterCS = commandStream.getUsed(); auto usedAfterDSH = dsh.getUsed(); - auto usedAfterIH = ih.getUsed(); auto usedAfterIOH = ioh.getUsed(); auto usedAfterSSH = ssh.getUsed(); auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(false, false, *pCmdQ, multiDispatchInfo); auto expectedSizeDSH = KernelCommandsHelper::getTotalSizeRequiredDSH(multiDispatchInfo); - auto expectedSizeIH = KernelCommandsHelper::getTotalSizeRequiredIH(multiDispatchInfo); auto expectedSizeIOH = KernelCommandsHelper::getTotalSizeRequiredIOH(multiDispatchInfo); auto expectedSizeSSH = KernelCommandsHelper::getTotalSizeRequiredSSH(multiDispatchInfo); @@ -244,7 +230,6 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueReadBufferNonBlocking) { EXPECT_EQ(expectedSizeCS, usedAfterCS - usedBeforeCS); EXPECT_GE(expectedSizeDSH, usedAfterDSH - usedBeforeDSH); - EXPECT_GE(expectedSizeIH, usedAfterIH - usedBeforeIH); EXPECT_GE(expectedSizeIOH, usedAfterIOH - usedBeforeIOH); EXPECT_GE(expectedSizeSSH, usedAfterSSH - usedBeforeSSH); } @@ -254,11 +239,9 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueReadBufferBlocking) { auto &commandStream = pCmdQ->getCS(); auto usedBeforeCS = commandStream.getUsed(); auto &dsh = pCmdQ->getIndirectHeap(IndirectHeap::DYNAMIC_STATE); - auto &ih = pCmdQ->getIndirectHeap(IndirectHeap::INSTRUCTION); auto &ioh = pCmdQ->getIndirectHeap(IndirectHeap::INDIRECT_OBJECT); auto &ssh = pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE); auto usedBeforeDSH = dsh.getUsed(); - auto usedBeforeIH = ih.getUsed(); auto usedBeforeIOH = ioh.getUsed(); auto usedBeforeSSH = ssh.getUsed(); @@ -283,13 +266,11 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueReadBufferBlocking) { auto usedAfterCS = commandStream.getUsed(); auto usedAfterDSH = dsh.getUsed(); - auto usedAfterIH = ih.getUsed(); auto usedAfterIOH = ioh.getUsed(); auto usedAfterSSH = ssh.getUsed(); auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(false, false, *pCmdQ, multiDispatchInfo); auto expectedSizeDSH = KernelCommandsHelper::getTotalSizeRequiredDSH(multiDispatchInfo); - auto expectedSizeIH = KernelCommandsHelper::getTotalSizeRequiredIH(multiDispatchInfo); auto expectedSizeIOH = KernelCommandsHelper::getTotalSizeRequiredIOH(multiDispatchInfo); auto expectedSizeSSH = KernelCommandsHelper::getTotalSizeRequiredSSH(multiDispatchInfo); @@ -302,7 +283,6 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueReadBufferBlocking) { EXPECT_EQ(expectedSizeCS, usedAfterCS - usedBeforeCS); EXPECT_GE(expectedSizeDSH, usedAfterDSH - usedBeforeDSH); - EXPECT_GE(expectedSizeIH, usedAfterIH - usedBeforeIH); EXPECT_GE(expectedSizeIOH, usedAfterIOH - usedBeforeIOH); EXPECT_GE(expectedSizeSSH, usedAfterSSH - usedBeforeSSH); } @@ -312,11 +292,9 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueWriteBufferNonBlocking) { auto &commandStream = pCmdQ->getCS(); auto usedBeforeCS = commandStream.getUsed(); auto &dsh = pCmdQ->getIndirectHeap(IndirectHeap::DYNAMIC_STATE); - auto &ih = pCmdQ->getIndirectHeap(IndirectHeap::INSTRUCTION); auto &ioh = pCmdQ->getIndirectHeap(IndirectHeap::INDIRECT_OBJECT); auto &ssh = pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE); auto usedBeforeDSH = dsh.getUsed(); - auto usedBeforeIH = ih.getUsed(); auto usedBeforeIOH = ioh.getUsed(); auto usedBeforeSSH = ssh.getUsed(); @@ -341,13 +319,11 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueWriteBufferNonBlocking) { auto usedAfterCS = commandStream.getUsed(); auto usedAfterDSH = dsh.getUsed(); - auto usedAfterIH = ih.getUsed(); auto usedAfterIOH = ioh.getUsed(); auto usedAfterSSH = ssh.getUsed(); auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(false, false, *pCmdQ, multiDispatchInfo); auto expectedSizeDSH = KernelCommandsHelper::getTotalSizeRequiredDSH(multiDispatchInfo); - auto expectedSizeIH = KernelCommandsHelper::getTotalSizeRequiredIH(multiDispatchInfo); auto expectedSizeIOH = KernelCommandsHelper::getTotalSizeRequiredIOH(multiDispatchInfo); auto expectedSizeSSH = KernelCommandsHelper::getTotalSizeRequiredSSH(multiDispatchInfo); @@ -357,7 +333,6 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueWriteBufferNonBlocking) { EXPECT_EQ(expectedSizeCS, usedAfterCS - usedBeforeCS); EXPECT_GE(expectedSizeDSH, usedAfterDSH - usedBeforeDSH); - EXPECT_GE(expectedSizeIH, usedAfterIH - usedBeforeIH); EXPECT_GE(expectedSizeIOH, usedAfterIOH - usedBeforeIOH); EXPECT_GE(expectedSizeSSH, usedAfterSSH - usedBeforeSSH); } @@ -366,11 +341,9 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueWriteBufferBlocking) { auto &commandStream = pCmdQ->getCS(); auto usedBeforeCS = commandStream.getUsed(); auto &dsh = pCmdQ->getIndirectHeap(IndirectHeap::DYNAMIC_STATE); - auto &ih = pCmdQ->getIndirectHeap(IndirectHeap::INSTRUCTION); auto &ioh = pCmdQ->getIndirectHeap(IndirectHeap::INDIRECT_OBJECT); auto &ssh = pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE); auto usedBeforeDSH = dsh.getUsed(); - auto usedBeforeIH = ih.getUsed(); auto usedBeforeIOH = ioh.getUsed(); auto usedBeforeSSH = ssh.getUsed(); @@ -396,13 +369,11 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueWriteBufferBlocking) { auto usedAfterCS = commandStream.getUsed(); auto usedAfterDSH = dsh.getUsed(); - auto usedAfterIH = ih.getUsed(); auto usedAfterIOH = ioh.getUsed(); auto usedAfterSSH = ssh.getUsed(); auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(false, false, *pCmdQ, multiDispatchInfo); auto expectedSizeDSH = KernelCommandsHelper::getTotalSizeRequiredDSH(multiDispatchInfo); - auto expectedSizeIH = KernelCommandsHelper::getTotalSizeRequiredIH(multiDispatchInfo); auto expectedSizeIOH = KernelCommandsHelper::getTotalSizeRequiredIOH(multiDispatchInfo); auto expectedSizeSSH = KernelCommandsHelper::getTotalSizeRequiredSSH(multiDispatchInfo); @@ -412,7 +383,6 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueWriteBufferBlocking) { EXPECT_EQ(expectedSizeCS, usedAfterCS - usedBeforeCS); EXPECT_GE(expectedSizeDSH, usedAfterDSH - usedBeforeDSH); - EXPECT_GE(expectedSizeIH, usedAfterIH - usedBeforeIH); EXPECT_GE(expectedSizeIOH, usedAfterIOH - usedBeforeIOH); EXPECT_GE(expectedSizeSSH, usedAfterSSH - usedBeforeSSH); } diff --git a/unit_tests/command_queue/get_size_required_image_tests.cpp b/unit_tests/command_queue/get_size_required_image_tests.cpp index 98be342f46..8b5322e1e7 100644 --- a/unit_tests/command_queue/get_size_required_image_tests.cpp +++ b/unit_tests/command_queue/get_size_required_image_tests.cpp @@ -75,11 +75,9 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueCopyImage) { auto &commandStream = pCmdQ->getCS(); auto usedBeforeCS = commandStream.getUsed(); auto &dsh = pCmdQ->getIndirectHeap(IndirectHeap::DYNAMIC_STATE); - auto &ih = pCmdQ->getIndirectHeap(IndirectHeap::INSTRUCTION); auto &ioh = pCmdQ->getIndirectHeap(IndirectHeap::INDIRECT_OBJECT); auto &ssh = pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE); auto usedBeforeDSH = dsh.getUsed(); - auto usedBeforeIH = ih.getUsed(); auto usedBeforeIOH = ioh.getUsed(); auto usedBeforeSSH = ssh.getUsed(); @@ -105,13 +103,11 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueCopyImage) { auto usedAfterCS = commandStream.getUsed(); auto usedAfterDSH = dsh.getUsed(); - auto usedAfterIH = ih.getUsed(); auto usedAfterIOH = ioh.getUsed(); auto usedAfterSSH = ssh.getUsed(); auto expectedSizeCS = EnqueueOperation::getSizeRequiredCS(false, false, *pCmdQ, kernel); auto expectedSizeDSH = KernelCommandsHelper::getSizeRequiredDSH(*kernel); - auto expectedSizeIH = KernelCommandsHelper::getSizeRequiredIH(*kernel); auto expectedSizeIOH = KernelCommandsHelper::getSizeRequiredIOH(*kernel); auto expectedSizeSSH = KernelCommandsHelper::getSizeRequiredSSH(*kernel); @@ -121,7 +117,6 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueCopyImage) { EXPECT_EQ(expectedSizeCS, usedAfterCS - usedBeforeCS); EXPECT_GE(expectedSizeDSH, usedAfterDSH - usedBeforeDSH); - EXPECT_GE(expectedSizeIH, usedAfterIH - usedBeforeIH); EXPECT_GE(expectedSizeIOH, usedAfterIOH - usedBeforeIOH); EXPECT_GE(expectedSizeSSH, usedAfterSSH - usedBeforeSSH); } @@ -130,11 +125,9 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueCopyReadAndWriteImage) { auto &commandStream = pCmdQ->getCS(); auto usedBeforeCS = commandStream.getUsed(); auto &dsh = pCmdQ->getIndirectHeap(IndirectHeap::DYNAMIC_STATE); - auto &ih = pCmdQ->getIndirectHeap(IndirectHeap::INSTRUCTION); auto &ioh = pCmdQ->getIndirectHeap(IndirectHeap::INDIRECT_OBJECT); auto &ssh = pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE); auto usedBeforeDSH = dsh.getUsed(); - auto usedBeforeIH = ih.getUsed(); auto usedBeforeIOH = ioh.getUsed(); auto usedBeforeSSH = ssh.getUsed(); @@ -158,13 +151,11 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueCopyReadAndWriteImage) { auto usedAfterCS = commandStream.getUsed(); auto usedAfterDSH = dsh.getUsed(); - auto usedAfterIH = ih.getUsed(); auto usedAfterIOH = ioh.getUsed(); auto usedAfterSSH = ssh.getUsed(); auto expectedSizeCS = EnqueueOperation::getSizeRequiredCS(false, false, *pCmdQ, kernel.get()); auto expectedSizeDSH = KernelCommandsHelper::getSizeRequiredDSH(*kernel.get()); - auto expectedSizeIH = KernelCommandsHelper::getSizeRequiredIH(*kernel.get()); auto expectedSizeIOH = KernelCommandsHelper::getSizeRequiredIOH(*kernel.get()); auto expectedSizeSSH = KernelCommandsHelper::getSizeRequiredSSH(*kernel.get()); @@ -176,7 +167,6 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueCopyReadAndWriteImage) { EXPECT_EQ(expectedSizeCS, usedAfterCS - usedBeforeCS); EXPECT_GE(expectedSizeDSH, usedAfterDSH - usedBeforeDSH); - EXPECT_GE(expectedSizeIH, usedAfterIH - usedBeforeIH); EXPECT_GE(expectedSizeIOH, usedAfterIOH - usedBeforeIOH); EXPECT_GE(expectedSizeSSH, usedAfterSSH - usedBeforeSSH); } @@ -185,11 +175,9 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueReadImageNonBlocking) { auto &commandStream = pCmdQ->getCS(); auto usedBeforeCS = commandStream.getUsed(); auto &dsh = pCmdQ->getIndirectHeap(IndirectHeap::DYNAMIC_STATE); - auto &ih = pCmdQ->getIndirectHeap(IndirectHeap::INSTRUCTION); auto &ioh = pCmdQ->getIndirectHeap(IndirectHeap::INDIRECT_OBJECT); auto &ssh = pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE); auto usedBeforeDSH = dsh.getUsed(); - auto usedBeforeIH = ih.getUsed(); auto usedBeforeIOH = ioh.getUsed(); auto usedBeforeSSH = ssh.getUsed(); @@ -219,13 +207,11 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueReadImageNonBlocking) { auto usedAfterCS = commandStream.getUsed(); auto usedAfterDSH = dsh.getUsed(); - auto usedAfterIH = ih.getUsed(); auto usedAfterIOH = ioh.getUsed(); auto usedAfterSSH = ssh.getUsed(); auto expectedSizeCS = EnqueueOperation::getSizeRequiredCS(false, false, *pCmdQ, kernel); auto expectedSizeDSH = KernelCommandsHelper::getSizeRequiredDSH(*kernel); - auto expectedSizeIH = KernelCommandsHelper::getSizeRequiredIH(*kernel); auto expectedSizeIOH = KernelCommandsHelper::getSizeRequiredIOH(*kernel); auto expectedSizeSSH = KernelCommandsHelper::getSizeRequiredSSH(*kernel); @@ -235,7 +221,6 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueReadImageNonBlocking) { EXPECT_EQ(expectedSizeCS, usedAfterCS - usedBeforeCS); EXPECT_GE(expectedSizeDSH, usedAfterDSH - usedBeforeDSH); - EXPECT_GE(expectedSizeIH, usedAfterIH - usedBeforeIH); EXPECT_GE(expectedSizeIOH, usedAfterIOH - usedBeforeIOH); EXPECT_GE(expectedSizeSSH, usedAfterSSH - usedBeforeSSH); } @@ -244,11 +229,9 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueReadImageBlocking) { auto &commandStream = pCmdQ->getCS(); auto usedBeforeCS = commandStream.getUsed(); auto &dsh = pCmdQ->getIndirectHeap(IndirectHeap::DYNAMIC_STATE); - auto &ih = pCmdQ->getIndirectHeap(IndirectHeap::INSTRUCTION); auto &ioh = pCmdQ->getIndirectHeap(IndirectHeap::INDIRECT_OBJECT); auto &ssh = pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE); auto usedBeforeDSH = dsh.getUsed(); - auto usedBeforeIH = ih.getUsed(); auto usedBeforeIOH = ioh.getUsed(); auto usedBeforeSSH = ssh.getUsed(); @@ -278,13 +261,11 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueReadImageBlocking) { auto usedAfterCS = commandStream.getUsed(); auto usedAfterDSH = dsh.getUsed(); - auto usedAfterIH = ih.getUsed(); auto usedAfterIOH = ioh.getUsed(); auto usedAfterSSH = ssh.getUsed(); auto expectedSizeCS = EnqueueOperation::getSizeRequiredCS(false, false, *pCmdQ, kernel); auto expectedSizeDSH = KernelCommandsHelper::getSizeRequiredDSH(*kernel); - auto expectedSizeIH = KernelCommandsHelper::getSizeRequiredIH(*kernel); auto expectedSizeIOH = KernelCommandsHelper::getSizeRequiredIOH(*kernel); auto expectedSizeSSH = KernelCommandsHelper::getSizeRequiredSSH(*kernel); @@ -294,7 +275,6 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueReadImageBlocking) { EXPECT_EQ(expectedSizeCS, usedAfterCS - usedBeforeCS); EXPECT_GE(expectedSizeDSH, usedAfterDSH - usedBeforeDSH); - EXPECT_GE(expectedSizeIH, usedAfterIH - usedBeforeIH); EXPECT_GE(expectedSizeIOH, usedAfterIOH - usedBeforeIOH); EXPECT_GE(expectedSizeSSH, usedAfterSSH - usedBeforeSSH); } @@ -303,11 +283,9 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueWriteImageNonBlocking) { auto &commandStream = pCmdQ->getCS(); auto usedBeforeCS = commandStream.getUsed(); auto &dsh = pCmdQ->getIndirectHeap(IndirectHeap::DYNAMIC_STATE); - auto &ih = pCmdQ->getIndirectHeap(IndirectHeap::INSTRUCTION); auto &ioh = pCmdQ->getIndirectHeap(IndirectHeap::INDIRECT_OBJECT); auto &ssh = pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE); auto usedBeforeDSH = dsh.getUsed(); - auto usedBeforeIH = ih.getUsed(); auto usedBeforeIOH = ioh.getUsed(); auto usedBeforeSSH = ssh.getUsed(); @@ -337,13 +315,11 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueWriteImageNonBlocking) { auto usedAfterCS = commandStream.getUsed(); auto usedAfterDSH = dsh.getUsed(); - auto usedAfterIH = ih.getUsed(); auto usedAfterIOH = ioh.getUsed(); auto usedAfterSSH = ssh.getUsed(); auto expectedSizeCS = EnqueueOperation::getSizeRequiredCS(false, false, *pCmdQ, kernel); auto expectedSizeDSH = KernelCommandsHelper::getSizeRequiredDSH(*kernel); - auto expectedSizeIH = KernelCommandsHelper::getSizeRequiredIH(*kernel); auto expectedSizeIOH = KernelCommandsHelper::getSizeRequiredIOH(*kernel); auto expectedSizeSSH = KernelCommandsHelper::getSizeRequiredSSH(*kernel); @@ -353,7 +329,6 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueWriteImageNonBlocking) { EXPECT_EQ(expectedSizeCS, usedAfterCS - usedBeforeCS); EXPECT_GE(expectedSizeDSH, usedAfterDSH - usedBeforeDSH); - EXPECT_GE(expectedSizeIH, usedAfterIH - usedBeforeIH); EXPECT_GE(expectedSizeIOH, usedAfterIOH - usedBeforeIOH); EXPECT_GE(expectedSizeSSH, usedAfterSSH - usedBeforeSSH); } @@ -362,11 +337,9 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueWriteImageBlocking) { auto &commandStream = pCmdQ->getCS(); auto usedBeforeCS = commandStream.getUsed(); auto &dsh = pCmdQ->getIndirectHeap(IndirectHeap::DYNAMIC_STATE); - auto &ih = pCmdQ->getIndirectHeap(IndirectHeap::INSTRUCTION); auto &ioh = pCmdQ->getIndirectHeap(IndirectHeap::INDIRECT_OBJECT); auto &ssh = pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE); auto usedBeforeDSH = dsh.getUsed(); - auto usedBeforeIH = ih.getUsed(); auto usedBeforeIOH = ioh.getUsed(); auto usedBeforeSSH = ssh.getUsed(); @@ -396,13 +369,11 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueWriteImageBlocking) { auto usedAfterCS = commandStream.getUsed(); auto usedAfterDSH = dsh.getUsed(); - auto usedAfterIH = ih.getUsed(); auto usedAfterIOH = ioh.getUsed(); auto usedAfterSSH = ssh.getUsed(); auto expectedSizeCS = EnqueueOperation::getSizeRequiredCS(false, false, *pCmdQ, kernel); auto expectedSizeDSH = KernelCommandsHelper::getSizeRequiredDSH(*kernel); - auto expectedSizeIH = KernelCommandsHelper::getSizeRequiredIH(*kernel); auto expectedSizeIOH = KernelCommandsHelper::getSizeRequiredIOH(*kernel); auto expectedSizeSSH = KernelCommandsHelper::getSizeRequiredSSH(*kernel); @@ -412,7 +383,6 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueWriteImageBlocking) { EXPECT_EQ(expectedSizeCS, usedAfterCS - usedBeforeCS); EXPECT_GE(expectedSizeDSH, usedAfterDSH - usedBeforeDSH); - EXPECT_GE(expectedSizeIH, usedAfterIH - usedBeforeIH); EXPECT_GE(expectedSizeIOH, usedAfterIOH - usedBeforeIOH); EXPECT_GE(expectedSizeSSH, usedAfterSSH - usedBeforeSSH); } diff --git a/unit_tests/device_queue/device_queue_hw_tests.cpp b/unit_tests/device_queue/device_queue_hw_tests.cpp index e3332b0882..6676ed6924 100644 --- a/unit_tests/device_queue/device_queue_hw_tests.cpp +++ b/unit_tests/device_queue/device_queue_hw_tests.cpp @@ -528,29 +528,21 @@ HWTEST_P(DeviceQueueHwWithKernel, setupIndirectState) { auto dsh = devQueueHw->getIndirectHeap(IndirectHeap::DYNAMIC_STATE); ASSERT_NE(nullptr, dsh); - size_t instructionHeapSize = pKernel->getInstructionHeapSizeForExecutionModel(); size_t surfaceStateHeapSize = KernelCommandsHelper::template getSizeRequiredForExecutionModel(const_cast(*pKernel)); - auto ish = new IndirectHeap(alignedMalloc(instructionHeapSize, MemoryConstants::pageSize), instructionHeapSize); auto ssh = new IndirectHeap(alignedMalloc(surfaceStateHeapSize, MemoryConstants::pageSize), surfaceStateHeapSize); - ASSERT_NE(nullptr, ish); - auto usedBeforeISH = ish->getUsed(); auto usedBeforeSSH = ssh->getUsed(); auto usedBeforeDSH = dsh->getUsed(); - devQueueHw->setupIndirectState(*ish, *ssh, pKernel, 1); - auto usedAfterISH = ish->getUsed(); + devQueueHw->setupIndirectState(*ssh, pKernel, 1); auto usedAfterSSH = ssh->getUsed(); auto usedAfterDSH = dsh->getUsed(); - EXPECT_GE(instructionHeapSize, usedAfterISH - usedBeforeISH); EXPECT_GE(surfaceStateHeapSize, usedAfterSSH - usedBeforeSSH); EXPECT_EQ(0u, usedAfterDSH - usedBeforeDSH); - alignedFree(ish->getCpuBase()); alignedFree(ssh->getCpuBase()); - delete ish; delete ssh; } } @@ -566,22 +558,18 @@ HWTEST_P(DeviceQueueHwWithKernel, setupIndirectStateSetsCorrectStartBlockID) { auto dsh = devQueueHw->getIndirectHeap(IndirectHeap::DYNAMIC_STATE); ASSERT_NE(nullptr, dsh); - size_t instructionHeapSize = pKernel->getInstructionHeapSizeForExecutionModel(); size_t surfaceStateHeapSize = KernelCommandsHelper::template getSizeRequiredForExecutionModel(const_cast(*pKernel)); - auto ish = new IndirectHeap(alignedMalloc(instructionHeapSize, MemoryConstants::pageSize), instructionHeapSize); auto ssh = new IndirectHeap(alignedMalloc(surfaceStateHeapSize, MemoryConstants::pageSize), surfaceStateHeapSize); uint32_t parentCount = 4; - devQueueHw->setupIndirectState(*ish, *ssh, pKernel, parentCount); + devQueueHw->setupIndirectState(*ssh, pKernel, parentCount); auto *igilQueue = reinterpret_cast(devQueueHw->getQueueBuffer()->getUnderlyingBuffer()); EXPECT_EQ(parentCount, igilQueue->m_controls.m_StartBlockID); - alignedFree(ish->getCpuBase()); alignedFree(ssh->getCpuBase()); - delete ish; delete ssh; } } @@ -600,15 +588,13 @@ HWTEST_P(DeviceQueueHwWithKernel, setupIndirectStateSetsCorrectDSHValues) { auto dsh = devQueueHw->getIndirectHeap(IndirectHeap::DYNAMIC_STATE); ASSERT_NE(nullptr, dsh); - size_t instructionHeapSize = pKernel->getInstructionHeapSizeForExecutionModel(); size_t surfaceStateHeapSize = KernelCommandsHelper::template getSizeRequiredForExecutionModel(const_cast(*pKernel)); - auto ish = new IndirectHeap(alignedMalloc(instructionHeapSize, MemoryConstants::pageSize), instructionHeapSize); auto ssh = new IndirectHeap(alignedMalloc(surfaceStateHeapSize, MemoryConstants::pageSize), surfaceStateHeapSize); uint32_t parentCount = 1; - devQueueHw->setupIndirectState(*ish, *ssh, pKernel, parentCount); + devQueueHw->setupIndirectState(*ssh, pKernel, parentCount); auto *igilQueue = reinterpret_cast(devQueueHw->getQueueBuffer()->getUnderlyingBuffer()); EXPECT_EQ(igilQueue->m_controls.m_DynamicHeapStart, devQueueHw->offsetDsh + alignUp((uint32_t)pKernel->getDynamicStateHeapSize(), GPGPU_WALKER::INDIRECTDATASTARTADDRESS_ALIGN_SIZE)); @@ -616,9 +602,7 @@ HWTEST_P(DeviceQueueHwWithKernel, setupIndirectStateSetsCorrectDSHValues) { EXPECT_EQ(igilQueue->m_controls.m_CurrentDSHoffset, devQueueHw->offsetDsh + alignUp((uint32_t)pKernel->getDynamicStateHeapSize(), GPGPU_WALKER::INDIRECTDATASTARTADDRESS_ALIGN_SIZE)); EXPECT_EQ(igilQueue->m_controls.m_ParentDSHOffset, devQueueHw->offsetDsh); - alignedFree(ish->getCpuBase()); alignedFree(ssh->getCpuBase()); - delete ish; delete ssh; delete devQueueHw; } diff --git a/unit_tests/device_queue/device_queue_tests.cpp b/unit_tests/device_queue/device_queue_tests.cpp index 677cab2aee..f5377a7f53 100644 --- a/unit_tests/device_queue/device_queue_tests.cpp +++ b/unit_tests/device_queue/device_queue_tests.cpp @@ -39,11 +39,9 @@ TEST(DeviceQueueSimpleTest, setupExecutionModelDispatchDoesNothing) { memset(buffer, 1, 20); size_t size = 20; - IndirectHeap ih(buffer, size); IndirectHeap ssh(buffer, size); - devQueue.setupExecutionModelDispatch(ih, ssh, nullptr, 0, 0, 0); + devQueue.setupExecutionModelDispatch(ssh, nullptr, 0, 0, 0); - EXPECT_EQ(0u, ih.getUsed()); EXPECT_EQ(0u, ssh.getUsed()); for (uint32_t i = 0; i < 20; i++) { diff --git a/unit_tests/event/event_tests.cpp b/unit_tests/event/event_tests.cpp index 17618bd4ea..460348f3e4 100644 --- a/unit_tests/event/event_tests.cpp +++ b/unit_tests/event/event_tests.cpp @@ -452,7 +452,6 @@ class SurfaceMock : public Surface { TEST_F(InternalsEventTest, resizeCmdQueueHeapsWhenKernelOparationHeapsAreBigger) { CommandQueue *pCmdQ = new CommandQueue(mockContext, pDevice, 0); IndirectHeap &cmdQueueDsh = pCmdQ->getIndirectHeap(IndirectHeap::DYNAMIC_STATE, 4096); - IndirectHeap &cmdQueueIsh = pCmdQ->getIndirectHeap(IndirectHeap::INSTRUCTION, 4096); IndirectHeap &cmdQueueIoh = pCmdQ->getIndirectHeap(IndirectHeap::INDIRECT_OBJECT, 4096); IndirectHeap &cmdQueueSsh = pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE, 4096); @@ -466,13 +465,12 @@ TEST_F(InternalsEventTest, resizeCmdQueueHeapsWhenKernelOparationHeapsAreBigger) }; auto dsh = createFullHeap(requestedSize); - auto ish = createFullHeap(requestedSize); auto ioh = createFullHeap(requestedSize); auto ssh = createFullHeap(maxSshSize); using UniqueIH = std::unique_ptr; auto kernelOperation = new KernelOperation(std::unique_ptr(cmdStream), UniqueIH(dsh), - UniqueIH(ish), UniqueIH(ioh), UniqueIH(ssh)); + UniqueIH(ioh), UniqueIH(ssh)); std::vector v; SurfaceMock *surface = new SurfaceMock; v.push_back(surface); @@ -481,14 +479,12 @@ TEST_F(InternalsEventTest, resizeCmdQueueHeapsWhenKernelOparationHeapsAreBigger) std::unique_ptr(kernelOperation), v, false, false, false, nullptr, preemptionMode); EXPECT_LT(cmdQueueDsh.getMaxAvailableSpace(), dsh->getMaxAvailableSpace()); - EXPECT_EQ(requestedSize, ish->getMaxAvailableSpace()); EXPECT_LT(cmdQueueIoh.getMaxAvailableSpace(), ioh->getMaxAvailableSpace()); EXPECT_EQ(maxSshSize, ssh->getMaxAvailableSpace()); cmdComputeKernel->submit(0, false); EXPECT_GE(cmdQueueDsh.getMaxAvailableSpace(), dsh->getMaxAvailableSpace()); - EXPECT_GE(cmdQueueIsh.getMaxAvailableSpace(), ish->getMaxAvailableSpace()); EXPECT_GE(cmdQueueIoh.getMaxAvailableSpace(), ioh->getMaxAvailableSpace()); EXPECT_GE(cmdQueueSsh.getMaxAvailableSpace(), ssh->getMaxAvailableSpace()); @@ -502,12 +498,11 @@ TEST_F(InternalsEventTest, processBlockedCommandsKernelOperation) { auto cmdStream = new LinearStream(alignedMalloc(4096, 4096), 4096); auto dsh = new IndirectHeap(alignedMalloc(4096, 4096), 4096); - auto ish = new IndirectHeap(alignedMalloc(4096, 4096), 4096); auto ioh = new IndirectHeap(alignedMalloc(4096, 4096), 4096); auto ssh = new IndirectHeap(alignedMalloc(4096, 4096), 4096); using UniqueIH = std::unique_ptr; auto blockedCommandsData = new KernelOperation(std::unique_ptr(cmdStream), UniqueIH(dsh), - UniqueIH(ish), UniqueIH(ioh), UniqueIH(ssh)); + UniqueIH(ioh), UniqueIH(ssh)); auto &csr = pDevice->getCommandStreamReceiver(); std::vector v; @@ -540,12 +535,11 @@ TEST_F(InternalsEventTest, processBlockedCommandsAbortKernelOperation) { auto cmdStream = new LinearStream(alignedMalloc(4096, 4096), 4096); auto dsh = new IndirectHeap(alignedMalloc(4096, 4096), 4096); - auto ish = new IndirectHeap(alignedMalloc(4096, 4096), 4096); auto ioh = new IndirectHeap(alignedMalloc(4096, 4096), 4096); auto ssh = new IndirectHeap(alignedMalloc(4096, 4096), 4096); using UniqueIH = std::unique_ptr; auto blockedCommandsData = new KernelOperation(std::unique_ptr(cmdStream), UniqueIH(dsh), - UniqueIH(ish), UniqueIH(ioh), UniqueIH(ssh)); + UniqueIH(ioh), UniqueIH(ssh)); auto &csr = pDevice->getCommandStreamReceiver(); std::vector v; @@ -572,12 +566,11 @@ TEST_F(InternalsEventTest, givenBlockedKernelWithPrintfWhenSubmittedThenPrintOut auto cmdStream = new LinearStream(alignedMalloc(4096, 4096), 4096); auto dsh = new IndirectHeap(alignedMalloc(4096, 4096), 4096); - auto ish = new IndirectHeap(alignedMalloc(4096, 4096), 4096); auto ioh = new IndirectHeap(alignedMalloc(4096, 4096), 4096); auto ssh = new IndirectHeap(alignedMalloc(4096, 4096), 4096); using UniqueIH = std::unique_ptr; auto blockedCommandsData = new KernelOperation(std::unique_ptr(cmdStream), UniqueIH(dsh), - UniqueIH(ish), UniqueIH(ioh), UniqueIH(ssh)); + UniqueIH(ioh), UniqueIH(ssh)); SPatchAllocateStatelessPrintfSurface *pPrintfSurface = new SPatchAllocateStatelessPrintfSurface(); pPrintfSurface->DataParamOffset = 0; @@ -1485,12 +1478,11 @@ HWTEST_F(InternalsEventTest, givenAbortedCommandWhenSubmitCalledThenDontUpdateFl auto cmdStream = new LinearStream(alignedMalloc(4096, 4096), 4096); auto dsh = new IndirectHeap(alignedMalloc(4096, 4096), 4096); - auto ish = new IndirectHeap(alignedMalloc(4096, 4096), 4096); auto ioh = new IndirectHeap(alignedMalloc(4096, 4096), 4096); auto ssh = new IndirectHeap(alignedMalloc(4096, 4096), 4096); using UniqueIH = std::unique_ptr; auto blockedCommandsData = new KernelOperation(std::unique_ptr(cmdStream), UniqueIH(dsh), - UniqueIH(ish), UniqueIH(ioh), UniqueIH(ssh)); + UniqueIH(ioh), UniqueIH(ssh)); PreemptionMode preemptionMode = pDevice->getPreemptionMode(); std::vector v; auto cmd = new CommandComputeKernel(*pCmdQ, csr, std::unique_ptr(blockedCommandsData), v, false, false, false, nullptr, preemptionMode); diff --git a/unit_tests/execution_model/scheduler_dispatch_tests.cpp b/unit_tests/execution_model/scheduler_dispatch_tests.cpp index fc23583819..c5ddb59834 100644 --- a/unit_tests/execution_model/scheduler_dispatch_tests.cpp +++ b/unit_tests/execution_model/scheduler_dispatch_tests.cpp @@ -67,11 +67,9 @@ HWTEST_F(ExecutionModelSchedulerFixture, dispatchScheduler) { EXPECT_NE(nullptr, executionModelDsh); - size_t minRequiredSizeForSchedulerIH = KernelCommandsHelper::template getSizeRequiredForExecutionModel(*parentKernel); size_t minRequiredSizeForSchedulerSSH = KernelCommandsHelper::template getSizeRequiredForExecutionModel(*parentKernel); // Setup heaps in pCmdQ LinearStream &commandStream = getCommandStream(*pCmdQ, false, false, &scheduler); - pCmdQ->getIndirectHeap(IndirectHeap::INSTRUCTION, minRequiredSizeForSchedulerIH); pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE, minRequiredSizeForSchedulerSSH); dispatchScheduler( @@ -185,11 +183,9 @@ HWTEST_F(ExecutionModelSchedulerFixture, dispatchSchedulerDoesNotUseStandardCmdQ DeviceQueueHw *pDevQueueHw = castToObject>(pDevQueue); SchedulerKernel &scheduler = BuiltIns::getInstance().getSchedulerKernel(*context); - size_t minRequiredSizeForSchedulerIH = KernelCommandsHelper::template getSizeRequiredForExecutionModel(*parentKernel); size_t minRequiredSizeForSchedulerSSH = KernelCommandsHelper::template getSizeRequiredForExecutionModel(*parentKernel); // Setup heaps in pCmdQ getCommandStream(*pCmdQ, false, false, &scheduler); - pCmdQ->getIndirectHeap(IndirectHeap::INSTRUCTION, minRequiredSizeForSchedulerIH); pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE, minRequiredSizeForSchedulerSSH); dispatchScheduler( @@ -218,11 +214,9 @@ HWTEST_F(ParentKernelCommandQueueFixture, dispatchSchedulerWithEarlyReturnSetToF SchedulerKernel &scheduler = BuiltIns::getInstance().getSchedulerKernel(*context); - size_t minRequiredSizeForSchedulerIH = KernelCommandsHelper::getSizeRequiredIH(scheduler); size_t minRequiredSizeForSchedulerSSH = KernelCommandsHelper::getSizeRequiredSSH(scheduler); // Setup heaps in pCmdQ LinearStream &commandStream = getCommandStream(*pCmdQ, false, false, &scheduler); - pCmdQ->getIndirectHeap(IndirectHeap::INSTRUCTION, minRequiredSizeForSchedulerIH); pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE, minRequiredSizeForSchedulerSSH); dispatchScheduler( diff --git a/unit_tests/execution_model/submit_blocked_parent_kernel_tests.cpp b/unit_tests/execution_model/submit_blocked_parent_kernel_tests.cpp index 462f111af5..c8328f1d90 100644 --- a/unit_tests/execution_model/submit_blocked_parent_kernel_tests.cpp +++ b/unit_tests/execution_model/submit_blocked_parent_kernel_tests.cpp @@ -65,9 +65,9 @@ class MockDeviceQueueHwWithCriticalSectionRelease : public DeviceQueueHwm_controls.m_CriticalSection == DeviceQueueHw::ExecutionModelCriticalSection::Free; } - void setupIndirectState(IndirectHeap &instructionHeap, IndirectHeap &surfaceStateHeap, Kernel *parentKernel, uint32_t parentIDCount) override { + void setupIndirectState(IndirectHeap &surfaceStateHeap, Kernel *parentKernel, uint32_t parentIDCount) override { indirectStateSetup = true; - return BaseClass::setupIndirectState(instructionHeap, surfaceStateHeap, parentKernel, parentIDCount); + return BaseClass::setupIndirectState(surfaceStateHeap, parentKernel, parentIDCount); } void addExecutionModelCleanUpSection(Kernel *parentKernel, HwTimeStamps *hwTimeStamp, uint32_t taskCount) override { cleanupSectionAdded = true; @@ -103,16 +103,13 @@ HWTEST_F(ParentKernelCommandQueueFixture, givenLockedEMcritcalSectionWhenParentK IndirectHeap *dsh = new IndirectHeap(alignedMalloc(dshSize, alignement), dshSize); dsh->getSpace(mockDevQueue.getDshOffset()); - size_t minSizeISHForEM = KernelCommandsHelper::template getSizeRequiredForExecutionModel(*parentKernel); size_t minSizeSSHForEM = KernelCommandsHelper::template getSizeRequiredForExecutionModel(*parentKernel); KernelOperation *blockedCommandData = new KernelOperation(std::unique_ptr(new LinearStream()), std::unique_ptr(dsh), std::unique_ptr(new IndirectHeap(alignedMalloc(heapSize, alignement), heapSize)), - std::unique_ptr(new IndirectHeap(alignedMalloc(heapSize, alignement), heapSize)), std::unique_ptr(new IndirectHeap(alignedMalloc(heapSize, alignement), heapSize))); - blockedCommandData->instructionHeapSizeEM = minSizeISHForEM; blockedCommandData->surfaceStateHeapSizeEM = minSizeSSHForEM; PreemptionMode preemptionMode = device->getPreemptionMode(); std::vector surfaces; @@ -166,13 +163,10 @@ HWTEST_F(ParentKernelCommandQueueFixture, givenParentKernelWhenCommandIsSubmitte KernelOperation *blockedCommandData = new KernelOperation(std::unique_ptr(new LinearStream()), std::unique_ptr(dsh), std::unique_ptr(new IndirectHeap(alignedMalloc(heapSize, alignement), heapSize)), - std::unique_ptr(new IndirectHeap(alignedMalloc(heapSize, alignement), heapSize)), std::unique_ptr(new IndirectHeap(alignedMalloc(heapSize, alignement), heapSize))); - size_t minSizeISHForEM = KernelCommandsHelper::template getSizeRequiredForExecutionModel(*parentKernel); size_t minSizeSSHForEM = KernelCommandsHelper::template getSizeRequiredForExecutionModel(*parentKernel); - blockedCommandData->instructionHeapSizeEM = minSizeISHForEM; blockedCommandData->surfaceStateHeapSizeEM = minSizeSSHForEM; PreemptionMode preemptionMode = device->getPreemptionMode(); std::vector surfaces; @@ -211,13 +205,10 @@ HWTEST_F(ParentKernelCommandQueueFixture, givenParentKernelWhenCommandIsSubmitte KernelOperation *blockedCommandData = new KernelOperation(std::unique_ptr(new LinearStream()), std::unique_ptr(dsh), std::unique_ptr(new IndirectHeap(alignedMalloc(heapSize, alignement), heapSize)), - std::unique_ptr(new IndirectHeap(alignedMalloc(heapSize, alignement), heapSize)), std::unique_ptr(new IndirectHeap(alignedMalloc(heapSize, alignement), heapSize))); - size_t minSizeISHForEM = KernelCommandsHelper::template getSizeRequiredForExecutionModel(*parentKernel); size_t minSizeSSHForEM = KernelCommandsHelper::template getSizeRequiredForExecutionModel(*parentKernel); - blockedCommandData->instructionHeapSizeEM = minSizeISHForEM; blockedCommandData->surfaceStateHeapSizeEM = minSizeSSHForEM; PreemptionMode preemptionMode = device->getPreemptionMode(); std::vector surfaces; @@ -251,13 +242,10 @@ HWTEST_F(ParentKernelCommandQueueFixture, givenBlockedParentKernelWithProfilingW KernelOperation *blockedCommandData = new KernelOperation(std::unique_ptr(new LinearStream()), std::unique_ptr(dsh), std::unique_ptr(new IndirectHeap(alignedMalloc(heapSize, alignement), heapSize)), - std::unique_ptr(new IndirectHeap(alignedMalloc(heapSize, alignement), heapSize)), std::unique_ptr(new IndirectHeap(alignedMalloc(heapSize, alignement), heapSize))); - size_t minSizeISHForEM = KernelCommandsHelper::template getSizeRequiredForExecutionModel(*parentKernel); size_t minSizeSSHForEM = KernelCommandsHelper::template getSizeRequiredForExecutionModel(*parentKernel); - blockedCommandData->instructionHeapSizeEM = minSizeISHForEM; blockedCommandData->surfaceStateHeapSizeEM = minSizeSSHForEM; PreemptionMode preemptionMode = device->getPreemptionMode(); std::vector surfaces; @@ -294,13 +282,10 @@ HWTEST_F(ParentKernelCommandQueueFixture, givenParentKernelWhenCommandIsSubmitte KernelOperation *blockedCommandData = new KernelOperation(std::unique_ptr(new LinearStream()), std::unique_ptr(dsh), std::unique_ptr(new IndirectHeap(alignedMalloc(heapSize, alignement), heapSize)), - std::unique_ptr(new IndirectHeap(alignedMalloc(heapSize, alignement), heapSize)), std::unique_ptr(new IndirectHeap(alignedMalloc(heapSize, alignement), heapSize))); - size_t minSizeISHForEM = KernelCommandsHelper::template getSizeRequiredForExecutionModel(*parentKernel); size_t minSizeSSHForEM = KernelCommandsHelper::template getSizeRequiredForExecutionModel(*parentKernel); - blockedCommandData->instructionHeapSizeEM = minSizeISHForEM; blockedCommandData->surfaceStateHeapSizeEM = minSizeSSHForEM; PreemptionMode preemptionMode = device->getPreemptionMode(); std::vector surfaces; @@ -326,7 +311,6 @@ HWTEST_F(ParentKernelCommandQueueFixture, givenUsedSSHWhenParentKernelIsSubmitte MockCommandQueue cmdQ(context, device, properties); - size_t minSizeISHForEM = KernelCommandsHelper::template getSizeRequiredForExecutionModel(*parentKernel); size_t minSizeSSHForEM = KernelCommandsHelper::template getSizeRequiredForExecutionModel(*parentKernel); size_t heapSize = 20; @@ -343,10 +327,8 @@ HWTEST_F(ParentKernelCommandQueueFixture, givenUsedSSHWhenParentKernelIsSubmitte KernelOperation *blockedCommandData = new KernelOperation(std::unique_ptr(new LinearStream()), std::unique_ptr(dsh), std::unique_ptr(new IndirectHeap(alignedMalloc(heapSize, alignement), heapSize)), - std::unique_ptr(new IndirectHeap(alignedMalloc(heapSize, alignement), heapSize)), std::unique_ptr(new IndirectHeap(alignedMalloc(heapSize, alignement), heapSize))); - blockedCommandData->instructionHeapSizeEM = minSizeISHForEM; blockedCommandData->surfaceStateHeapSizeEM = minSizeSSHForEM; PreemptionMode preemptionMode = device->getPreemptionMode(); std::vector surfaces; @@ -370,7 +352,6 @@ HWTEST_F(ParentKernelCommandQueueFixture, givenNotUsedSSHWhenParentKernelIsSubmi parentKernel->createReflectionSurface(); context->setDefaultDeviceQueue(&mockDevQueue); - size_t minSizeISHForEM = KernelCommandsHelper::template getSizeRequiredForExecutionModel(*parentKernel); size_t minSizeSSHForEM = KernelCommandsHelper::template getSizeRequiredForExecutionModel(*parentKernel); size_t heapSize = 20; @@ -392,10 +373,8 @@ HWTEST_F(ParentKernelCommandQueueFixture, givenNotUsedSSHWhenParentKernelIsSubmi KernelOperation *blockedCommandData = new KernelOperation(std::unique_ptr(new LinearStream()), std::unique_ptr(dsh), std::unique_ptr(new IndirectHeap(alignedMalloc(heapSize, alignement), heapSize)), - std::unique_ptr(new IndirectHeap(alignedMalloc(heapSize, alignement), heapSize)), std::unique_ptr(ssh)); - blockedCommandData->instructionHeapSizeEM = minSizeISHForEM; blockedCommandData->surfaceStateHeapSizeEM = minSizeSSHForEM; PreemptionMode preemptionMode = device->getPreemptionMode(); std::vector surfaces; diff --git a/unit_tests/gen8/scheduler_dispatch_tests.cpp b/unit_tests/gen8/scheduler_dispatch_tests.cpp index a5f4903fa4..e4256d1c17 100644 --- a/unit_tests/gen8/scheduler_dispatch_tests.cpp +++ b/unit_tests/gen8/scheduler_dispatch_tests.cpp @@ -45,12 +45,10 @@ BDWTEST_F(BdwSchedulerTest, givenCallToDispatchSchedulerWhenPipeControlWithCSSta DeviceQueueHw *pDevQueueHw = castToObject>(pDevQueue); SchedulerKernel &scheduler = BuiltIns::getInstance().getSchedulerKernel(*context); - size_t minRequiredSizeForSchedulerIH = KernelCommandsHelper::template getSizeRequiredForExecutionModel(*parentKernel); size_t minRequiredSizeForSchedulerSSH = KernelCommandsHelper::template getSizeRequiredForExecutionModel(*parentKernel); // Setup heaps in pCmdQ LinearStream &commandStream = getCommandStream(*pCmdQ, false, false, &scheduler); - pCmdQ->getIndirectHeap(IndirectHeap::INSTRUCTION, minRequiredSizeForSchedulerIH); pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE, minRequiredSizeForSchedulerSSH); dispatchScheduler( diff --git a/unit_tests/helpers/kernel_commands_tests.cpp b/unit_tests/helpers/kernel_commands_tests.cpp index 4ec758255a..8e334d12ad 100644 --- a/unit_tests/helpers/kernel_commands_tests.cpp +++ b/unit_tests/helpers/kernel_commands_tests.cpp @@ -800,49 +800,8 @@ HWTEST_F(KernelCommandsTest, GivenKernelWithSamplersWhenIndirectStateIsProgramme delete[] mockDsh; } -HWTEST_F(KernelCommandsTest, getSizeRequiredIHForExecutionModelReturnsZeroForNonParentKernel) { - // define kernel info - std::unique_ptr pKernelInfo = std::unique_ptr(KernelInfo::create()); - - // create program with valid context - MockContext context; - MockProgram program(&context, false); - - // create kernel - std::unique_ptr pKernel = std::unique_ptr(new MockKernel(&program, *pKernelInfo.get(), *pDevice)); - - EXPECT_FALSE(pKernel->isParentKernel); - EXPECT_EQ(0u, KernelCommandsHelper::template getSizeRequiredForExecutionModel(*pKernel.get())); -} - typedef ExecutionModelKernelFixture ParentKernelCommandsFromBinaryTest; -HWTEST_P(ParentKernelCommandsFromBinaryTest, getSizeRequiredForExecutionModelReturnsTotalBlockBinarySizeAndSchedulerBinarySize) { - if (std::string(pPlatform->getDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) { - EXPECT_TRUE(pKernel->isParentKernel); - - size_t totalSize = 0; - - BlockKernelManager *blockManager = pKernel->getProgram()->getBlockKernelManager(); - uint32_t blockCount = static_cast(blockManager->getCount()); - - totalSize = Kernel::kernelBinaryAlignement - 1; // for initial alignment - - for (uint32_t i = 0; i < blockCount; i++) { - const KernelInfo *pBlockInfo = blockManager->getBlockKernelInfo(i); - - totalSize += pBlockInfo->heapInfo.pKernelHeader->KernelHeapSize; - totalSize = alignUp(totalSize, Kernel::kernelBinaryAlignement); - } - - BuiltIns &builtIns = BuiltIns::getInstance(); - auto &scheduler = builtIns.getSchedulerKernel(*pContext); - totalSize += KernelCommandsHelper::getSizeRequiredIH(scheduler); - - EXPECT_EQ(totalSize, KernelCommandsHelper::template getSizeRequiredForExecutionModel(*pKernel)); - } -} - HWTEST_P(ParentKernelCommandsFromBinaryTest, getSizeRequiredForExecutionModelForSurfaceStatesReturnsSizeOfBlocksPlusMaxBindingTableSizeForAllIDTEntriesAndSchedulerSSHSize) { using BINDING_TABLE_STATE = typename FamilyType::BINDING_TABLE_STATE;