From b16bd14f378c4354beb53df718b42fc0b0d1ad82 Mon Sep 17 00:00:00 2001 From: Filip Hazubski Date: Thu, 27 Sep 2018 15:22:36 +0200 Subject: [PATCH] Change virtual class HardwareInterface to static Change-Id: I4f1f59ecb51b95041dc6dcc6c606b94595813f53 Signed-off-by: Filip Hazubski --- CMakeLists.txt | 1 - runtime/command_queue/CMakeLists.txt | 4 +- runtime/command_queue/enqueue_common.h | 3 +- runtime/command_queue/gpgpu_walker.h | 17 --- runtime/command_queue/gpgpu_walker.inl | 33 ----- runtime/command_queue/hardware_interface.h | 88 ++++++++++++ .../hardware_interface.inl | 104 +------------- .../hardware_interface/hardware_interface.h | 129 ------------------ .../command_queue/hardware_interface_base.inl | 106 ++++++++++++++ runtime/gen10/gpgpu_walker_gen10.cpp | 5 + runtime/gen10/hw_cmds.h | 10 +- runtime/gen8/gpgpu_walker_gen8.cpp | 5 + runtime/gen8/hw_cmds_base.h | 10 +- runtime/gen9/gpgpu_walker_gen9.cpp | 5 + runtime/gen9/hw_cmds_base.h | 10 +- .../command_queue/dispatch_walker_tests.cpp | 49 +++---- .../parent_kernel_dispatch_tests.cpp | 17 +-- .../submit_blocked_parent_kernel_tests.cpp | 3 +- unit_tests/helpers/timestamp_packet_tests.cpp | 5 +- unit_tests/libult/mock_gfx_family.h | 6 +- 20 files changed, 268 insertions(+), 342 deletions(-) create mode 100644 runtime/command_queue/hardware_interface.h rename runtime/command_queue/{hardware_interface => }/hardware_interface.inl (75%) delete mode 100644 runtime/command_queue/hardware_interface/hardware_interface.h create mode 100644 runtime/command_queue/hardware_interface_base.inl diff --git a/CMakeLists.txt b/CMakeLists.txt index 3079293459..0367e06b8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -534,7 +534,6 @@ include_directories(${IGDRCL_SOURCE_DIR}/runtime/gen_common/reg_configs${BRANCH_ include_directories(${IGDRCL_SOURCE_DIR}/runtime/gmm_helper/${BRANCH_DIR_SUFFIX}) include_directories(${IGDRCL_SOURCE_DIR}/runtime/gmm_helper/client_context${BRANCH_DIR_SUFFIX}) include_directories(${IGDRCL_SOURCE_DIR}/runtime/gmm_helper/gmm_memory${BRANCH_DIR_SUFFIX}) -include_directories(${IGDRCL_SOURCE_DIR}/runtime/command_queue/hardware_interface${BRANCH_DIR_SUFFIX}) set(HW_SRC_INCLUDE_PATH ${IGDRCL_SOURCE_DIR}/runtime/gen_common) diff --git a/runtime/command_queue/CMakeLists.txt b/runtime/command_queue/CMakeLists.txt index e1aa79df47..7eb353454f 100644 --- a/runtime/command_queue/CMakeLists.txt +++ b/runtime/command_queue/CMakeLists.txt @@ -34,14 +34,14 @@ set(RUNTIME_SRCS_COMMAND_QUEUE ${CMAKE_CURRENT_SOURCE_DIR}/flush.h ${CMAKE_CURRENT_SOURCE_DIR}/gpgpu_walker.h ${CMAKE_CURRENT_SOURCE_DIR}/gpgpu_walker.inl + ${CMAKE_CURRENT_SOURCE_DIR}/hardware_interface.h + ${CMAKE_CURRENT_SOURCE_DIR}/hardware_interface.inl ${CMAKE_CURRENT_SOURCE_DIR}/local_id_gen.cpp ${CMAKE_CURRENT_SOURCE_DIR}/local_id_gen.h ${CMAKE_CURRENT_SOURCE_DIR}/local_id_gen.inl ${CMAKE_CURRENT_SOURCE_DIR}/local_id_gen_avx2.cpp ${CMAKE_CURRENT_SOURCE_DIR}/local_id_gen_sse4.cpp ${CMAKE_CURRENT_SOURCE_DIR}/local_work_size.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/hardware_interface${BRANCH_DIR_SUFFIX}/hardware_interface.h - ${CMAKE_CURRENT_SOURCE_DIR}/hardware_interface${BRANCH_DIR_SUFFIX}/hardware_interface.inl ) target_sources(${NEO_STATIC_LIB_NAME} PRIVATE ${RUNTIME_SRCS_COMMAND_QUEUE}) set_property(GLOBAL PROPERTY RUNTIME_SRCS_COMMAND_QUEUE ${RUNTIME_SRCS_COMMAND_QUEUE}) diff --git a/runtime/command_queue/enqueue_common.h b/runtime/command_queue/enqueue_common.h index 651bc9981e..a82986a858 100644 --- a/runtime/command_queue/enqueue_common.h +++ b/runtime/command_queue/enqueue_common.h @@ -12,6 +12,7 @@ #include "runtime/builtin_kernels_simulation/scheduler_simulation.h" #include "runtime/command_queue/command_queue_hw.h" #include "runtime/command_queue/gpgpu_walker.h" +#include "runtime/command_queue/hardware_interface.h" #include "runtime/command_stream/command_stream_receiver.h" #include "runtime/event/event_builder.h" #include "runtime/gtpin/gtpin_notify.h" @@ -266,7 +267,7 @@ void CommandQueueHw::enqueueHandler(Surface **surfacesForResidency, } } - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *this, multiDispatchInfo, numEventsInWaitList, diff --git a/runtime/command_queue/gpgpu_walker.h b/runtime/command_queue/gpgpu_walker.h index f1cebe886d..75a812f810 100644 --- a/runtime/command_queue/gpgpu_walker.h +++ b/runtime/command_queue/gpgpu_walker.h @@ -31,9 +31,6 @@ using WALKER_HANDLE = void *; template using WALKER_TYPE = typename GfxFamily::WALKER_TYPE; -template -using HARDWARE_INTERFACE = typename GfxFamily::HARDWARE_INTERFACE; - constexpr int32_t NUM_ALU_INST_FOR_READ_MODIFY_WRITE = 4; constexpr int32_t L3SQC_BIT_LQSC_RO_PERF_DIS = 0x08000000; @@ -188,20 +185,6 @@ class GpgpuWalkerHelper { OCLRT::HwPerfCounter &hwPerfCounter, OCLRT::LinearStream *commandStream); - static void dispatchWalker( - CommandQueue &commandQueue, - const MultiDispatchInfo &multiDispatchInfo, - cl_uint numEventsInWaitList, - const cl_event *eventWaitList, - KernelOperation **blockedCommandsData, - HwTimeStamps *hwTimeStamps, - OCLRT::HwPerfCounter *hwPerfCounter, - TagNode *previousTimestampPacketNode, - TimestampPacket *currentTimestampPacket, - PreemptionMode preemptionMode, - bool blockQueue, - uint32_t commandType = 0); - static void setupTimestampPacket( LinearStream *cmdStream, WALKER_HANDLE walkerHandle, diff --git a/runtime/command_queue/gpgpu_walker.inl b/runtime/command_queue/gpgpu_walker.inl index 8d83d042cd..dd46a38b04 100644 --- a/runtime/command_queue/gpgpu_walker.inl +++ b/runtime/command_queue/gpgpu_walker.inl @@ -7,8 +7,6 @@ #pragma once #include "runtime/command_queue/gpgpu_walker.h" -#include "hardware_interface.h" -#include "hardware_interface.inl" #include "runtime/command_queue/command_queue.h" #include "runtime/command_queue/local_id_gen.h" #include "runtime/command_stream/command_stream_receiver.h" @@ -416,37 +414,6 @@ void GpgpuWalkerHelper::dispatchPerfCountersCommandsEnd( perfCounters->setCpuTimestamp(); } -template -void GpgpuWalkerHelper::dispatchWalker( - CommandQueue &commandQueue, - const MultiDispatchInfo &multiDispatchInfo, - cl_uint numEventsInWaitList, - const cl_event *eventWaitList, - KernelOperation **blockedCommandsData, - HwTimeStamps *hwTimeStamps, - OCLRT::HwPerfCounter *hwPerfCounter, - TagNode *previousTimestampPacketNode, - TimestampPacket *currentTimestampPacket, - PreemptionMode preemptionMode, - bool blockQueue, - uint32_t commandType) { - - HARDWARE_INTERFACE hardwareInterface; - hardwareInterface.dispatchWalker( - commandQueue, - multiDispatchInfo, - numEventsInWaitList, - eventWaitList, - blockedCommandsData, - hwTimeStamps, - hwPerfCounter, - previousTimestampPacketNode, - currentTimestampPacket, - preemptionMode, - blockQueue, - commandType); -} - template inline void GpgpuWalkerHelper::dispatchOnDeviceWaitlistSemaphores(LinearStream *commandStream, Device ¤tDevice, cl_uint numEventsInWaitList, const cl_event *eventWaitList) { diff --git a/runtime/command_queue/hardware_interface.h b/runtime/command_queue/hardware_interface.h new file mode 100644 index 0000000000..dcbb707359 --- /dev/null +++ b/runtime/command_queue/hardware_interface.h @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2018 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once +#include "CL/cl.h" +#include + +namespace OCLRT { + +class CommandQueue; +class DispatchInfo; +class IndirectHeap; +class Kernel; +class LinearStream; +class TimestampPacket; +enum class PreemptionMode : uint32_t; +struct HwPerfCounter; +struct HwTimeStamps; +struct KernelOperation; +struct MultiDispatchInfo; + +template +struct TagNode; + +using WALKER_HANDLE = void *; + +template +class HardwareInterface { + public: + using INTERFACE_DESCRIPTOR_DATA = typename GfxFamily::INTERFACE_DESCRIPTOR_DATA; + + static void dispatchWalker( + CommandQueue &commandQueue, + const MultiDispatchInfo &multiDispatchInfo, + cl_uint numEventsInWaitList, + const cl_event *eventWaitList, + KernelOperation **blockedCommandsData, + HwTimeStamps *hwTimeStamps, + HwPerfCounter *hwPerfCounter, + TagNode *previousTimestampPacketNode, + TimestampPacket *currentTimestampPacket, + PreemptionMode preemptionMode, + bool blockQueue, + uint32_t commandType = 0); + + static void getDefaultDshSpace( + const size_t &offsetInterfaceDescriptorTable, + CommandQueue &commandQueue, + const MultiDispatchInfo &multiDispatchInfo, + size_t &totalInterfaceDescriptorTableSize, + Kernel *parentKernel, + IndirectHeap *dsh, + LinearStream *commandStream); + + static INTERFACE_DESCRIPTOR_DATA *obtainInterfaceDescriptorData( + WALKER_HANDLE pCmdData); + + static void setOffsetCrossThreadData( + WALKER_HANDLE pCmdData, + size_t &offsetCrossThreadData, + uint32_t &interfaceDescriptorIndex); + + static void dispatchWorkarounds( + LinearStream *commandStream, + CommandQueue &commandQueue, + Kernel &kernel, + const bool &enable); + + static void dispatchProfilingPerfStartCommands( + const DispatchInfo &dispatchInfo, + const MultiDispatchInfo &multiDispatchInfo, + HwTimeStamps *hwTimeStamps, + HwPerfCounter *hwPerfCounter, + LinearStream *commandStream, + CommandQueue &commandQueue); + + static void dispatchProfilingPerfEndCommands( + HwTimeStamps *hwTimeStamps, + HwPerfCounter *hwPerfCounter, + LinearStream *commandStream, + CommandQueue &commandQueue); +}; + +} // namespace OCLRT diff --git a/runtime/command_queue/hardware_interface/hardware_interface.inl b/runtime/command_queue/hardware_interface.inl similarity index 75% rename from runtime/command_queue/hardware_interface/hardware_interface.inl rename to runtime/command_queue/hardware_interface.inl index f056a945ef..45f22d1aaa 100644 --- a/runtime/command_queue/hardware_interface/hardware_interface.inl +++ b/runtime/command_queue/hardware_interface.inl @@ -6,8 +6,9 @@ */ #pragma once -#include "runtime/command_queue/hardware_interface/hardware_interface.h" -#include "runtime/utilities/tag_allocator.h" +#include "runtime/command_queue/hardware_interface.h" +#include "runtime/helpers/kernel_commands.h" +#include "runtime/helpers/task_information.h" namespace OCLRT { @@ -19,15 +20,15 @@ void HardwareInterface::dispatchWalker( const cl_event *eventWaitList, KernelOperation **blockedCommandsData, HwTimeStamps *hwTimeStamps, - OCLRT::HwPerfCounter *hwPerfCounter, + HwPerfCounter *hwPerfCounter, TagNode *previousTimestampPacketNode, TimestampPacket *currentTimestampPacket, PreemptionMode preemptionMode, bool blockQueue, uint32_t commandType) { - OCLRT::LinearStream *commandStream = nullptr; - OCLRT::IndirectHeap *dsh = nullptr, *ioh = nullptr, *ssh = nullptr; + LinearStream *commandStream = nullptr; + IndirectHeap *dsh = nullptr, *ioh = nullptr, *ssh = nullptr; auto parentKernel = multiDispatchInfo.peekParentKernel(); for (auto &dispatchInfo : multiDispatchInfo) { @@ -245,97 +246,4 @@ void HardwareInterface::dispatchWalker( dispatchProfilingPerfEndCommands(hwTimeStamps, hwPerfCounter, commandStream, commandQueue); } -template -inline void BaseInterfaceVersion::getDefaultDshSpace( - const size_t &offsetInterfaceDescriptorTable, - CommandQueue &commandQueue, - const MultiDispatchInfo &multiDispatchInfo, - size_t &totalInterfaceDescriptorTableSize, - OCLRT::Kernel *parentKernel, - OCLRT::IndirectHeap *dsh, - OCLRT::LinearStream *commandStream) { - - size_t numDispatches = multiDispatchInfo.size(); - totalInterfaceDescriptorTableSize *= numDispatches; - - if (!parentKernel) { - dsh->getSpace(totalInterfaceDescriptorTableSize); - } else { - dsh->getSpace(commandQueue.getContext().getDefaultDeviceQueue()->getDshOffset() - dsh->getUsed()); - } -} - -template -inline typename BaseInterfaceVersion::INTERFACE_DESCRIPTOR_DATA * -BaseInterfaceVersion::obtainInterfaceDescriptorData( - WALKER_HANDLE pCmdData) { - - return nullptr; -} - -template -inline void BaseInterfaceVersion::setOffsetCrossThreadData( - WALKER_HANDLE pCmdData, - size_t &offsetCrossThreadData, - uint32_t &interfaceDescriptorIndex) { - - WALKER_TYPE *pCmd = static_cast *>(pCmdData); - pCmd->setIndirectDataStartAddress(static_cast(offsetCrossThreadData)); - pCmd->setInterfaceDescriptorOffset(interfaceDescriptorIndex++); -} - -template -inline void BaseInterfaceVersion::dispatchWorkarounds( - OCLRT::LinearStream *commandStream, - CommandQueue &commandQueue, - OCLRT::Kernel &kernel, - const bool &enable) { - - if (enable) { - PreemptionHelper::applyPreemptionWaCmdsBegin(commandStream, commandQueue.getDevice()); - // Implement enabling special WA DisableLSQCROPERFforOCL if needed - GpgpuWalkerHelper::applyWADisableLSQCROPERFforOCL(commandStream, kernel, enable); - } else { - // Implement disabling special WA DisableLSQCROPERFforOCL if needed - GpgpuWalkerHelper::applyWADisableLSQCROPERFforOCL(commandStream, kernel, enable); - PreemptionHelper::applyPreemptionWaCmdsEnd(commandStream, commandQueue.getDevice()); - } -} - -template -inline void BaseInterfaceVersion::dispatchProfilingPerfStartCommands( - const OCLRT::DispatchInfo &dispatchInfo, - const MultiDispatchInfo &multiDispatchInfo, - HwTimeStamps *hwTimeStamps, - OCLRT::HwPerfCounter *hwPerfCounter, - OCLRT::LinearStream *commandStream, - CommandQueue &commandQueue) { - - if (&dispatchInfo == &*multiDispatchInfo.begin()) { - // If hwTimeStampAlloc is passed (not nullptr), then we know that profiling is enabled - if (hwTimeStamps != nullptr) { - GpgpuWalkerHelper::dispatchProfilingCommandsStart(*hwTimeStamps, commandStream); - } - if (hwPerfCounter != nullptr) { - GpgpuWalkerHelper::dispatchPerfCountersCommandsStart(commandQueue, *hwPerfCounter, commandStream); - } - } -} - -template -inline void BaseInterfaceVersion::dispatchProfilingPerfEndCommands( - HwTimeStamps *hwTimeStamps, - OCLRT::HwPerfCounter *hwPerfCounter, - OCLRT::LinearStream *commandStream, - CommandQueue &commandQueue) { - - // If hwTimeStamps is passed (not nullptr), then we know that profiling is enabled - if (hwTimeStamps != nullptr) { - GpgpuWalkerHelper::dispatchProfilingCommandsEnd(*hwTimeStamps, commandStream); - } - if (hwPerfCounter != nullptr) { - GpgpuWalkerHelper::dispatchPerfCountersCommandsEnd(commandQueue, *hwPerfCounter, commandStream); - } -} - } // namespace OCLRT diff --git a/runtime/command_queue/hardware_interface/hardware_interface.h b/runtime/command_queue/hardware_interface/hardware_interface.h deleted file mode 100644 index 7f1466d778..0000000000 --- a/runtime/command_queue/hardware_interface/hardware_interface.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (C) 2018 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#pragma once -#include "runtime/command_queue/command_queue.h" -#include "runtime/built_ins/built_ins.h" -#include "runtime/context/context.h" -#include "runtime/event/perf_counter.h" -#include "runtime/indirect_heap/indirect_heap.h" -#include "runtime/kernel/kernel.h" -#include "runtime/command_stream/linear_stream.h" -#include "runtime/event/hw_timestamps.h" -#include "runtime/command_stream/preemption.h" -#include "runtime/device_queue/device_queue_hw.h" -#include "runtime/helpers/dispatch_info.h" -#include "runtime/helpers/kernel_commands.h" -#include "runtime/helpers/task_information.h" -#include "runtime/helpers/timestamp_packet.h" -#include "runtime/program/kernel_info.h" -#include "runtime/utilities/vec.h" - -namespace OCLRT { - -using WALKER_HANDLE = void *; - -template -class HardwareInterface { - public: - using INTERFACE_DESCRIPTOR_DATA = typename GfxFamily::INTERFACE_DESCRIPTOR_DATA; - - void dispatchWalker( - CommandQueue &commandQueue, - const MultiDispatchInfo &multiDispatchInfo, - cl_uint numEventsInWaitList, - const cl_event *eventWaitList, - KernelOperation **blockedCommandsData, - HwTimeStamps *hwTimeStamps, - OCLRT::HwPerfCounter *hwPerfCounter, - TagNode *previousTimestampPacketNode, - TimestampPacket *currentTimestampPacket, - PreemptionMode preemptionMode, - bool blockQueue, - uint32_t commandType = 0); - - virtual void getDefaultDshSpace( - const size_t &offsetInterfaceDescriptorTable, - CommandQueue &commandQueue, - const MultiDispatchInfo &multiDispatchInfo, - size_t &totalInterfaceDescriptorTableSize, - OCLRT::Kernel *parentKernel, - OCLRT::IndirectHeap *dsh, - OCLRT::LinearStream *commandStream) = 0; - - virtual INTERFACE_DESCRIPTOR_DATA *obtainInterfaceDescriptorData( - WALKER_HANDLE pCmdData) = 0; - - virtual void setOffsetCrossThreadData( - WALKER_HANDLE pCmdData, - size_t &offsetCrossThreadData, - uint32_t &interfaceDescriptorIndex) = 0; - - virtual void dispatchWorkarounds( - OCLRT::LinearStream *commandStream, - CommandQueue &commandQueue, - OCLRT::Kernel &kernel, - const bool &enable) = 0; - - virtual void dispatchProfilingPerfStartCommands( - const OCLRT::DispatchInfo &dispatchInfo, - const MultiDispatchInfo &multiDispatchInfo, - HwTimeStamps *hwTimeStamps, - OCLRT::HwPerfCounter *hwPerfCounter, - OCLRT::LinearStream *commandStream, - CommandQueue &commandQueue) = 0; - - virtual void dispatchProfilingPerfEndCommands( - HwTimeStamps *hwTimeStamps, - OCLRT::HwPerfCounter *hwPerfCounter, - OCLRT::LinearStream *commandStream, - CommandQueue &commandQueue) = 0; -}; - -template -class BaseInterfaceVersion : public HardwareInterface { - using INTERFACE_DESCRIPTOR_DATA = typename GfxFamily::INTERFACE_DESCRIPTOR_DATA; - - void getDefaultDshSpace( - const size_t &offsetInterfaceDescriptorTable, - CommandQueue &commandQueue, - const MultiDispatchInfo &multiDispatchInfo, - size_t &totalInterfaceDescriptorTableSize, - OCLRT::Kernel *parentKernel, - OCLRT::IndirectHeap *dsh, - OCLRT::LinearStream *commandStream) override; - - INTERFACE_DESCRIPTOR_DATA *obtainInterfaceDescriptorData( - WALKER_HANDLE pCmdData) override; - - void setOffsetCrossThreadData( - WALKER_HANDLE pCmdData, - size_t &offsetCrossThreadData, - uint32_t &interfaceDescriptorIndex) override; - - void dispatchWorkarounds( - OCLRT::LinearStream *commandStream, - CommandQueue &commandQueue, - OCLRT::Kernel &kernel, - const bool &enable) override; - - void dispatchProfilingPerfStartCommands( - const OCLRT::DispatchInfo &dispatchInfo, - const MultiDispatchInfo &multiDispatchInfo, - HwTimeStamps *hwTimeStamps, - OCLRT::HwPerfCounter *hwPerfCounter, - OCLRT::LinearStream *commandStream, - CommandQueue &commandQueue) override; - - void dispatchProfilingPerfEndCommands( - HwTimeStamps *hwTimeStamps, - OCLRT::HwPerfCounter *hwPerfCounter, - OCLRT::LinearStream *commandStream, - CommandQueue &commandQueue) override; -}; - -} // namespace OCLRT diff --git a/runtime/command_queue/hardware_interface_base.inl b/runtime/command_queue/hardware_interface_base.inl new file mode 100644 index 0000000000..e03f39199a --- /dev/null +++ b/runtime/command_queue/hardware_interface_base.inl @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2018 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once +#include "runtime/command_queue/hardware_interface.h" + +namespace OCLRT { + +template +inline void HardwareInterface::getDefaultDshSpace( + const size_t &offsetInterfaceDescriptorTable, + CommandQueue &commandQueue, + const MultiDispatchInfo &multiDispatchInfo, + size_t &totalInterfaceDescriptorTableSize, + Kernel *parentKernel, + IndirectHeap *dsh, + LinearStream *commandStream) { + + size_t numDispatches = multiDispatchInfo.size(); + totalInterfaceDescriptorTableSize *= numDispatches; + + if (!parentKernel) { + dsh->getSpace(totalInterfaceDescriptorTableSize); + } else { + dsh->getSpace(commandQueue.getContext().getDefaultDeviceQueue()->getDshOffset() - dsh->getUsed()); + } +} + +template +inline typename HardwareInterface::INTERFACE_DESCRIPTOR_DATA * +HardwareInterface::obtainInterfaceDescriptorData( + WALKER_HANDLE pCmdData) { + + return nullptr; +} + +template +inline void HardwareInterface::setOffsetCrossThreadData( + WALKER_HANDLE pCmdData, + size_t &offsetCrossThreadData, + uint32_t &interfaceDescriptorIndex) { + + WALKER_TYPE *pCmd = static_cast *>(pCmdData); + pCmd->setIndirectDataStartAddress(static_cast(offsetCrossThreadData)); + pCmd->setInterfaceDescriptorOffset(interfaceDescriptorIndex++); +} + +template +inline void HardwareInterface::dispatchWorkarounds( + LinearStream *commandStream, + CommandQueue &commandQueue, + Kernel &kernel, + const bool &enable) { + + if (enable) { + PreemptionHelper::applyPreemptionWaCmdsBegin(commandStream, commandQueue.getDevice()); + // Implement enabling special WA DisableLSQCROPERFforOCL if needed + GpgpuWalkerHelper::applyWADisableLSQCROPERFforOCL(commandStream, kernel, enable); + } else { + // Implement disabling special WA DisableLSQCROPERFforOCL if needed + GpgpuWalkerHelper::applyWADisableLSQCROPERFforOCL(commandStream, kernel, enable); + PreemptionHelper::applyPreemptionWaCmdsEnd(commandStream, commandQueue.getDevice()); + } +} + +template +inline void HardwareInterface::dispatchProfilingPerfStartCommands( + const DispatchInfo &dispatchInfo, + const MultiDispatchInfo &multiDispatchInfo, + HwTimeStamps *hwTimeStamps, + HwPerfCounter *hwPerfCounter, + LinearStream *commandStream, + CommandQueue &commandQueue) { + + if (&dispatchInfo == &*multiDispatchInfo.begin()) { + // If hwTimeStampAlloc is passed (not nullptr), then we know that profiling is enabled + if (hwTimeStamps != nullptr) { + GpgpuWalkerHelper::dispatchProfilingCommandsStart(*hwTimeStamps, commandStream); + } + if (hwPerfCounter != nullptr) { + GpgpuWalkerHelper::dispatchPerfCountersCommandsStart(commandQueue, *hwPerfCounter, commandStream); + } + } +} + +template +inline void HardwareInterface::dispatchProfilingPerfEndCommands( + HwTimeStamps *hwTimeStamps, + HwPerfCounter *hwPerfCounter, + LinearStream *commandStream, + CommandQueue &commandQueue) { + + // If hwTimeStamps is passed (not nullptr), then we know that profiling is enabled + if (hwTimeStamps != nullptr) { + GpgpuWalkerHelper::dispatchProfilingCommandsEnd(*hwTimeStamps, commandStream); + } + if (hwPerfCounter != nullptr) { + GpgpuWalkerHelper::dispatchPerfCountersCommandsEnd(commandQueue, *hwPerfCounter, commandStream); + } +} + +} // namespace OCLRT diff --git a/runtime/gen10/gpgpu_walker_gen10.cpp b/runtime/gen10/gpgpu_walker_gen10.cpp index cb1ed9409d..64f831876c 100644 --- a/runtime/gen10/gpgpu_walker_gen10.cpp +++ b/runtime/gen10/gpgpu_walker_gen10.cpp @@ -8,9 +8,14 @@ #include "runtime/gen10/hw_info.h" #include "runtime/command_queue/gpgpu_walker.h" #include "runtime/command_queue/gpgpu_walker.inl" +#include "runtime/command_queue/hardware_interface.h" +#include "runtime/command_queue/hardware_interface.inl" +#include "runtime/command_queue/hardware_interface_base.inl" namespace OCLRT { +template class HardwareInterface; + template class GpgpuWalkerHelper; template struct EnqueueOperation; diff --git a/runtime/gen10/hw_cmds.h b/runtime/gen10/hw_cmds.h index 77ee5c7f6a..73adb8068e 100644 --- a/runtime/gen10/hw_cmds.h +++ b/runtime/gen10/hw_cmds.h @@ -16,19 +16,15 @@ struct CnlParse; namespace OCLRT { -template -class BaseInterfaceVersion; - struct GEN10 { #include "runtime/gen10/hw_cmds_generated_patched.h" #include "runtime/gen10/hw_cmds_generated.h" }; struct CNLFamily : public GEN10 { - typedef CnlParse PARSE; - typedef CNLFamily GfxFamily; - typedef GPGPU_WALKER WALKER_TYPE; - using HARDWARE_INTERFACE = BaseInterfaceVersion; + using PARSE = CnlParse; + using GfxFamily = CNLFamily; + using WALKER_TYPE = GPGPU_WALKER; static const GPGPU_WALKER cmdInitGpgpuWalker; static const INTERFACE_DESCRIPTOR_DATA cmdInitInterfaceDescriptorData; static const MEDIA_INTERFACE_DESCRIPTOR_LOAD cmdInitMediaInterfaceDescriptorLoad; diff --git a/runtime/gen8/gpgpu_walker_gen8.cpp b/runtime/gen8/gpgpu_walker_gen8.cpp index b4f11d598c..20ab2f41ff 100644 --- a/runtime/gen8/gpgpu_walker_gen8.cpp +++ b/runtime/gen8/gpgpu_walker_gen8.cpp @@ -8,6 +8,9 @@ #include "runtime/gen8/hw_info.h" #include "runtime/command_queue/gpgpu_walker.h" #include "runtime/command_queue/gpgpu_walker.inl" +#include "runtime/command_queue/hardware_interface.h" +#include "runtime/command_queue/hardware_interface.inl" +#include "runtime/command_queue/hardware_interface_base.inl" namespace OCLRT { @@ -51,6 +54,8 @@ size_t GpgpuWalkerHelper::getSizeForWADisableLSQCROPERFforOCL(const K return n; } +template class HardwareInterface; + template class GpgpuWalkerHelper; template struct EnqueueOperation; diff --git a/runtime/gen8/hw_cmds_base.h b/runtime/gen8/hw_cmds_base.h index 3ee6de72f2..cd75a6e82e 100644 --- a/runtime/gen8/hw_cmds_base.h +++ b/runtime/gen8/hw_cmds_base.h @@ -16,18 +16,14 @@ struct BdwParse; namespace OCLRT { -template -class BaseInterfaceVersion; - struct GEN8 { #include "runtime/gen8/hw_cmds_generated.h" #include "runtime/gen8/hw_cmds_generated_patched.h" }; struct BDWFamily : public GEN8 { - typedef BdwParse PARSE; - typedef BDWFamily GfxFamily; - typedef GPGPU_WALKER WALKER_TYPE; - using HARDWARE_INTERFACE = BaseInterfaceVersion; + using PARSE = BdwParse; + using GfxFamily = BDWFamily; + using WALKER_TYPE = GPGPU_WALKER; static const GPGPU_WALKER cmdInitGpgpuWalker; static const INTERFACE_DESCRIPTOR_DATA cmdInitInterfaceDescriptorData; static const MEDIA_INTERFACE_DESCRIPTOR_LOAD cmdInitMediaInterfaceDescriptorLoad; diff --git a/runtime/gen9/gpgpu_walker_gen9.cpp b/runtime/gen9/gpgpu_walker_gen9.cpp index 5af18bbacc..d6e8e222a6 100644 --- a/runtime/gen9/gpgpu_walker_gen9.cpp +++ b/runtime/gen9/gpgpu_walker_gen9.cpp @@ -8,6 +8,9 @@ #include "runtime/gen9/hw_cmds_base.h" #include "runtime/command_queue/gpgpu_walker.h" #include "runtime/command_queue/gpgpu_walker.inl" +#include "runtime/command_queue/hardware_interface.h" +#include "runtime/command_queue/hardware_interface.inl" +#include "runtime/command_queue/hardware_interface_base.inl" namespace OCLRT { @@ -51,6 +54,8 @@ size_t GpgpuWalkerHelper::getSizeForWADisableLSQCROPERFforOCL(const K return n; } +template class HardwareInterface; + template class GpgpuWalkerHelper; template struct EnqueueOperation; diff --git a/runtime/gen9/hw_cmds_base.h b/runtime/gen9/hw_cmds_base.h index 5f9c3b7ed6..c7ae1159e4 100644 --- a/runtime/gen9/hw_cmds_base.h +++ b/runtime/gen9/hw_cmds_base.h @@ -16,19 +16,15 @@ struct SklParse; namespace OCLRT { -template -class BaseInterfaceVersion; - struct GEN9 { #include "runtime/gen9/hw_cmds_generated_patched.h" #include "runtime/gen9/hw_cmds_generated.h" }; struct SKLFamily : public GEN9 { - typedef SklParse PARSE; - typedef SKLFamily GfxFamily; - typedef GPGPU_WALKER WALKER_TYPE; - using HARDWARE_INTERFACE = BaseInterfaceVersion; + using PARSE = SklParse; + using GfxFamily = SKLFamily; + using WALKER_TYPE = GPGPU_WALKER; static const GPGPU_WALKER cmdInitGpgpuWalker; static const INTERFACE_DESCRIPTOR_DATA cmdInitInterfaceDescriptorData; static const MEDIA_INTERFACE_DESCRIPTOR_LOAD cmdInitMediaInterfaceDescriptorLoad; diff --git a/unit_tests/command_queue/dispatch_walker_tests.cpp b/unit_tests/command_queue/dispatch_walker_tests.cpp index 1f64e39870..5a7e185300 100644 --- a/unit_tests/command_queue/dispatch_walker_tests.cpp +++ b/unit_tests/command_queue/dispatch_walker_tests.cpp @@ -7,6 +7,7 @@ #include "test.h" #include "runtime/command_queue/gpgpu_walker.h" +#include "runtime/command_queue/hardware_interface.h" #include "runtime/event/perf_counter.h" #include "runtime/helpers/aligned_memory.h" #include "runtime/helpers/kernel_commands.h" @@ -128,7 +129,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DispatchWalkerTest, shouldntChangeCommandStreamMemor DispatchInfo dispatchInfo(const_cast(&kernel), dimensions, workItems, nullptr, globalOffsets); MultiDispatchInfo multiDispatchInfo; multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -177,7 +178,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DispatchWalkerTest, noLocalIdsShouldntCrash) { DispatchInfo dispatchInfo(const_cast(&kernel), dimensions, workItems, nullptr, globalOffsets); MultiDispatchInfo multiDispatchInfo; multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -208,7 +209,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterWorkDimensionswithDefaultLwsAlgorithm) DispatchInfo dispatchInfo(const_cast(&kernel), dimension, workItems, nullptr, globalOffsets); MultiDispatchInfo multiDispatchInfo; multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -240,7 +241,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterWorkDimensionswithSquaredLwsAlgorithm) DispatchInfo dispatchInfo(const_cast(&kernel), dimension, workItems, nullptr, globalOffsets); MultiDispatchInfo multiDispatchInfo; multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -270,7 +271,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterWorkDimensionswithNDLwsAlgorithm) { DispatchInfo dispatchInfo(const_cast(&kernel), dimension, workItems, nullptr, globalOffsets); MultiDispatchInfo multiDispatchInfo; multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -301,7 +302,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterWorkDimensionswithOldLwsAlgorithm) { DispatchInfo dispatchInfo(const_cast(&kernel), dimension, workItems, nullptr, globalOffsets); MultiDispatchInfo multiDispatchInfo; multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -332,7 +333,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterNumWorkGroups) { DispatchInfo dispatchInfo(const_cast(&kernel), dimensions, workItems, workGroupSize, globalOffsets); MultiDispatchInfo multiDispatchInfo; multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -365,7 +366,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterNoLocalWorkSizeWithOutComputeND) { DispatchInfo dispatchInfo(const_cast(&kernel), dimensions, workItems, nullptr, globalOffsets); MultiDispatchInfo multiDispatchInfo; multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -397,7 +398,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterNoLocalWorkSizeWithComputeND) { DispatchInfo dispatchInfo(const_cast(&kernel), dimensions, workItems, nullptr, globalOffsets); MultiDispatchInfo multiDispatchInfo; multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -430,7 +431,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterNoLocalWorkSizeWithComputeSquared) { DispatchInfo dispatchInfo(const_cast(&kernel), dimensions, workItems, nullptr, globalOffsets); MultiDispatchInfo multiDispatchInfo; multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -463,7 +464,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterNoLocalWorkSizeWithOutComputeSquaredAn DispatchInfo dispatchInfo(const_cast(&kernel), dimensions, workItems, nullptr, globalOffsets); MultiDispatchInfo multiDispatchInfo; multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -494,7 +495,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterLocalWorkSize) { DispatchInfo dispatchInfo(const_cast(&kernel), dimensions, workItems, workGroupSize, globalOffsets); MultiDispatchInfo multiDispatchInfo; multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -528,7 +529,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterLocalWorkSizes) { DispatchInfo dispatchInfo(const_cast(&kernel), dimensions, workItems, workGroupSize, globalOffsets); MultiDispatchInfo multiDispatchInfo; multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -566,7 +567,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterLocalWorkSizeForSplitKernel) { MockMultiDispatchInfo multiDispatchInfo(std::vector({&di1, &di2})); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -618,7 +619,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterLocalWorkSizesForSplitWalker) { multiDispatchInfo.push(di1); multiDispatchInfo.push(di2); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -674,7 +675,7 @@ HWTEST_F(DispatchWalkerTest, dispatchWalkerDoesntConsumeCommandStreamWhenQueueIs DispatchInfo dispatchInfo(const_cast(&kernel), dimensions, workItems, workGroupSize, globalOffsets); MultiDispatchInfo multiDispatchInfo; multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -715,7 +716,7 @@ HWTEST_F(DispatchWalkerTest, dispatchWalkerShouldGetRequiredHeapSizesFromKernelW DispatchInfo dispatchInfo(const_cast(&kernel), dimensions, workItems, workGroupSize, globalOffsets); MultiDispatchInfo multiDispatchInfo; multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -754,7 +755,7 @@ HWTEST_F(DispatchWalkerTest, dispatchWalkerShouldGetRequiredHeapSizesFromMdiWhen KernelOperation *blockedCommandsData = nullptr; - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -788,7 +789,7 @@ HWTEST_F(DispatchWalkerTest, dispatchWalkerWithMultipleDispatchInfo) { MockMultiDispatchInfo multiDispatchInfo(std::vector({&kernel1, &kernel2})); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -831,7 +832,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DispatchWalkerTest, dispatchWalkerWithMultipleDispat indirectHeap.align(KernelCommandsHelper::alignInterfaceDescriptorData); auto dshBeforeMultiDisptach = indirectHeap.getUsed(); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -917,7 +918,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DispatchWalkerTest, dispatchWalkerWithMultipleDispat // create commandStream auto &cmdStream = pCmdQ->getCS(0); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -964,7 +965,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DispatchWalkerTest, dispatchWalkerWithMultipleDispat // create commandStream auto &cmdStream = pCmdQ->getCS(0); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -1016,7 +1017,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DispatchWalkerTest, dispatchWalkerWithMultipleDispat // create commandStream auto &cmdStream = pCmdQ->getCS(0); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -1069,7 +1070,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DispatchWalkerTest, givenMultiDispatchWhenWhiteliste DispatchInfo di2(&kernel, 1, Vec3(1, 1, 1), Vec3(1, 1, 1), Vec3(0, 0, 0)); MockMultiDispatchInfo multiDispatchInfo(std::vector({&di1, &di2})); - GpgpuWalkerHelper::dispatchWalker(*pCmdQ, multiDispatchInfo, 0, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, pDevice->getPreemptionMode(), false); + HardwareInterface::dispatchWalker(*pCmdQ, multiDispatchInfo, 0, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, pDevice->getPreemptionMode(), false); hwParser.parseCommands(cmdStream, 0); diff --git a/unit_tests/execution_model/parent_kernel_dispatch_tests.cpp b/unit_tests/execution_model/parent_kernel_dispatch_tests.cpp index 3d185f6844..e2bd9069e1 100644 --- a/unit_tests/execution_model/parent_kernel_dispatch_tests.cpp +++ b/unit_tests/execution_model/parent_kernel_dispatch_tests.cpp @@ -6,6 +6,7 @@ */ #include "runtime/command_queue/enqueue_kernel.h" +#include "runtime/command_queue/hardware_interface.h" #include "runtime/event/perf_counter.h" #include "runtime/kernel/kernel.h" #include "runtime/sampler/sampler.h" @@ -41,7 +42,7 @@ HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenQueueIsNotBlockedThenDev DispatchInfo dispatchInfo(pKernel, 1, workItems, nullptr, globalOffsets); MultiDispatchInfo multiDispatchInfo(pKernel); multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -98,7 +99,7 @@ HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenQueueIsNotBlockedThenDef DispatchInfo dispatchInfo(pKernel, 1, workItems, nullptr, globalOffsets); multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -125,7 +126,7 @@ HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenQueueIsNotBlockedThenSSH MockMultiDispatchInfo multiDispatchInfo(pKernel); DispatchInfo dispatchInfo(pKernel, 1, workItems, nullptr, globalOffsets); multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -162,7 +163,7 @@ HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenQueueIsBlockedThenSSHSiz DispatchInfo dispatchInfo(pKernel, 1, workItems, nullptr, globalOffsets); multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -261,7 +262,7 @@ HWTEST_F(MockParentKernelDispatch, GivenBlockedQueueWhenParentKernelIsDispatched DispatchInfo dispatchInfo(mockParentKernel, 1, workItems, nullptr, globalOffsets); MultiDispatchInfo multiDispatchInfo(mockParentKernel); multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -296,7 +297,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, MockParentKernelDispatch, GivenParentKernelWhenDispa DispatchInfo dispatchInfo(mockParentKernel, 1, workItems, nullptr, globalOffsets); MultiDispatchInfo multiDispatchInfo(mockParentKernel); multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -354,7 +355,7 @@ HWTEST_F(MockParentKernelDispatch, GivenUsedSSHHeapWhenParentKernelIsDispatchedT DispatchInfo dispatchInfo(mockParentKernel, 1, workItems, nullptr, globalOffsets); MultiDispatchInfo multiDispatchInfo(mockParentKernel); multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, @@ -391,7 +392,7 @@ HWTEST_F(MockParentKernelDispatch, GivenNotUsedSSHHeapWhenParentKernelIsDispatch DispatchInfo dispatchInfo(mockParentKernel, 1, workItems, nullptr, globalOffsets); MultiDispatchInfo multiDispatchInfo; multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, 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 648db98922..6a446dcb89 100644 --- a/unit_tests/execution_model/submit_blocked_parent_kernel_tests.cpp +++ b/unit_tests/execution_model/submit_blocked_parent_kernel_tests.cpp @@ -6,6 +6,7 @@ */ #include "runtime/command_queue/gpgpu_walker.h" +#include "runtime/command_queue/hardware_interface.h" #include "runtime/event/hw_timestamps.h" #include "runtime/helpers/kernel_commands.h" #include "runtime/helpers/task_information.h" @@ -419,7 +420,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelCommandQueueFixture, givenBlockedCommand DispatchInfo dispatchInfo(parentKernel.get(), 1, workItems, nullptr, globalOffsets); MultiDispatchInfo multiDispatchInfo(parentKernel.get()); multiDispatchInfo.push(dispatchInfo); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, 0, diff --git a/unit_tests/helpers/timestamp_packet_tests.cpp b/unit_tests/helpers/timestamp_packet_tests.cpp index 90cdb4a5a7..aa48f1583a 100644 --- a/unit_tests/helpers/timestamp_packet_tests.cpp +++ b/unit_tests/helpers/timestamp_packet_tests.cpp @@ -6,6 +6,7 @@ */ #include "runtime/command_queue/gpgpu_walker.h" +#include "runtime/command_queue/hardware_interface.h" #include "runtime/helpers/options.h" #include "runtime/helpers/timestamp_packet.h" #include "runtime/utilities/tag_allocator.h" @@ -247,7 +248,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, TimestampPacketTests, givenTimestampPacketWhenDispat auto &cmdStream = mockCmdQ->getCS(0); - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *mockCmdQ, multiDispatchInfo, 0, @@ -505,7 +506,7 @@ HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledWhenDispatchingTh cl_event waitlist[] = {&event1, &event2, &event3, &event4, &event5, &event6}; - GpgpuWalkerHelper::dispatchWalker( + HardwareInterface::dispatchWalker( *mockCmdQ, multiDispatchInfo, eventsOnWaitlist, diff --git a/unit_tests/libult/mock_gfx_family.h b/unit_tests/libult/mock_gfx_family.h index 4a1c423835..cd53d36ed8 100644 --- a/unit_tests/libult/mock_gfx_family.h +++ b/unit_tests/libult/mock_gfx_family.h @@ -11,9 +11,6 @@ namespace OCLRT { -template -class BaseInterfaceVersion; - extern HwHelper *hwHelperFactory[IGFX_MAX_CORE]; struct GENX { @@ -374,8 +371,7 @@ struct GENX { inline void setMemoryAddressHigh(uint32_t) {} } MI_ATOMIC; - using HARDWARE_INTERFACE = BaseInterfaceVersion; - typedef GPGPU_WALKER WALKER_TYPE; + using WALKER_TYPE = GPGPU_WALKER; static GPGPU_WALKER cmdInitGpgpuWalker; static INTERFACE_DESCRIPTOR_DATA cmdInitInterfaceDescriptorData; static MEDIA_STATE_FLUSH cmdInitMediaStateFlush;