diff --git a/GPU/GPUTracking/Base/GPUReconstruction.cxx b/GPU/GPUTracking/Base/GPUReconstruction.cxx index eaf3afbdc9cf3..3e7509d8fad73 100644 --- a/GPU/GPUTracking/Base/GPUReconstruction.cxx +++ b/GPU/GPUTracking/Base/GPUReconstruction.cxx @@ -1195,9 +1195,9 @@ int32_t GPUReconstruction::CheckErrorCodes(bool cpuOnly, bool forceShowErrors, s return retVal; } -int32_t GPUReconstruction::GPUChkErrA(const int64_t error, const char* file, int32_t line, bool failOnError) +int32_t GPUReconstruction::GPUChkErrA(const int64_t retval, const char* file, int32_t line, bool failOnError) { - if (error == 0 || !GPUChkErrInternal(error, file, line)) { + if (retval == 0 || !GPUChkErrInternal(retval, file, line)) { return 0; } if (failOnError) { diff --git a/GPU/GPUTracking/Base/GPUReconstruction.h b/GPU/GPUTracking/Base/GPUReconstruction.h index d85c29371f8fb..565836a26d233 100644 --- a/GPU/GPUTracking/Base/GPUReconstruction.h +++ b/GPU/GPUTracking/Base/GPUReconstruction.h @@ -98,11 +98,11 @@ class GPUReconstruction static constexpr GeometryType geometryType = GeometryType::O2; #endif - enum retValValue : uint32_t { ok = 0, - error = 1, - doExit = 2, - nonFatalErrorCode = 3, - abort = 4 }; + enum retValValue : uint32_t { retOk = 0, + retError = 1, + retDoExit = 2, + retNonFatalErrorCode = 3, + retAbort = 4 }; static DeviceType GetDeviceType(const char* type); enum InOutPointerType : uint32_t { CLUSTER_DATA = 0, SECTOR_OUT_TRACK = 1, @@ -280,7 +280,7 @@ class GPUReconstruction void UpdateMaxMemoryUsed(); int32_t EnqueuePipeline(bool terminate = false); GPUChain* GetNextChainInQueue(); - virtual int32_t GPUChkErrInternal(const int64_t error, const char* file, int32_t line) const { return 0; } + virtual int32_t GPUChkErrInternal(const int64_t retval, const char* file, int32_t line) const { return 0; } virtual int32_t registerMemoryForGPU_internal(const void* ptr, size_t size) = 0; virtual int32_t unregisterMemoryForGPU_internal(const void* ptr) = 0; diff --git a/GPU/GPUTracking/Base/GPUReconstructionCPU.cxx b/GPU/GPUTracking/Base/GPUReconstructionCPU.cxx index ac2c2d0a78a78..9ee6fae1e0fd9 100644 --- a/GPU/GPUTracking/Base/GPUReconstructionCPU.cxx +++ b/GPU/GPUTracking/Base/GPUReconstructionCPU.cxx @@ -245,7 +245,7 @@ int32_t GPUReconstructionCPU::RunChains() retVal = mChains[i]->RunChain(); } } - if (retVal != GPUReconstruction::retValValue::ok && retVal != GPUReconstruction::retValValue::doExit) { + if (retVal != GPUReconstruction::retValValue::retOk && retVal != GPUReconstruction::retValValue::retDoExit) { return retVal; } mTimerTotal.Stop(); diff --git a/GPU/GPUTracking/Base/GPUReconstructionDeviceBase.h b/GPU/GPUTracking/Base/GPUReconstructionDeviceBase.h index c8288f978f6ae..0b1cb5f643571 100644 --- a/GPU/GPUTracking/Base/GPUReconstructionDeviceBase.h +++ b/GPU/GPUTracking/Base/GPUReconstructionDeviceBase.h @@ -42,7 +42,7 @@ class GPUReconstructionDeviceBase : public GPUReconstructionCPU virtual int32_t InitDevice_Runtime() = 0; int32_t ExitDevice() override; virtual int32_t ExitDevice_Runtime() = 0; - virtual int32_t GPUChkErrInternal(const int64_t error, const char* file, int32_t line) const override = 0; + virtual int32_t GPUChkErrInternal(const int64_t retval, const char* file, int32_t line) const override = 0; int32_t registerMemoryForGPU_internal(const void* ptr, size_t size) override; int32_t unregisterMemoryForGPU_internal(const void* ptr) override; void unregisterRemainingRegisteredMemory(); diff --git a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu index 9ac021974b8a1..63992bed65fc5 100644 --- a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu +++ b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu @@ -84,9 +84,9 @@ GPUReconstructionCUDA::~GPUReconstructionCUDA() } static_assert(sizeof(cudaError_t) <= sizeof(int64_t) && cudaSuccess == 0); -int32_t GPUReconstructionCUDA::GPUChkErrInternal(const int64_t error, const char* file, int32_t line) const +int32_t GPUReconstructionCUDA::GPUChkErrInternal(const int64_t retval, const char* file, int32_t line) const { - return internal::GPUReconstructionCUDAChkErr(error, file, line); + return internal::GPUReconstructionCUDAChkErr(retval, file, line); } GPUReconstruction* GPUReconstruction_Create_CUDA(const GPUSettingsDeviceBackend& cfg) { return new GPUReconstructionCUDA(cfg); } diff --git a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.h b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.h index b3562eff4096d..6f92ca1938e0d 100644 --- a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.h +++ b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.h @@ -42,7 +42,7 @@ class GPUReconstructionCUDA : public GPUReconstructionProcessing::KernelInterfac ~GPUReconstructionCUDA() override; void PrintKernelOccupancies() override; - virtual int32_t GPUChkErrInternal(const int64_t error, const char* file, int32_t line) const override; + virtual int32_t GPUChkErrInternal(const int64_t retval, const char* file, int32_t line) const override; template void runKernelBackend(const krnlSetupTime& _xyz, const Args&... args); diff --git a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAHelpers.inc b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAHelpers.inc index c2b6f6d05dd7f..2db55665f193e 100644 --- a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAHelpers.inc +++ b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAHelpers.inc @@ -20,12 +20,12 @@ namespace o2::gpu::internal { -int32_t __attribute__((weak)) GPUReconstructionCUDAChkErr(const int64_t error, const char* file, int32_t line) +int32_t __attribute__((weak)) GPUReconstructionCUDAChkErr(const int64_t retVal, const char* file, int32_t line) { - if (error != cudaSuccess) { - GPUError("CUDA Error: %ld / %s (%s:%d)", error, cudaGetErrorString((cudaError_t)error), file, line); + if (retVal != cudaSuccess) { + GPUError("CUDA Error: %ld / %s (%s:%d)", retVal, cudaGetErrorString((cudaError_t)retVal), file, line); } - return error != cudaSuccess; + return retVal != cudaSuccess; } } // namespace o2::gpu::internal diff --git a/GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.cxx b/GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.cxx index 6954cfb3d6211..316daa63542cf 100644 --- a/GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.cxx +++ b/GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.cxx @@ -52,13 +52,13 @@ GPUReconstructionOCL::~GPUReconstructionOCL() } static_assert(sizeof(cl_int) <= sizeof(int64_t) && CL_SUCCESS == 0); -int32_t GPUReconstructionOCL::GPUChkErrInternal(const int64_t error, const char* file, int32_t line) const +int32_t GPUReconstructionOCL::GPUChkErrInternal(const int64_t retval, const char* file, int32_t line) const { // Check for OPENCL Error and in the case of an error display the corresponding error string - if (error != CL_SUCCESS) { - GPUError("OpenCL Error: %ld / %s (%s:%d)", error, convertErrorToString(error), file, line); + if (retval != CL_SUCCESS) { + GPUError("OpenCL Error: %ld / %s (%s:%d)", retval, convertErrorToString(retval), file, line); } - return error != CL_SUCCESS; + return retval != CL_SUCCESS; } int32_t GPUReconstructionOCL::InitDevice_Runtime() diff --git a/GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.h b/GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.h index a52db1f2a737a..b8b35ce7d5c6b 100644 --- a/GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.h +++ b/GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.h @@ -40,7 +40,7 @@ class GPUReconstructionOCL : public GPUReconstructionProcessing::KernelInterface int32_t InitDevice_Runtime() override; int32_t ExitDevice_Runtime() override; - virtual int32_t GPUChkErrInternal(const int64_t error, const char* file, int32_t line) const override; + virtual int32_t GPUChkErrInternal(const int64_t retval, const char* file, int32_t line) const override; void SynchronizeGPU() override; int32_t GPUDebug(const char* state = "UNKNOWN", int32_t stream = -1, bool force = false) override; diff --git a/GPU/GPUTracking/Definitions/Parameters/gpu_param_header_generator.cmake b/GPU/GPUTracking/Definitions/Parameters/gpu_param_header_generator.cmake index b43ee846a0635..c1ec6bbd53fa9 100644 --- a/GPU/GPUTracking/Definitions/Parameters/gpu_param_header_generator.cmake +++ b/GPU/GPUTracking/Definitions/Parameters/gpu_param_header_generator.cmake @@ -51,14 +51,14 @@ function(generate_gpu_param_header GPU_PARAM_JSON_FILES ARCH_LIST OUT_HEADER OUT message(FATAL_ERROR "Defaults must be provided in first parameter file") endif() if(do_all_architectures GREATER -1) - if(NOT arch MATCHES ^default) - list(APPEND JSON_ARCHITECTURES "${arch}") - endif() set(list_idx 0) else() list(FIND ARCH_LIST_EXT "${arch}" list_idx) endif() if(list_idx GREATER -1) + if(NOT arch MATCHES ^default) + list(APPEND JSON_ARCHITECTURES "${arch}") + endif() string(JSON param_values GET "${JSON_CONTENT}" "${TYPE}" "${param_name}" "${arch}") if(TYPE STREQUAL "LB") set(MACRO_NAME "GPUCA_LB_${param_name}") @@ -95,7 +95,7 @@ function(generate_gpu_param_header GPU_PARAM_JSON_FILES ARCH_LIST OUT_HEADER OUT if(NOT GPUCA_UNKNOWN_ARCHITECTURES_ARE_DEFAULT) foreach(item IN LISTS ARCH_LIST) if(NOT item IN_LIST JSON_ARCHITECTURES) - message(FATAL_ERROR "Missing architecture parameters for ${item}") + message(FATAL_ERROR "Missing architecture parameters for ${item}: Available ${JSON_ARCHITECTURES}") endif() endforeach() endif() diff --git a/GPU/GPUTracking/Global/GPUChainTracking.cxx b/GPU/GPUTracking/Global/GPUChainTracking.cxx index 480ec76408584..eb6d880398eec 100644 --- a/GPU/GPUTracking/Global/GPUChainTracking.cxx +++ b/GPU/GPUTracking/Global/GPUChainTracking.cxx @@ -677,7 +677,7 @@ int32_t GPUChainTracking::RunChain() const bool needQA = GPUQA::QAAvailable() && (GetProcessingSettings().runQA || (GetProcessingSettings().eventDisplay && (mIOPtrs.nMCInfosTPC || GetProcessingSettings().runMC))); if (needQA && GetQA()->IsInitialized() == false) { if (GetQA()->InitQA(GetProcessingSettings().runQA <= 0 ? -GetProcessingSettings().runQA : gpudatatypes::gpuqa::tasksAutomatic)) { - return GPUReconstruction::retValValue::error; + return GPUReconstruction::retValValue::retError; } } if (needQA) { @@ -693,7 +693,7 @@ int32_t GPUChainTracking::RunChain() mRec->PrepareEvent(); } catch (const std::bad_alloc& e) { GPUError("Memory Allocation Error"); - return GPUReconstruction::retValValue::error; + return GPUReconstruction::retValValue::retError; } mRec->getGeneralStepTimer(GeneralStep::Prepare).Stop(); @@ -707,11 +707,11 @@ int32_t GPUChainTracking::RunChain() if (mIOPtrs.tpcCompressedClusters) { if (runRecoStep(RecoStep::TPCDecompression, &GPUChainTracking::RunTPCDecompression)) { - return GPUReconstruction::retValValue::error; + return GPUReconstruction::retValValue::retError; } } else if (mIOPtrs.tpcPackedDigits || mIOPtrs.tpcZS) { if (runRecoStep(RecoStep::TPCClusterFinding, &GPUChainTracking::RunTPCClusterizer, false)) { - return GPUReconstruction::retValValue::error; + return GPUReconstruction::retValValue::retError; } } @@ -720,17 +720,17 @@ int32_t GPUChainTracking::RunChain() } if (mIOPtrs.clustersNative && runRecoStep(RecoStep::TPCConversion, &GPUChainTracking::ConvertNativeToClusterData)) { - return GPUReconstruction::retValValue::error; + return GPUReconstruction::retValValue::retError; } mRec->PushNonPersistentMemory(qStr2Tag("TPCSLCD1")); // 1st stack level for TPC tracking sector data mTPCSectorScratchOnStack = true; if (runRecoStep(RecoStep::TPCSectorTracking, &GPUChainTracking::RunTPCTrackingSectors)) { - return GPUReconstruction::retValValue::error; + return GPUReconstruction::retValValue::retError; } if (runRecoStep(RecoStep::TPCMerging, &GPUChainTracking::RunTPCTrackingMerger, false)) { - return GPUReconstruction::retValValue::error; + return GPUReconstruction::retValValue::retError; } if (mTPCSectorScratchOnStack) { mRec->PopNonPersistentMemory(RecoStep::TPCSectorTracking, qStr2Tag("TPCSLCD1")); // Release 1st stack level, TPC sector data not needed after merger @@ -750,16 +750,16 @@ int32_t GPUChainTracking::RunChain() } } if (runRecoStep(RecoStep::TPCCompression, &GPUChainTracking::RunTPCCompression)) { - return GPUReconstruction::retValValue::error; + return GPUReconstruction::retValValue::retError; } } if (runRecoStep(RecoStep::TRDTracking, &GPUChainTracking::RunTRDTracking)) { - return GPUReconstruction::retValValue::error; + return GPUReconstruction::retValValue::retError; } if (runRecoStep(RecoStep::Refit, &GPUChainTracking::RunRefit)) { - return GPUReconstruction::retValValue::error; + return GPUReconstruction::retValValue::retError; } if (!GetProcessingSettings().doublePipeline) { // Synchronize with output copies running asynchronously @@ -770,9 +770,9 @@ int32_t GPUChainTracking::RunChain() mRec->SetNActiveThreads(-1); } - int32_t retVal = GPUReconstruction::retValValue::ok; + int32_t retVal = GPUReconstruction::retValValue::retOk; if (CheckErrorCodes(false, false, mRec->getErrorCodeOutput())) { // TODO: Eventually, we should use GPUReconstruction::CheckErrorCodes - retVal = GPUReconstruction::retValValue::nonFatalErrorCode; + retVal = GPUReconstruction::retValValue::retNonFatalErrorCode; if (!GetProcessingSettings().ignoreNonFatalGPUErrors) { return retVal; } @@ -820,7 +820,7 @@ int32_t GPUChainTracking::RunChainFinalize() GPUInfo("Starting Event Display..."); if (mEventDisplay->StartDisplay()) { GPUError("Error starting Event Display"); - return GPUReconstruction::retValValue::error; + return GPUReconstruction::retValValue::retError; } mDisplayRunning = true; } else { @@ -857,7 +857,7 @@ int32_t GPUChainTracking::RunChainFinalize() mDisplayRunning = false; GetProcessingSettings().eventDisplay->DisplayExit(); const_cast(GetProcessingSettings()).eventDisplay = nullptr; // TODO: fixme - eventDisplay should probably not be put into ProcessingSettings in the first place - return GPUReconstruction::retValValue::doExit; + return GPUReconstruction::retValValue::retDoExit; } GetProcessingSettings().eventDisplay->setDisplayControl(0); GPUInfo("Loading next event..."); @@ -865,7 +865,7 @@ int32_t GPUChainTracking::RunChainFinalize() mEventDisplay->BlockTillNextEvent(); } - return GPUReconstruction::retValValue::ok; + return GPUReconstruction::retValValue::retOk; } int32_t GPUChainTracking::FinalizePipelinedProcessing() diff --git a/GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx b/GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx index a558ed85c5516..8301c9eaa6792 100644 --- a/GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx +++ b/GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx @@ -669,10 +669,10 @@ int32_t GPUChainTracking::RunTPCClusterizer_prepare(bool restorePointers, const uint32_t nDigitsFragmentMax[NSECTORS]; mCFContext->zsVersion = -1; for (uint32_t iSector = 0; iSector < NSECTORS; iSector++) { - if (mIOPtrs.tpcZS->sector[iSector].count[0]) { + if (mIOPtrs.tpcZS->sector[iSector].count[0] && mIOPtrs.tpcZS->sector[iSector].nZSPtr[0][0]) { const void* rdh = mIOPtrs.tpcZS->sector[iSector].zsPtr[0][0]; if (rdh && o2::raw::RDHUtils::getVersion() > o2::raw::RDHUtils::getVersion(rdh)) { - GPUError("Data has invalid RDH version %d, %d required\n", o2::raw::RDHUtils::getVersion(rdh), o2::raw::RDHUtils::getVersion()); + GPUError("Data has invalid RDH version %d, %d required (sector %d)\n", o2::raw::RDHUtils::getVersion(rdh), o2::raw::RDHUtils::getVersion(), iSector); return 1; } } @@ -769,7 +769,7 @@ int32_t GPUChainTracking::RunTPCClusterizer(bool synchronizeOutput) #endif if (RunTPCClusterizer_prepare(mPipelineNotifyCtx && GetProcessingSettings().doublePipelineClusterizer, extraADCs)) { - return GPUReconstruction::retValValue::error; + return GPUReconstruction::retValValue::retError; } if (GetProcessingSettings().autoAdjustHostThreads && !doGPU) { mRec->SetNActiveThreads(mRec->MemoryScalers()->nTPCdigits / 6000); @@ -1472,7 +1472,7 @@ int32_t GPUChainTracking::RunTPCClusterizer(bool synchronizeOutput) } if (mWaitForFinalInputs && iSectorBase >= 30 && (int32_t)iSectorBase < 30 + GetProcessingSettings().nTPCClustererLanes) { if (mWaitForFinalInputs()) { - return GPUReconstruction::retValValue::abort; + return GPUReconstruction::retValValue::retAbort; } synchronizeCalibUpdate = DoQueuedUpdates(0, false); } diff --git a/GPU/GPUTracking/Interface/GPUO2Interface.cxx b/GPU/GPUTracking/Interface/GPUO2Interface.cxx index 184597b12ceba..ca22df5b95695 100644 --- a/GPU/GPUTracking/Interface/GPUO2Interface.cxx +++ b/GPU/GPUTracking/Interface/GPUO2Interface.cxx @@ -219,8 +219,8 @@ int32_t GPUO2Interface::RunTracking(GPUTrackingInOutPointers* data, GPUInterface } int32_t retVal = mCtx[iThread].mRec->RunChains(); - if (retVal == GPUReconstruction::retValValue::doExit) { - retVal = GPUReconstruction::retValValue::ok; // Ignore exit signal from event display + if (retVal == GPUReconstruction::retValValue::retDoExit) { + retVal = GPUReconstruction::retValValue::retOk; // Ignore exit signal from event display } if (mConfig->configQA.shipToQC && mCtx[iThread].mChain->QARanForTF()) { outputs->qa.hist1 = &mCtx[iThread].mChain->GetQA()->getHistograms1D(); diff --git a/GPU/GPUTracking/Standalone/Benchmark/standalone.cxx b/GPU/GPUTracking/Standalone/Benchmark/standalone.cxx index c452e973d97e0..433668516dd58 100644 --- a/GPU/GPUTracking/Standalone/Benchmark/standalone.cxx +++ b/GPU/GPUTracking/Standalone/Benchmark/standalone.cxx @@ -685,11 +685,11 @@ int32_t RunBenchmark(GPUReconstruction* recUse, GPUChainTracking* chainTrackingU } } - if (tmpRetVal == GPUReconstruction::retValValue::ok || tmpRetVal == GPUReconstruction::retValValue::doExit) { + if (tmpRetVal == GPUReconstruction::retValValue::retOk || tmpRetVal == GPUReconstruction::retValValue::retDoExit) { OutputStat(chainTrackingUse, iRun == 0 ? nTracksTotal : nullptr, iRun == 0 ? nClustersTotal : nullptr); } - if (tmpRetVal == GPUReconstruction::retValValue::ok && configStandalone.testSyncAsync) { + if (tmpRetVal == GPUReconstruction::retValValue::retOk && configStandalone.testSyncAsync) { vecpod compressedTmpMem(chainTracking->mIOPtrs.tpcCompressedClusters->totalDataSize); memcpy(compressedTmpMem.data(), (const void*)chainTracking->mIOPtrs.tpcCompressedClusters, chainTracking->mIOPtrs.tpcCompressedClusters->totalDataSize); o2::tpc::CompressedClusters tmp(*chainTracking->mIOPtrs.tpcCompressedClusters); @@ -717,7 +717,7 @@ int32_t RunBenchmark(GPUReconstruction* recUse, GPUChainTracking* chainTrackingU recAsync->SetResetTimers(iRun < configStandalone.runsInit); } tmpRetVal = recAsync->RunChains(); - if (tmpRetVal == GPUReconstruction::retValValue::ok || tmpRetVal == GPUReconstruction::retValValue::doExit) { + if (tmpRetVal == GPUReconstruction::retValValue::retOk || tmpRetVal == GPUReconstruction::retValValue::retDoExit) { OutputStat(chainTrackingAsync, nullptr, nullptr); } recAsync->ClearAllocatedMemory(); @@ -726,14 +726,14 @@ int32_t RunBenchmark(GPUReconstruction* recUse, GPUChainTracking* chainTrackingU recUse->ClearAllocatedMemory(); } - if (tmpRetVal == GPUReconstruction::retValValue::doExit) { + if (tmpRetVal == GPUReconstruction::retValValue::retDoExit) { configStandalone.continueOnError = 0; // Forced exit from event display loop configStandalone.noprompt = 1; } - if (tmpRetVal == GPUReconstruction::retValValue::nonFatalErrorCode && configStandalone.proc.ignoreNonFatalGPUErrors) { + if (tmpRetVal == GPUReconstruction::retValValue::retNonFatalErrorCode && configStandalone.proc.ignoreNonFatalGPUErrors) { printf("GPU Standalone Benchmark: Non-FATAL GPU error occured, ignoring\n"); } else if (tmpRetVal && !configStandalone.continueOnError) { - if (tmpRetVal != GPUReconstruction::retValValue::doExit) { + if (tmpRetVal != GPUReconstruction::retValValue::retDoExit) { printf("GPU Standalone Benchmark: Error occured\n"); } return 1;