diff --git a/opencl/source/command_queue/gpgpu_walker_bdw_and_later.inl b/opencl/source/command_queue/gpgpu_walker_bdw_and_later.inl index b9907cdbb5..50ca779a16 100644 --- a/opencl/source/command_queue/gpgpu_walker_bdw_and_later.inl +++ b/opencl/source/command_queue/gpgpu_walker_bdw_and_later.inl @@ -192,7 +192,7 @@ size_t EnqueueOperation::getSizeRequiredCSKernel(bool reserveProfilin if (reserveProfilingCmdsSpace) { size += 2 * sizeof(PIPE_CONTROL) + 2 * sizeof(typename GfxFamily::MI_STORE_REGISTER_MEM); } - size += PerformanceCounters::getGpuCommandsSize(commandQueue, reservePerfCounters); + size += PerformanceCounters::getGpuCommandsSize(commandQueue.getPerfCounters(), commandQueue.getGpgpuEngine().osContext->getEngineType(), reservePerfCounters); size += GpgpuWalkerHelper::getSizeForWADisableLSQCROPERFforOCL(pKernel); size += GpgpuWalkerHelper::getSizeForWaDisableRccRhwoOptimization(pKernel); diff --git a/opencl/source/command_queue/gpgpu_walker_xehp_and_later.inl b/opencl/source/command_queue/gpgpu_walker_xehp_and_later.inl index 2313278937..27f068804f 100644 --- a/opencl/source/command_queue/gpgpu_walker_xehp_and_later.inl +++ b/opencl/source/command_queue/gpgpu_walker_xehp_and_later.inl @@ -159,7 +159,7 @@ size_t EnqueueOperation::getSizeRequiredCSKernel(bool reserveProfilin size += static_cast(ImplicitScalingDispatch::getSize(false, staticPartitioning, devices, groupStart, groupCount)); } - size += PerformanceCounters::getGpuCommandsSize(commandQueue, reservePerfCounters); + size += PerformanceCounters::getGpuCommandsSize(commandQueue.getPerfCounters(), commandQueue.getGpgpuEngine().osContext->getEngineType(), reservePerfCounters); return size; } diff --git a/shared/source/os_interface/performance_counters.cpp b/shared/source/os_interface/performance_counters.cpp index 82a5cb2039..3729f7914d 100644 --- a/shared/source/os_interface/performance_counters.cpp +++ b/shared/source/os_interface/performance_counters.cpp @@ -162,14 +162,11 @@ void PerformanceCounters::deleteQuery(QueryHandle_1_0 &handle) { ////////////////////////////////////////////////////// // PerformanceCounters::getGpuCommandsSize ////////////////////////////////////////////////////// -uint32_t PerformanceCounters::getGpuCommandsSize(CommandQueue &commandQueue, const bool reservePerfCounters) { - +uint32_t PerformanceCounters::getGpuCommandsSize(PerformanceCounters *performanceCounters, aub_stream::EngineType engineType, const bool reservePerfCounters) { uint32_t size = 0; if (reservePerfCounters) { - - const auto performanceCounters = commandQueue.getPerfCounters(); - const auto commandBufferType = EngineHelpers::isCcs(commandQueue.getGpgpuEngine().osContext->getEngineType()) + const auto commandBufferType = EngineHelpers::isCcs(engineType) ? MetricsLibraryApi::GpuCommandBufferType::Compute : MetricsLibraryApi::GpuCommandBufferType::Render; diff --git a/shared/source/os_interface/performance_counters.h b/shared/source/os_interface/performance_counters.h index 1072d638da..1fa493ebc4 100644 --- a/shared/source/os_interface/performance_counters.h +++ b/shared/source/os_interface/performance_counters.h @@ -9,6 +9,8 @@ #include "shared/source/utilities/metrics_library.h" #include "shared/source/utilities/perf_counter.h" +#include "engine_node.h" + #include namespace NEO { @@ -17,7 +19,6 @@ namespace NEO { // Forward declaration. ////////////////////////////////////////////////////// class TagNodeBase; -class CommandQueue; ////////////////////////////////////////////////////// // Performance counters implementation. @@ -47,7 +48,7 @@ class PerformanceCounters { ////////////////////////////////////////////////////// // Gpu commands. ////////////////////////////////////////////////////// - static uint32_t getGpuCommandsSize(CommandQueue &commandQueue, const bool reservePerfCounters); + static uint32_t getGpuCommandsSize(PerformanceCounters *performanceCounters, aub_stream::EngineType engineType, const bool reservePerfCounters); uint32_t getGpuCommandsSize(const MetricsLibraryApi::GpuCommandBufferType commandBufferType, const bool begin); bool getGpuCommands(const MetricsLibraryApi::GpuCommandBufferType commandBufferType, TagNodeBase &performanceCounters, const bool begin, const uint32_t bufferSize, void *pBuffer);