Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions GPU/GPUTracking/Base/GPUReconstruction.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
12 changes: 6 additions & 6 deletions GPU/GPUTracking/Base/GPUReconstruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion GPU/GPUTracking/Base/GPUReconstructionCPU.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion GPU/GPUTracking/Base/GPUReconstructionDeviceBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
Expand Down
2 changes: 1 addition & 1 deletion GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <class T, int32_t I = 0, typename... Args>
void runKernelBackend(const krnlSetupTime& _xyz, const Args&... args);
Expand Down
8 changes: 4 additions & 4 deletions GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAHelpers.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down Expand Up @@ -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()
Expand Down
30 changes: 15 additions & 15 deletions GPU/GPUTracking/Global/GPUChainTracking.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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();

Expand All @@ -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;
}
}

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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;
}
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -857,15 +857,15 @@ int32_t GPUChainTracking::RunChainFinalize()
mDisplayRunning = false;
GetProcessingSettings().eventDisplay->DisplayExit();
const_cast<GPUSettingsProcessing&>(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...");

mEventDisplay->BlockTillNextEvent();
}

return GPUReconstruction::retValValue::ok;
return GPUReconstruction::retValValue::retOk;
}

int32_t GPUChainTracking::FinalizePipelinedProcessing()
Expand Down
8 changes: 4 additions & 4 deletions GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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::header::RAWDataHeaderV6>() > o2::raw::RDHUtils::getVersion(rdh)) {
GPUError("Data has invalid RDH version %d, %d required\n", o2::raw::RDHUtils::getVersion(rdh), o2::raw::RDHUtils::getVersion<o2::header::RAWDataHeader>());
GPUError("Data has invalid RDH version %d, %d required (sector %d)\n", o2::raw::RDHUtils::getVersion(rdh), o2::raw::RDHUtils::getVersion<o2::header::RAWDataHeader>(), iSector);
return 1;
}
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions GPU/GPUTracking/Interface/GPUO2Interface.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
12 changes: 6 additions & 6 deletions GPU/GPUTracking/Standalone/Benchmark/standalone.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<char> compressedTmpMem(chainTracking->mIOPtrs.tpcCompressedClusters->totalDataSize);
memcpy(compressedTmpMem.data(), (const void*)chainTracking->mIOPtrs.tpcCompressedClusters, chainTracking->mIOPtrs.tpcCompressedClusters->totalDataSize);
o2::tpc::CompressedClusters tmp(*chainTracking->mIOPtrs.tpcCompressedClusters);
Expand Down Expand Up @@ -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();
Expand All @@ -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;
Expand Down
Loading