Skip to content

Commit ee79d3f

Browse files
Move debugWriter declaration to GPUReconstructionCPU.h
1 parent 7005e1b commit ee79d3f

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

GPU/GPUTracking/Base/GPUReconstruction.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -424,17 +424,6 @@ class GPUReconstruction
424424
void debugInit();
425425
void debugExit();
426426

427-
struct debugWriter {
428-
debugWriter(std::string filenameCSV, bool markdown, uint32_t statNEvents);
429-
void header();
430-
void row(char type, uint32_t count, std::string name, double gpu_time, double cpu_time, double total_time, std::size_t memSize, std::string nEventReport = "");
431-
432-
private:
433-
std::ofstream streamCSV;
434-
bool mMarkdown;
435-
uint32_t mStatNEvents;
436-
};
437-
438427
static GPUReconstruction* GPUReconstruction_Create_CPU(const GPUSettingsDeviceBackend& cfg);
439428
};
440429

GPU/GPUTracking/Base/GPUReconstructionCPU.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
#define GPURECONSTRUCTIONICPU_H
1717

1818
#include "GPUReconstructionProcessing.h"
19+
#include <fstream>
1920
#include <stdexcept>
21+
#include <string>
2022
#include <vector>
2123

2224
namespace Ort
@@ -100,6 +102,17 @@ class GPUReconstructionCPU : public GPUReconstructionProcessing::KernelInterface
100102
size_t TransferMemoryResourcesHelper(GPUProcessor* proc, int32_t stream, bool all, bool toGPU);
101103
template <class S, int32_t I = 0, typename... Args>
102104
void runKernelInterface(krnlSetup&& setup, Args const&... args);
105+
106+
struct debugWriter {
107+
debugWriter(std::string filenameCSV, bool markdown, uint32_t statNEvents);
108+
void header();
109+
void row(char type, uint32_t count, std::string name, double gpu_time, double cpu_time, double total_time, std::size_t memSize, std::string nEventReport = "");
110+
111+
private:
112+
std::ofstream streamCSV;
113+
bool mMarkdown;
114+
uint32_t mStatNEvents;
115+
};
103116
};
104117

105118
} // namespace o2::gpu

GPU/GPUTracking/Base/GPUReconstructionDebug.cxx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
/// \author David Rohr
1414

1515
#include "GPUReconstruction.h"
16+
#include "GPUReconstructionCPU.h"
1617
#include "GPULogging.h"
1718
#include "GPUSettings.h"
1819

@@ -189,14 +190,14 @@ bool GPUReconstruction::triggerDebugDump()
189190
return false;
190191
}
191192

192-
GPUReconstruction::debugWriter::debugWriter(std::string filenameCSV, bool markdown, uint32_t statNEvents) : mMarkdown{markdown}, mStatNEvents{statNEvents}
193+
GPUReconstructionCPU::debugWriter::debugWriter(std::string filenameCSV, bool markdown, uint32_t statNEvents) : mMarkdown{markdown}, mStatNEvents{statNEvents}
193194
{
194195
if (!filenameCSV.empty()) {
195196
streamCSV.open(filenameCSV, std::ios::out | std::ios::app);
196197
}
197198
}
198199

199-
void GPUReconstruction::debugWriter::header()
200+
void GPUReconstructionCPU::debugWriter::header()
200201
{
201202
if (streamCSV.is_open() && !streamCSV.tellp()) {
202203
streamCSV << "type,count,name,gpu (us),cpu (us),cpu/total,total (us),GB/s,bytes,bytes/call\n";
@@ -208,7 +209,7 @@ void GPUReconstruction::debugWriter::header()
208209
}
209210
}
210211

211-
void GPUReconstruction::debugWriter::row(char type, uint32_t count, std::string name, double gpu_time, double cpu_time, double total_time, std::size_t memSize, std::string nEventReport)
212+
void GPUReconstructionCPU::debugWriter::row(char type, uint32_t count, std::string name, double gpu_time, double cpu_time, double total_time, std::size_t memSize, std::string nEventReport)
212213
{
213214
double scale = 1000000.0 / mStatNEvents;
214215

0 commit comments

Comments
 (0)