From e04c5b361a3cc93c54af03283972dcb69888a2c3 Mon Sep 17 00:00:00 2001 From: Bartosz Dunajski Date: Fri, 26 Mar 2021 14:32:49 +0000 Subject: [PATCH] Remove Kernel arg from HardwareCommandsHelper Signed-off-by: Bartosz Dunajski --- opencl/source/command_queue/gpgpu_walker_bdw_plus.inl | 2 +- opencl/source/gen12lp/hardware_commands_helper_gen12lp.cpp | 4 ++-- opencl/source/helpers/hardware_commands_helper.h | 2 +- opencl/source/helpers/hardware_commands_helper_bdw_plus.inl | 2 +- opencl/test/unit_test/command_queue/dispatch_walker_tests.cpp | 4 ++-- .../test/unit_test/helpers/hardware_commands_helper_tests.cpp | 2 +- opencl/test/unit_test/profiling/profiling_tests.cpp | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/opencl/source/command_queue/gpgpu_walker_bdw_plus.inl b/opencl/source/command_queue/gpgpu_walker_bdw_plus.inl index 8a4e6702a6..e80f26bdab 100644 --- a/opencl/source/command_queue/gpgpu_walker_bdw_plus.inl +++ b/opencl/source/command_queue/gpgpu_walker_bdw_plus.inl @@ -185,7 +185,7 @@ void GpgpuWalkerHelper::setupTimestampPacket( template size_t EnqueueOperation::getSizeRequiredCSKernel(bool reserveProfilingCmdsSpace, bool reservePerfCounters, CommandQueue &commandQueue, const Kernel *pKernel, const DispatchInfo &dispatchInfo) { - size_t size = sizeof(typename GfxFamily::GPGPU_WALKER) + HardwareCommandsHelper::getSizeRequiredCS(pKernel) + + size_t size = sizeof(typename GfxFamily::GPGPU_WALKER) + HardwareCommandsHelper::getSizeRequiredCS() + sizeof(PIPE_CONTROL) * (MemorySynchronizationCommands::isPipeControlWArequired(commandQueue.getDevice().getHardwareInfo()) ? 2 : 1); size += HardwareCommandsHelper::getSizeRequiredForCacheFlush(commandQueue, pKernel, 0U); size += PreemptionHelper::getPreemptionWaCsSize(commandQueue.getDevice()); diff --git a/opencl/source/gen12lp/hardware_commands_helper_gen12lp.cpp b/opencl/source/gen12lp/hardware_commands_helper_gen12lp.cpp index d94571d94a..d95a3c7707 100644 --- a/opencl/source/gen12lp/hardware_commands_helper_gen12lp.cpp +++ b/opencl/source/gen12lp/hardware_commands_helper_gen12lp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2020 Intel Corporation + * Copyright (C) 2019-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -17,7 +17,7 @@ namespace NEO { template <> -size_t HardwareCommandsHelper::getSizeRequiredCS(const Kernel *kernel) { +size_t HardwareCommandsHelper::getSizeRequiredCS() { size_t size = 2 * sizeof(typename TGLLPFamily::MEDIA_STATE_FLUSH) + sizeof(typename TGLLPFamily::MEDIA_INTERFACE_DESCRIPTOR_LOAD); return size; diff --git a/opencl/source/helpers/hardware_commands_helper.h b/opencl/source/helpers/hardware_commands_helper.h index 42cc69aa50..ed69b328dd 100644 --- a/opencl/source/helpers/hardware_commands_helper.h +++ b/opencl/source/helpers/hardware_commands_helper.h @@ -116,7 +116,7 @@ struct HardwareCommandsHelper : public PerThreadDataHelper { inline static bool resetBindingTablePrefetch(Kernel &kernel); - static size_t getSizeRequiredCS(const Kernel *kernel); + static size_t getSizeRequiredCS(); static size_t getSizeRequiredForCacheFlush(const CommandQueue &commandQueue, const Kernel *kernel, uint64_t postSyncAddress); static size_t getSizeRequiredDSH( diff --git a/opencl/source/helpers/hardware_commands_helper_bdw_plus.inl b/opencl/source/helpers/hardware_commands_helper_bdw_plus.inl index 4ef3249ffb..3b6aedab05 100644 --- a/opencl/source/helpers/hardware_commands_helper_bdw_plus.inl +++ b/opencl/source/helpers/hardware_commands_helper_bdw_plus.inl @@ -46,7 +46,7 @@ uint32_t HardwareCommandsHelper::additionalSizeRequiredDsh() { } template -size_t HardwareCommandsHelper::getSizeRequiredCS(const Kernel *kernel) { +size_t HardwareCommandsHelper::getSizeRequiredCS() { size_t size = 2 * sizeof(typename GfxFamily::MEDIA_STATE_FLUSH) + sizeof(typename GfxFamily::MEDIA_INTERFACE_DESCRIPTOR_LOAD); return size; diff --git a/opencl/test/unit_test/command_queue/dispatch_walker_tests.cpp b/opencl/test/unit_test/command_queue/dispatch_walker_tests.cpp index 735fc8ab3e..f573410d28 100644 --- a/opencl/test/unit_test/command_queue/dispatch_walker_tests.cpp +++ b/opencl/test/unit_test/command_queue/dispatch_walker_tests.cpp @@ -160,7 +160,7 @@ HWTEST_F(DispatchWalkerTest, WhenDispatchingWalkerThenCommandStreamMemoryIsntCha // Consume all memory except what is needed for this enqueue auto sizeDispatchWalkerNeeds = sizeof(typename FamilyType::WALKER_TYPE) + - HardwareCommandsHelper::getSizeRequiredCS(&kernel); + HardwareCommandsHelper::getSizeRequiredCS(); //cs has a minimum required size auto sizeThatNeedsToBeSubstracted = sizeDispatchWalkerNeeds + CSRequirements::minCommandQueueCommandStreamSize; @@ -211,7 +211,7 @@ HWTEST_F(DispatchWalkerTest, GivenNoLocalIdsWhenDispatchingWalkerThenWalkerIsDis // Consume all memory except what is needed for this enqueue auto sizeDispatchWalkerNeeds = sizeof(typename FamilyType::WALKER_TYPE) + - HardwareCommandsHelper::getSizeRequiredCS(&kernel); + HardwareCommandsHelper::getSizeRequiredCS(); //cs has a minimum required size auto sizeThatNeedsToBeSubstracted = sizeDispatchWalkerNeeds + CSRequirements::minCommandQueueCommandStreamSize; diff --git a/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp b/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp index b41aafbccb..bb13177305 100644 --- a/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp @@ -368,7 +368,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsTest, WhenAllocatingIndirectStateRes EXPECT_GE(sizeRequiredSSH, usedAfterSSH - usedBeforeSSH); auto usedAfterCS = commandStream.getUsed(); - EXPECT_GE(HardwareCommandsHelper::getSizeRequiredCS(kernel), usedAfterCS - usedBeforeCS); + EXPECT_GE(HardwareCommandsHelper::getSizeRequiredCS(), usedAfterCS - usedBeforeCS); } HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsTest, givenKernelWithFourBindingTableEntriesWhenIndirectStateIsEmittedThenInterfaceDescriptorContainsCorrectBindingTableEntryCount) { diff --git a/opencl/test/unit_test/profiling/profiling_tests.cpp b/opencl/test/unit_test/profiling/profiling_tests.cpp index f0d26b08c4..6e506b320e 100644 --- a/opencl/test/unit_test/profiling/profiling_tests.cpp +++ b/opencl/test/unit_test/profiling/profiling_tests.cpp @@ -75,7 +75,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ProfilingTests, GivenCommandQueueWithProfilingAndFor MockKernel kernel(program.get(), kernelInfo, *pClDevice); - uint64_t requiredSize = 2 * sizeof(PIPE_CONTROL) + 2 * sizeof(MI_STORE_REGISTER_MEM) + sizeof(GPGPU_WALKER) + HardwareCommandsHelper::getSizeRequiredCS(&kernel); + uint64_t requiredSize = 2 * sizeof(PIPE_CONTROL) + 2 * sizeof(MI_STORE_REGISTER_MEM) + sizeof(GPGPU_WALKER) + HardwareCommandsHelper::getSizeRequiredCS(); MultiDispatchInfo multiDispatchInfo(&kernel); auto &commandStreamNDRangeKernel = getCommandStream(*pCmdQ, CsrDependencies(), true, false, false, @@ -120,7 +120,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ProfilingTests, GivenCommandQueueWithProfilingAndFor MockKernel kernel(program.get(), kernelInfo, *pClDevice); - uint64_t requiredSize = 2 * sizeof(PIPE_CONTROL) + 4 * sizeof(MI_STORE_REGISTER_MEM) + HardwareCommandsHelper::getSizeRequiredCS(&kernel); + uint64_t requiredSize = 2 * sizeof(PIPE_CONTROL) + 4 * sizeof(MI_STORE_REGISTER_MEM) + HardwareCommandsHelper::getSizeRequiredCS(); requiredSize += 2 * sizeof(GPGPU_WALKER); DispatchInfo dispatchInfo;