Skip to content

Commit 38915c6

Browse files
Refactor performance counters interface
Signed-off-by: Zbigniew Zdanowicz <[email protected]>
1 parent f1c24dd commit 38915c6

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

opencl/source/command_queue/gpgpu_walker_bdw_and_later.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ size_t EnqueueOperation<GfxFamily>::getSizeRequiredCSKernel(bool reserveProfilin
192192
if (reserveProfilingCmdsSpace) {
193193
size += 2 * sizeof(PIPE_CONTROL) + 2 * sizeof(typename GfxFamily::MI_STORE_REGISTER_MEM);
194194
}
195-
size += PerformanceCounters::getGpuCommandsSize(commandQueue, reservePerfCounters);
195+
size += PerformanceCounters::getGpuCommandsSize(commandQueue.getPerfCounters(), commandQueue.getGpgpuEngine().osContext->getEngineType(), reservePerfCounters);
196196
size += GpgpuWalkerHelper<GfxFamily>::getSizeForWADisableLSQCROPERFforOCL(pKernel);
197197
size += GpgpuWalkerHelper<GfxFamily>::getSizeForWaDisableRccRhwoOptimization(pKernel);
198198

opencl/source/command_queue/gpgpu_walker_xehp_and_later.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ size_t EnqueueOperation<GfxFamily>::getSizeRequiredCSKernel(bool reserveProfilin
159159
size += static_cast<size_t>(ImplicitScalingDispatch<GfxFamily>::getSize(false, staticPartitioning, devices, groupStart, groupCount));
160160
}
161161

162-
size += PerformanceCounters::getGpuCommandsSize(commandQueue, reservePerfCounters);
162+
size += PerformanceCounters::getGpuCommandsSize(commandQueue.getPerfCounters(), commandQueue.getGpgpuEngine().osContext->getEngineType(), reservePerfCounters);
163163

164164
return size;
165165
}

shared/source/os_interface/performance_counters.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,11 @@ void PerformanceCounters::deleteQuery(QueryHandle_1_0 &handle) {
162162
//////////////////////////////////////////////////////
163163
// PerformanceCounters::getGpuCommandsSize
164164
//////////////////////////////////////////////////////
165-
uint32_t PerformanceCounters::getGpuCommandsSize(CommandQueue &commandQueue, const bool reservePerfCounters) {
166-
165+
uint32_t PerformanceCounters::getGpuCommandsSize(PerformanceCounters *performanceCounters, aub_stream::EngineType engineType, const bool reservePerfCounters) {
167166
uint32_t size = 0;
168167

169168
if (reservePerfCounters) {
170-
171-
const auto performanceCounters = commandQueue.getPerfCounters();
172-
const auto commandBufferType = EngineHelpers::isCcs(commandQueue.getGpgpuEngine().osContext->getEngineType())
169+
const auto commandBufferType = EngineHelpers::isCcs(engineType)
173170
? MetricsLibraryApi::GpuCommandBufferType::Compute
174171
: MetricsLibraryApi::GpuCommandBufferType::Render;
175172

shared/source/os_interface/performance_counters.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include "shared/source/utilities/metrics_library.h"
1010
#include "shared/source/utilities/perf_counter.h"
1111

12+
#include "engine_node.h"
13+
1214
#include <mutex>
1315

1416
namespace NEO {
@@ -17,7 +19,6 @@ namespace NEO {
1719
// Forward declaration.
1820
//////////////////////////////////////////////////////
1921
class TagNodeBase;
20-
class CommandQueue;
2122

2223
//////////////////////////////////////////////////////
2324
// Performance counters implementation.
@@ -47,7 +48,7 @@ class PerformanceCounters {
4748
//////////////////////////////////////////////////////
4849
// Gpu commands.
4950
//////////////////////////////////////////////////////
50-
static uint32_t getGpuCommandsSize(CommandQueue &commandQueue, const bool reservePerfCounters);
51+
static uint32_t getGpuCommandsSize(PerformanceCounters *performanceCounters, aub_stream::EngineType engineType, const bool reservePerfCounters);
5152
uint32_t getGpuCommandsSize(const MetricsLibraryApi::GpuCommandBufferType commandBufferType, const bool begin);
5253
bool getGpuCommands(const MetricsLibraryApi::GpuCommandBufferType commandBufferType, TagNodeBase &performanceCounters, const bool begin, const uint32_t bufferSize, void *pBuffer);
5354

0 commit comments

Comments
 (0)