From c8811ac3557117af46226a21e904f631f56e81d6 Mon Sep 17 00:00:00 2001 From: David Rohr Date: Tue, 1 Dec 2026 21:25:05 +0100 Subject: [PATCH] GPU: Modernize C++ in ClusterizerNN Code by Claude --- .../GPUTPCNNClusterizerKernels.cxx | 342 ++++++------------ .../GPUTPCNNClusterizerKernels.h | 5 + 2 files changed, 108 insertions(+), 239 deletions(-) diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizerKernels.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizerKernels.cxx index 45a9a797d8fa8..a31390cb409c4 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizerKernels.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizerKernels.cxx @@ -37,6 +37,73 @@ using namespace o2::gpu::tpccf; static_assert(GPUTPCNNClusterizerKernels::SCRATCH_PAD_WORK_GROUP_SIZE == GPUTPCCFClusterizer::SCRATCH_PAD_WORK_GROUP_SIZE, "Work group sizes do not match"); +GPUdi() void GPUTPCNNClusterizerKernels::writeInput(GPUTPCNNClusterizer& clustererNN, int8_t dtype, uint32_t idx, float v) +{ + if (dtype == 0) { + clustererNN.mInputData_32[idx] = v; + } else { + clustererNN.mInputData_16[idx] = (OrtDataType::Float16_t)v; + } +} + +GPUdi() float GPUTPCNNClusterizerKernels::readProbability(const GPUTPCNNClusterizer& clustererNN, int8_t dtype, uint32_t idx) +{ + return dtype == 0 ? clustererNN.mModelProbabilities_32[idx] : (float)clustererNN.mModelProbabilities_16[idx]; +} + +// out: NN regression output of this cluster, i*: indices of pad, time, qtot, pad sigma, time sigma in out, padSigma / timeSigma: use the sigma output, otherwise 0 +template +GPUdi() void GPUTPCNNClusterizerKernels::setClusterFromNN(ClusterAccumulator& pc, const T* out, const int8_t* flags, const CfChargePos& peak, float central_charge, tpccf::TPCTime fragStart, uint32_t full_glo_idx, int32_t iPad, int32_t iTime, int32_t iQ, int32_t iPadSigma, int32_t iTimeSigma, bool padSigma, bool timeSigma) +{ + float publishPadPosition = static_cast(peak.pad()) + (float)out[iPad]; + float publishTimePosition = static_cast(peak.time()) + (float)out[iTime]; + isBoundaryPublish(full_glo_idx, static_cast(peak.row()), publishPadPosition, publishTimePosition); + pc.setFull(central_charge * (float)out[iQ], + publishPadPosition, + padSigma ? (float)out[iPadSigma] : 0.f, + fragStart + publishTimePosition, + timeSigma ? (float)out[iTimeSigma] : 0.f, + flags[0], + flags[1]); +} + +// Returns false if the cluster is rejected +GPUdi() bool GPUTPCNNClusterizerKernels::storeCluster(GPUTPCClusterFinder& clusterer, const GPUTPCNNClusterizer& clustererNN, ClusterAccumulator& pc, const CfChargePos& peak, float central_charge, const CfArray2D& chargeMap, uint32_t full_glo_idx, uint32_t classIdx, MCLabelAccumulator* labelAcc, bool commitLabels) +{ + tpc::ClusterNative* clusterOut = clusterer.mPclusterByRow; + tpc::ClusterNative myCluster; + bool rejectCluster = !pc.toNative(peak, central_charge, myCluster, clusterer.Param(), chargeMap); + if (clustererNN.mNnClusterizerUseClassification) { + rejectCluster |= (clustererNN.mOutputDataClass[classIdx] <= 0); + } + if (rejectCluster) { + if (clusterer.mPclusterPosInRow) { + clusterer.mPclusterPosInRow[full_glo_idx] = clusterer.mNMaxClusterPerRow; + } + return false; + } + + uint32_t rowIndex = 0; + if (clusterOut != nullptr) { + rowIndex = GPUTPCCFClusterizer::sortIntoBuckets( + clusterer, + myCluster, + peak.row(), + clusterer.mNMaxClusterPerRow, + clusterer.mPclusterInRow, + clusterOut); + if (clusterer.mPclusterPosInRow != nullptr) { + clusterer.mPclusterPosInRow[full_glo_idx] = rowIndex; + } + } else if (clusterer.mPclusterPosInRow) { + rowIndex = clusterer.mPclusterPosInRow[full_glo_idx]; + } + if (commitLabels) { + GPUCA_IGNORE_ON_GPU(labelAcc->commit(peak.row(), rowIndex, clusterer.mNMaxClusterPerRow)); + } + return true; +} + // Defining individual thread functions for data filling, determining the class label and running the CF clusterizer template <> GPUdii() void GPUTPCNNClusterizerKernels::Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUSharedMemory& smem, processorType& processors, uint8_t sector, int8_t dtype, int8_t withMC, uint32_t batchStart) @@ -93,20 +160,11 @@ GPUdii() void GPUTPCNNClusterizerKernels::Thread= clustererNN.maxAllowedTimebin) { // Fill boundary value output_value = clustererNN.mNnClusterizerBoundaryFillValue; - if (dtype == 0) { - clustererNN.mInputData_32[write_idx] = output_value; - } else { - clustererNN.mInputData_16[write_idx] = (OrtDataType::Float16_t)output_value; - } } else { CfChargePos tmp_pos(target_row, target_pad, target_time); output_value = chargeMap[tmp_pos].unpack() * inverse_charge; - if (dtype == 0) { - clustererNN.mInputData_32[write_idx] = output_value; - } else { - clustererNN.mInputData_16[write_idx] = (OrtDataType::Float16_t)output_value; - } } + writeInput(clustererNN, dtype, write_idx, output_value); // if((CAMath::Abs(static_cast(clustererNN.mInputData_16_Test[write_idx]) - static_cast(clustererNN.mInputData_16[write_idx])) > 1e-4) && ((glo_idx + batchStart) < clusterer.mPmemory->counters.nClusters)) { // printf("Warning: Input data mismatch at index %d, %d - row, pad, time: %d, %d, %d : %f -> %f\n", glo_idx, glo_idx + batchStart, r, p, t, // static_cast(clustererNN.mInputData_16_Test[write_idx]), static_cast(clustererNN.mInputData_16[write_idx])); @@ -117,15 +175,9 @@ GPUdii() void GPUTPCNNClusterizerKernels::Thread(sector) / o2::tpc::constants::MAXSECTOR; - clustererNN.mInputData_32[write_idx + 1] = static_cast(row) / o2::tpc::constants::MAXGLOBALPADROW; - clustererNN.mInputData_32[write_idx + 2] = static_cast(pad) / npads_row; - } else { - clustererNN.mInputData_16[write_idx] = (OrtDataType::Float16_t)(static_cast(sector) / o2::tpc::constants::MAXSECTOR); - clustererNN.mInputData_16[write_idx + 1] = (OrtDataType::Float16_t)(static_cast(row) / o2::tpc::constants::MAXGLOBALPADROW); - clustererNN.mInputData_16[write_idx + 2] = (OrtDataType::Float16_t)(static_cast(pad) / npads_row); - } + writeInput(clustererNN, dtype, write_idx, static_cast(sector) / o2::tpc::constants::MAXSECTOR); + writeInput(clustererNN, dtype, write_idx + 1, static_cast(row) / o2::tpc::constants::MAXGLOBALPADROW); + writeInput(clustererNN, dtype, write_idx + 2, static_cast(pad) / npads_row); } if (!clustererNN.mNnClusterizerSetDeconvolutionFlags) { @@ -178,15 +230,9 @@ GPUdii() void GPUTPCNNClusterizerKernels::Thread= clustererNN.mNnClusterizerRowTimeSize) { uint32_t write_idx = base_idx * clustererNN.mNnClusterizerElementSize + clustererNN.mNnClusterizerChargeArraySize; const int32_t npads = GPUTPCGeometry::NPads(row); - if (dtype == 0) { - clustererNN.mInputData_32[write_idx] = static_cast(sector) / o2::tpc::constants::MAXSECTOR; - clustererNN.mInputData_32[write_idx + 1] = static_cast(row) / o2::tpc::constants::MAXGLOBALPADROW; - clustererNN.mInputData_32[write_idx + 2] = static_cast(pad) / npads; - } else { - clustererNN.mInputData_16[write_idx] = (OrtDataType::Float16_t)(static_cast(sector) / o2::tpc::constants::MAXSECTOR); - clustererNN.mInputData_16[write_idx + 1] = (OrtDataType::Float16_t)(static_cast(row) / o2::tpc::constants::MAXGLOBALPADROW); - clustererNN.mInputData_16[write_idx + 2] = (OrtDataType::Float16_t)(static_cast(pad) / npads); - } + writeInput(clustererNN, dtype, write_idx, static_cast(sector) / o2::tpc::constants::MAXSECTOR); + writeInput(clustererNN, dtype, write_idx + 1, static_cast(row) / o2::tpc::constants::MAXGLOBALPADROW); + writeInput(clustererNN, dtype, write_idx + 2, static_cast(pad) / npads); } // Main data processing - optimize index calculations @@ -202,11 +248,7 @@ GPUdii() void GPUTPCNNClusterizerKernels::Thread 62) || (target_row < 0) || (row > 62 && target_row < 63) || (target_row >= o2::tpc::constants::MAXGLOBALPADROW)) { for (uint32_t target_pad = 0; target_pad < clustererNN.mNnClusterizerFullPadSize; ++target_pad) { - if (dtype == 0) { - clustererNN.mInputData_32[write_idx] = output_value; - } else { - clustererNN.mInputData_16[write_idx] = (OrtDataType::Float16_t)output_value; - } + writeInput(clustererNN, dtype, write_idx, output_value); write_idx += clustererNN.mNnClusterizerFullTimeSize; } return; @@ -229,11 +271,7 @@ GPUdii() void GPUTPCNNClusterizerKernels::Thread clustererNN.mNnClassThreshold); - } else { - clustererNN.mOutputDataClass[glo_idx + batchStart] = (int32_t)((float)clustererNN.mModelProbabilities_16[glo_idx] > clustererNN.mNnClassThreshold); - } + clustererNN.mOutputDataClass[glo_idx + batchStart] = (int32_t)(readProbability(clustererNN, dtype, glo_idx) > clustererNN.mNnClassThreshold); } else { clustererNN.mOutputDataClass[glo_idx + batchStart] = 1; } @@ -276,17 +310,9 @@ GPUdii() void GPUTPCNNClusterizerKernels::Thread(clustererNN.mModelProbabilities_16[pIdx]); - } + current_max_prob = readProbability(clustererNN, dtype, pIdx); } else { - if (dtype == 0) { - current_max_prob = CAMath::Max(current_max_prob, clustererNN.mModelProbabilities_32[pIdx]); - } else { - current_max_prob = CAMath::Max(current_max_prob, (float)clustererNN.mModelProbabilities_16[pIdx]); - } + current_max_prob = CAMath::Max(current_max_prob, readProbability(clustererNN, dtype, pIdx)); } } // uint32_t class_label = std::distance(elem_iterator, std::max_element(elem_iterator, elem_iterator + clustererNN.mNnClusterizerModelClassNumOutputNodes)); // Multiple outputs of the class network are the probabilities for each class. The highest one "wins" @@ -323,27 +349,6 @@ GPUdii() void GPUTPCNNClusterizerKernels::Thread= maxClusterNum) { - if (withMC) { - ClusterAccumulator dummy_pc; - GPUCA_IGNORE_ON_GPU(labelAcc->collect(peak, central_charge)); - GPUTPCCFClusterizer::buildCluster( - clusterer.Param().rec, - chargeMap, - peak, - smem.posBcast, - smem.buf, - smem.innerAboveThreshold, - &dummy_pc, - labelAcc GPUCA_THREAD_INFO_PROVIDE); - } - return; - } - - tpc::ClusterNative* clusterOut = clusterer.mPclusterByRow; - - ClusterAccumulator pc; - if (withMC) { ClusterAccumulator dummy_pc; GPUCA_IGNORE_ON_GPU(labelAcc->collect(peak, central_charge)); @@ -357,6 +362,12 @@ GPUdii() void GPUTPCNNClusterizerKernels::Thread= maxClusterNum) { + return; + } + + ClusterAccumulator pc; + if ((clusterer.mPmemory->frag).isOverlap(peak.time())) { if (clusterer.mPclusterPosInRow) { clusterer.mPclusterPosInRow[full_glo_idx] = clusterer.mNMaxClusterPerRow; @@ -373,29 +384,10 @@ GPUdii() void GPUTPCNNClusterizerKernels::Thread 0.f); } - float publishPadPosition = 0.f, publishTimePosition = 0.f; if (dtype == 0) { - publishPadPosition = static_cast(peak.pad()) + clustererNN.mOutputDataReg1_32[model_output_index]; - publishTimePosition = static_cast(peak.time()) + clustererNN.mOutputDataReg1_32[model_output_index + 1]; - isBoundaryPublish(full_glo_idx, static_cast(peak.row()), publishPadPosition, publishTimePosition); - pc.setFull(central_charge * clustererNN.mOutputDataReg1_32[model_output_index + 4], - publishPadPosition, - notSinglePad ? clustererNN.mOutputDataReg1_32[model_output_index + 2] : 0.f, - (clusterer.mPmemory->frag).start + publishTimePosition, - notSingleTime ? clustererNN.mOutputDataReg1_32[model_output_index + 3] : 0.f, - clustererNN.mClusterFlags[2 * glo_idx], - clustererNN.mClusterFlags[2 * glo_idx + 1]); + setClusterFromNN(pc, clustererNN.mOutputDataReg1_32 + model_output_index, clustererNN.mClusterFlags + 2 * glo_idx, peak, central_charge, (clusterer.mPmemory->frag).start, full_glo_idx, 0, 1, 4, 2, 3, notSinglePad, notSingleTime); } else { - publishPadPosition = static_cast(peak.pad()) + (float)clustererNN.mOutputDataReg1_16[model_output_index]; - publishTimePosition = static_cast(peak.time()) + (float)clustererNN.mOutputDataReg1_16[model_output_index + 1]; - isBoundaryPublish(full_glo_idx, static_cast(peak.row()), publishPadPosition, publishTimePosition); - pc.setFull(central_charge * (float)clustererNN.mOutputDataReg1_16[model_output_index + 4], - publishPadPosition, - notSinglePad ? (float)clustererNN.mOutputDataReg1_16[model_output_index + 2] : 0.f, - (clusterer.mPmemory->frag).start + publishTimePosition, - notSingleTime ? (float)clustererNN.mOutputDataReg1_16[model_output_index + 3] : 0.f, - clustererNN.mClusterFlags[2 * glo_idx], - clustererNN.mClusterFlags[2 * glo_idx + 1]); + setClusterFromNN(pc, clustererNN.mOutputDataReg1_16 + model_output_index, clustererNN.mClusterFlags + 2 * glo_idx, peak, central_charge, (clusterer.mPmemory->frag).start, full_glo_idx, 0, 1, 4, 2, 3, notSinglePad, notSingleTime); } // if (boundaryFlag != 0) { // Prints the entire NN input for the given index @@ -467,34 +459,7 @@ GPUdii() void GPUTPCNNClusterizerKernels::Threadcommit(peak.row(), rowIndex, clusterer.mNMaxClusterPerRow)); + storeCluster(clusterer, clustererNN, pc, peak, central_charge, chargeMap, full_glo_idx, peakIndex, labelAcc, true); } template <> @@ -515,30 +480,8 @@ GPUdii() void GPUTPCNNClusterizerKernels::Thread= maxClusterNum) { - if (withMC) { - ClusterAccumulator dummy_pc; - GPUCA_IGNORE_ON_GPU(labelAcc->collect(peak, central_charge)); - GPUTPCCFClusterizer::buildCluster( - clusterer.Param().rec, - chargeMap, - peak, - smem.posBcast, - smem.buf, - smem.innerAboveThreshold, - &dummy_pc, - labelAcc GPUCA_THREAD_INFO_PROVIDE); - } - return; - } - - uint32_t model_output_index = glo_idx * clustererNN.mNnClusterizerModelReg2NumOutputNodes; - - ClusterAccumulator pc; - if (withMC) { ClusterAccumulator dummy_pc; GPUCA_IGNORE_ON_GPU(labelAcc->collect(peak, central_charge)); @@ -552,6 +495,14 @@ GPUdii() void GPUTPCNNClusterizerKernels::Thread= maxClusterNum) { + return; + } + + uint32_t model_output_index = glo_idx * clustererNN.mNnClusterizerModelReg2NumOutputNodes; + + ClusterAccumulator pc; + if ((clusterer.mPmemory->frag).isOverlap(peak.time())) { if (clusterer.mPclusterPosInRow) { clusterer.mPclusterPosInRow[full_glo_idx] = clusterer.mNMaxClusterPerRow; @@ -559,111 +510,24 @@ GPUdii() void GPUTPCNNClusterizerKernels::Threadcounters.nClusters - 1); // Cluster 1 - float publishPadPosition = 0.f, publishTimePosition = 0.f; if (dtype == 0) { - publishPadPosition = static_cast(peak.pad()) + clustererNN.mOutputDataReg2_32[model_output_index]; - publishTimePosition = static_cast(peak.time()) + clustererNN.mOutputDataReg2_32[model_output_index + 1]; - isBoundaryPublish(full_glo_idx, static_cast(peak.row()), publishPadPosition, publishTimePosition); - pc.setFull(central_charge * clustererNN.mOutputDataReg2_32[model_output_index + 8], - publishPadPosition, - clustererNN.mOutputDataReg2_32[model_output_index + 4], - (clusterer.mPmemory->frag).start + publishTimePosition, - clustererNN.mOutputDataReg2_32[model_output_index + 6], - clustererNN.mClusterFlags[2 * glo_idx], - clustererNN.mClusterFlags[2 * glo_idx + 1]); + setClusterFromNN(pc, clustererNN.mOutputDataReg2_32 + model_output_index, clustererNN.mClusterFlags + 2 * glo_idx, peak, central_charge, (clusterer.mPmemory->frag).start, full_glo_idx, 0, 1, 8, 4, 6, true, true); } else { - publishPadPosition = static_cast(peak.pad()) + (float)clustererNN.mOutputDataReg2_16[model_output_index]; - publishTimePosition = static_cast(peak.time()) + (float)clustererNN.mOutputDataReg2_16[model_output_index + 1]; - isBoundaryPublish(full_glo_idx, static_cast(peak.row()), publishPadPosition, publishTimePosition); - pc.setFull(central_charge * (float)clustererNN.mOutputDataReg2_16[model_output_index + 8], - publishPadPosition, - (float)clustererNN.mOutputDataReg2_16[model_output_index + 4], - (clusterer.mPmemory->frag).start + publishTimePosition, - (float)clustererNN.mOutputDataReg2_16[model_output_index + 6], - clustererNN.mClusterFlags[2 * glo_idx], - clustererNN.mClusterFlags[2 * glo_idx + 1]); - } - - tpc::ClusterNative myCluster; - bool rejectCluster = !pc.toNative(peak, central_charge, myCluster, clusterer.Param(), chargeMap); - if (clustererNN.mNnClusterizerUseClassification) { - rejectCluster |= (clustererNN.mOutputDataClass[CAMath::Min(full_glo_idx, (uint32_t)clusterer.mPmemory->counters.nClusters - 1)] <= 0); + setClusterFromNN(pc, clustererNN.mOutputDataReg2_16 + model_output_index, clustererNN.mClusterFlags + 2 * glo_idx, peak, central_charge, (clusterer.mPmemory->frag).start, full_glo_idx, 0, 1, 8, 4, 6, true, true); } - if (rejectCluster) { - if (clusterer.mPclusterPosInRow) { - clusterer.mPclusterPosInRow[full_glo_idx] = clusterer.mNMaxClusterPerRow; - } + if (!storeCluster(clusterer, clustererNN, pc, peak, central_charge, chargeMap, full_glo_idx, classIdx, labelAcc, true)) { return; } - uint32_t rowIndex = 0; - if (clusterOut != nullptr) { - rowIndex = GPUTPCCFClusterizer::sortIntoBuckets( - clusterer, - myCluster, - peak.row(), - clusterer.mNMaxClusterPerRow, - clusterer.mPclusterInRow, - clusterOut); - if (clusterer.mPclusterPosInRow != nullptr) { - clusterer.mPclusterPosInRow[full_glo_idx] = rowIndex; - } - } else if (clusterer.mPclusterPosInRow) { - rowIndex = clusterer.mPclusterPosInRow[full_glo_idx]; - } - GPUCA_IGNORE_ON_GPU(labelAcc->commit(peak.row(), rowIndex, clusterer.mNMaxClusterPerRow)); - // Cluster 2 if (dtype == 0) { - publishPadPosition = static_cast(peak.pad()) + clustererNN.mOutputDataReg2_32[model_output_index + 1]; - publishTimePosition = static_cast(peak.time()) + clustererNN.mOutputDataReg2_32[model_output_index + 3]; - isBoundaryPublish(full_glo_idx, static_cast(peak.row()), publishPadPosition, publishTimePosition); - pc.setFull(central_charge * clustererNN.mOutputDataReg2_32[model_output_index + 9], - publishPadPosition, - clustererNN.mOutputDataReg2_32[model_output_index + 5], - (clusterer.mPmemory->frag).start + publishTimePosition, - clustererNN.mOutputDataReg2_32[model_output_index + 7], - clustererNN.mClusterFlags[2 * glo_idx], - clustererNN.mClusterFlags[2 * glo_idx + 1]); + setClusterFromNN(pc, clustererNN.mOutputDataReg2_32 + model_output_index, clustererNN.mClusterFlags + 2 * glo_idx, peak, central_charge, (clusterer.mPmemory->frag).start, full_glo_idx, 1, 3, 9, 5, 7, true, true); } else { - publishPadPosition = static_cast(peak.pad()) + (float)clustererNN.mOutputDataReg2_16[model_output_index + 1]; - publishTimePosition = static_cast(peak.time()) + (float)clustererNN.mOutputDataReg2_16[model_output_index + 3]; - isBoundaryPublish(full_glo_idx, static_cast(peak.row()), publishPadPosition, publishTimePosition); - pc.setFull(central_charge * (float)clustererNN.mOutputDataReg2_16[model_output_index + 9], - publishPadPosition, - (float)clustererNN.mOutputDataReg2_16[model_output_index + 5], - (clusterer.mPmemory->frag).start + publishTimePosition, - (float)clustererNN.mOutputDataReg2_16[model_output_index + 7], - clustererNN.mClusterFlags[2 * glo_idx], - clustererNN.mClusterFlags[2 * glo_idx + 1]); - } - - rejectCluster = !pc.toNative(peak, central_charge, myCluster, clusterer.Param(), chargeMap); - if (clustererNN.mNnClusterizerUseClassification) { - rejectCluster |= (clustererNN.mOutputDataClass[CAMath::Min(full_glo_idx, (uint32_t)clusterer.mPmemory->counters.nClusters - 1)] <= 0); - } - if (rejectCluster) { - if (clusterer.mPclusterPosInRow) { - clusterer.mPclusterPosInRow[full_glo_idx] = clusterer.mNMaxClusterPerRow; - } - return; - } - - if (clusterOut != nullptr) { - rowIndex = GPUTPCCFClusterizer::sortIntoBuckets( - clusterer, - myCluster, - peak.row(), - clusterer.mNMaxClusterPerRow, - clusterer.mPclusterInRow, - clusterOut); - if (clusterer.mPclusterPosInRow != nullptr) { - clusterer.mPclusterPosInRow[full_glo_idx] = rowIndex; - } - } else if (clusterer.mPclusterPosInRow) { - rowIndex = clusterer.mPclusterPosInRow[full_glo_idx]; + setClusterFromNN(pc, clustererNN.mOutputDataReg2_16 + model_output_index, clustererNN.mClusterFlags + 2 * glo_idx, peak, central_charge, (clusterer.mPmemory->frag).start, full_glo_idx, 1, 3, 9, 5, 7, true, true); } + storeCluster(clusterer, clustererNN, pc, peak, central_charge, chargeMap, full_glo_idx, classIdx, labelAcc, false); // GPUCA_IGNORE_ON_GPU(labelAcc->commit(peak.row(), rowIndex, clusterer.mNMaxClusterPerRow)); // -> Is this needed? How to handle MC labels for split clusters? } diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizerKernels.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizerKernels.h index 10ce5f3ee0288..bba5dbbcb9fd3 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizerKernels.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizerKernels.h @@ -64,6 +64,11 @@ class GPUTPCNNClusterizerKernels : public GPUKernelTemplate static GPUd() int32_t rowOffset(int32_t, int32_t); static GPUd() bool isBoundary(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); static GPUd() bool isBoundaryPublish(int32_t, int32_t, float&, float&); + static GPUdi() void writeInput(GPUTPCNNClusterizer&, int8_t, uint32_t, float); + static GPUdi() float readProbability(const GPUTPCNNClusterizer&, int8_t, uint32_t); + template + static GPUdi() void setClusterFromNN(ClusterAccumulator&, const T*, const int8_t*, const CfChargePos&, float, tpccf::TPCTime, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, bool, bool); + static GPUdi() bool storeCluster(GPUTPCClusterFinder&, const GPUTPCNNClusterizer&, ClusterAccumulator&, const CfChargePos&, float, const CfArray2D&, uint32_t, uint32_t, MCLabelAccumulator*, bool); }; } // namespace o2::gpu