Skip to content

Commit 76626a3

Browse files
committed
GPU: Write floats in hex format to debug dump when in deterministic mode
1 parent 11f041c commit 76626a3

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ AddOption(debugLevel, int32_t, -1, "debug", 'd', "Set debug level (-2 = silent,
329329
AddOption(allocDebugLevel, int32_t, 0, "allocDebug", 0, "Some debug output for memory allocations (without messing with normal debug level)")
330330
AddOption(debugMask, uint32_t, (1 << 18) - 1, "debugMask", 0, "Mask for debug output dumps to file")
331331
AddOption(debugLogSuffix, std::string, "", "debugSuffix", 0, "Suffix for debug log files with --debug 6")
332+
AddOption(debugFileHexFloat, int32_t, -1, "", 0, "Use hex format to print floats to debug dump file")
332333
AddOption(debugCSV, std::string, "", "", 0, "CSV filename to append the benchmark results. Verbosity determined by parameter --debug.")
333334
AddOption(debugMarkdown, bool, false, "", 0, "Print the results of standlaone benchmarks in markdown format")
334335
AddOption(serializeGPU, int8_t, 0, "", 0, "Synchronize after each kernel call (bit 1) and DMA transfer (bit 2) and identify failures")

GPU/GPUTracking/Global/GPUChainTracking.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,9 @@ int32_t GPUChainTracking::Init()
383383
if (GetProcessingSettings().debugLevel >= 6) {
384384
std::string filename = std::string(mRec->IsGPU() ? "GPU" : "CPU") + (mRec->slaveId() != -1 ? (std::string("_slave") + std::to_string(mRec->slaveId())) : std::string(mRec->slavesExist() ? "_master" : "")) + GetProcessingSettings().debugLogSuffix + ".out";
385385
mDebugFile->open(filename.c_str());
386+
if (GetProcessingSettings().debugFileHexFloat >= 1 || (GetProcessingSettings().debugFileHexFloat == -1 && GetProcessingSettings().deterministicGPUReconstruction)) {
387+
*mDebugFile << std::hexfloat;
388+
}
386389
}
387390

388391
return 0;

GPU/GPUTracking/Merger/GPUTPCGMMergerDump.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ using namespace gputpcgmmergertypes;
4343
void GPUTPCGMMerger::DumpSectorTracks(std::ostream& out) const
4444
{
4545
std::streamsize ss = out.precision();
46-
out << std::setprecision(10);
46+
out << std::setprecision(6);
4747
out << "\nTPC Merger Sector Tracks\n";
4848
for (int32_t iSector = 0; iSector < NSECTORS; iSector++) {
4949
out << "Sector Track Info Sector " << iSector << " Index " << (mSectorTrackInfoIndex[iSector + 1] - mSectorTrackInfoIndex[iSector]) << " / " << (mSectorTrackInfoIndex[NSECTORS + iSector + 1] - mSectorTrackInfoIndex[NSECTORS + iSector]) << "\n";
@@ -141,7 +141,7 @@ void GPUTPCGMMerger::DumpCollected(std::ostream& out) const
141141
void GPUTPCGMMerger::DumpTrackParam(std::ostream& out) const
142142
{
143143
std::streamsize ss = out.precision();
144-
out << std::setprecision(10);
144+
out << std::setprecision(6);
145145
for (uint32_t i = 0; i < mMemory->nMergedTracks; i++) {
146146
const auto& trk = mMergedTracks[i];
147147
const auto& p = trk.GetParam();
@@ -206,7 +206,7 @@ void GPUTPCGMMerger::DumpFitPrepare(std::ostream& out) const
206206
void GPUTPCGMMerger::DumpRefit(std::ostream& out) const
207207
{
208208
std::streamsize ss = out.precision();
209-
out << std::setprecision(10);
209+
out << std::setprecision(6);
210210
out << "\nTPC Merger Refit\n";
211211
for (uint32_t i = 0; i < mMemory->nMergedTracks; i++) {
212212
const auto& trk = mMergedTracks[i];

0 commit comments

Comments
 (0)