From f6536d64d90d0db21c8e2547fbf13474d4798b2a Mon Sep 17 00:00:00 2001 From: Andres Rios-Tascon Date: Wed, 17 Jan 2024 14:06:49 -0500 Subject: [PATCH 1/7] Removed cppitertools dependency --- SDL/LST.cc | 2 +- SDL/LST.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/SDL/LST.cc b/SDL/LST.cc index 97cb38a7..225f19ff 100644 --- a/SDL/LST.cc +++ b/SDL/LST.cc @@ -118,7 +118,7 @@ void SDL::LST::prepareInput(const std::vector see_px, std::iota(hitIdxs.begin(), hitIdxs.end(), 0); const int hit_size = trkX.size(); - for (auto&& [iSeed, _] : iter::enumerate(see_stateTrajGlbPx)) { + for(size_t iSeed = 0; iSeed < n_see; iSeed++) { ROOT::Math::PxPyPzMVector p3LH(see_stateTrajGlbPx[iSeed], see_stateTrajGlbPy[iSeed], see_stateTrajGlbPz[iSeed], 0); ROOT::Math::XYZVector p3LH_helper(see_stateTrajGlbPx[iSeed], see_stateTrajGlbPy[iSeed], see_stateTrajGlbPz[iSeed]); float ptIn = p3LH.Pt(); diff --git a/SDL/LST.h b/SDL/LST.h index dbbac49c..a77fa460 100644 --- a/SDL/LST.h +++ b/SDL/LST.h @@ -6,8 +6,6 @@ #include #include -#include "code/cppitertools/enumerate.hpp" - #include "TString.h" #include "Math/Vector3D.h" #include From 2f2fdcd434d7138216b054e15874112137ee0e58 Mon Sep 17 00:00:00 2001 From: Andres Rios-Tascon Date: Mon, 29 Jan 2024 15:36:30 -0500 Subject: [PATCH 2/7] Fixed comparisons between signed and unsigned integers --- SDL/Event.cc | 62 ++++++++++++++-------------- SDL/Hit.h | 18 ++++----- SDL/Kernels.h | 16 ++++---- SDL/MiniDoublet.h | 20 ++++----- SDL/Module.h | 24 +++++------ SDL/PixelTriplet.h | 64 ++++++++++++++--------------- SDL/Quintuplet.h | 34 ++++++++-------- SDL/Segment.h | 34 ++++++++-------- SDL/TrackCandidate.h | 96 ++++++++++++++++++++++---------------------- SDL/Triplet.h | 32 +++++++-------- 10 files changed, 200 insertions(+), 200 deletions(-) diff --git a/SDL/Event.cc b/SDL/Event.cc index 422f4689..530b5835 100644 --- a/SDL/Event.cc +++ b/SDL/Event.cc @@ -269,7 +269,7 @@ void SDL::Event::addPixelSegmentToEvent(std::vector hitIndices0, std::vector superbin, std::vector pixelType, std::vector isQuad) { - int size = ptIn.size(); + unsigned int size = ptIn.size(); if (size > N_MAX_PIXEL_SEGMENTS_PER_MODULE) { printf( @@ -280,7 +280,7 @@ void SDL::Event::addPixelSegmentToEvent(std::vector hitIndices0, size = N_MAX_PIXEL_SEGMENTS_PER_MODULE; } - int mdSize = 2 * size; + unsigned int mdSize = 2 * size; uint16_t pixelModuleIndex = (*detIdToIndex)[1]; if (mdsInGPU == nullptr) { @@ -583,11 +583,11 @@ void SDL::Event::createTriplets() { auto index_gpu_buf = allocBufWrapper(devAcc, nLowerModules, queue); // Allocate and copy nSegments from device to host - auto nSegments_buf = allocBufWrapper(devHost, nLowerModules, queue); + auto nSegments_buf = allocBufWrapper(devHost, nLowerModules, queue); alpaka::memcpy(queue, nSegments_buf, segmentsBuffers->nSegments_buf, nLowerModules); alpaka::wait(queue); - int* nSegments = alpaka::getPtrNative(nSegments_buf); + unsigned int* nSegments = alpaka::getPtrNative(nSegments_buf); // Allocate and copy module_nConnectedModules from device to host auto module_nConnectedModules_buf = allocBufWrapper(devHost, nLowerModules, queue); @@ -787,10 +787,10 @@ void SDL::Event::createTrackCandidates() { alpaka::enqueue(queue, addpLSasTrackCandidateInGPUTask); // Check if either N_MAX_PIXEL_TRACK_CANDIDATES or N_MAX_NONPIXEL_TRACK_CANDIDATES was reached - auto nTrackCanpT5Host_buf = allocBufWrapper(devHost, 1, queue); - auto nTrackCanpT3Host_buf = allocBufWrapper(devHost, 1, queue); - auto nTrackCanpLSHost_buf = allocBufWrapper(devHost, 1, queue); - auto nTrackCanT5Host_buf = allocBufWrapper(devHost, 1, queue); + auto nTrackCanpT5Host_buf = allocBufWrapper(devHost, 1, queue); + auto nTrackCanpT3Host_buf = allocBufWrapper(devHost, 1, queue); + auto nTrackCanpLSHost_buf = allocBufWrapper(devHost, 1, queue); + auto nTrackCanT5Host_buf = allocBufWrapper(devHost, 1, queue); alpaka::memcpy(queue, nTrackCanpT5Host_buf, trackCandidatesBuffers->nTrackCandidatespT5_buf, 1); alpaka::memcpy(queue, nTrackCanpT3Host_buf, trackCandidatesBuffers->nTrackCandidatespT3_buf, 1); alpaka::memcpy(queue, nTrackCanpLSHost_buf, trackCandidatesBuffers->nTrackCandidatespLS_buf, 1); @@ -819,7 +819,7 @@ void SDL::Event::createPixelTriplets() { pixelTripletsInGPU->setData(*pixelTripletsBuffers); } - int nInnerSegments; + unsigned int nInnerSegments; auto nInnerSegments_src_view = alpaka::createView(devHost, &nInnerSegments, (size_t)1u); auto dev_view_nSegments = alpaka::createSubView(segmentsBuffers->nSegments_buf, (Idx)1u, (Idx)nLowerModules); @@ -1052,7 +1052,7 @@ void SDL::Event::createPixelQuintuplets() { trackCandidatesInGPU->setData(*trackCandidatesBuffers); } - int nInnerSegments; + unsigned int nInnerSegments; auto nInnerSegments_src_view = alpaka::createView(devHost, &nInnerSegments, (size_t)1u); // Create a sub-view for the device buffer @@ -1177,7 +1177,7 @@ void SDL::Event::createPixelQuintuplets() { } void SDL::Event::addMiniDoubletsToEventExplicit() { - auto nMDsCPU_buf = allocBufWrapper(devHost, nLowerModules, queue); + auto nMDsCPU_buf = allocBufWrapper(devHost, nLowerModules, queue); alpaka::memcpy(queue, nMDsCPU_buf, miniDoubletsBuffers->nMDs_buf, nLowerModules); auto module_subdets_buf = allocBufWrapper(devHost, nLowerModules, queue); @@ -1191,7 +1191,7 @@ void SDL::Event::addMiniDoubletsToEventExplicit() { alpaka::wait(queue); - int* nMDsCPU = alpaka::getPtrNative(nMDsCPU_buf); + unsigned int* nMDsCPU = alpaka::getPtrNative(nMDsCPU_buf); short* module_subdets = alpaka::getPtrNative(module_subdets_buf); short* module_layers = alpaka::getPtrNative(module_layers_buf); int* module_hitRanges = alpaka::getPtrNative(module_hitRanges_buf); @@ -1208,7 +1208,7 @@ void SDL::Event::addMiniDoubletsToEventExplicit() { } void SDL::Event::addSegmentsToEventExplicit() { - auto nSegmentsCPU_buf = allocBufWrapper(devHost, nLowerModules, queue); + auto nSegmentsCPU_buf = allocBufWrapper(devHost, nLowerModules, queue); alpaka::memcpy(queue, nSegmentsCPU_buf, segmentsBuffers->nSegments_buf, nLowerModules); auto module_subdets_buf = allocBufWrapper(devHost, nLowerModules, queue); @@ -1219,7 +1219,7 @@ void SDL::Event::addSegmentsToEventExplicit() { alpaka::wait(queue); - int* nSegmentsCPU = alpaka::getPtrNative(nSegmentsCPU_buf); + unsigned int* nSegmentsCPU = alpaka::getPtrNative(nSegmentsCPU_buf); short* module_subdets = alpaka::getPtrNative(module_subdets_buf); short* module_layers = alpaka::getPtrNative(module_layers_buf); @@ -1235,7 +1235,7 @@ void SDL::Event::addSegmentsToEventExplicit() { } void SDL::Event::addQuintupletsToEventExplicit() { - auto nQuintupletsCPU_buf = allocBufWrapper(devHost, nLowerModules, queue); + auto nQuintupletsCPU_buf = allocBufWrapper(devHost, nLowerModules, queue); alpaka::memcpy(queue, nQuintupletsCPU_buf, quintupletsBuffers->nQuintuplets_buf, nLowerModules); auto module_subdets_buf = allocBufWrapper(devHost, nModules, queue); @@ -1249,7 +1249,7 @@ void SDL::Event::addQuintupletsToEventExplicit() { alpaka::wait(queue); - int* nQuintupletsCPU = alpaka::getPtrNative(nQuintupletsCPU_buf); + unsigned int* nQuintupletsCPU = alpaka::getPtrNative(nQuintupletsCPU_buf); short* module_subdets = alpaka::getPtrNative(module_subdets_buf); short* module_layers = alpaka::getPtrNative(module_layers_buf); int* module_quintupletModuleIndices = alpaka::getPtrNative(module_quintupletModuleIndices_buf); @@ -1266,7 +1266,7 @@ void SDL::Event::addQuintupletsToEventExplicit() { } void SDL::Event::addTripletsToEventExplicit() { - auto nTripletsCPU_buf = allocBufWrapper(devHost, nLowerModules, queue); + auto nTripletsCPU_buf = allocBufWrapper(devHost, nLowerModules, queue); alpaka::memcpy(queue, nTripletsCPU_buf, tripletsBuffers->nTriplets_buf, nLowerModules); auto module_subdets_buf = allocBufWrapper(devHost, nLowerModules, queue); @@ -1276,7 +1276,7 @@ void SDL::Event::addTripletsToEventExplicit() { alpaka::memcpy(queue, module_layers_buf, modulesBuffers->layers_buf, nLowerModules); alpaka::wait(queue); - int* nTripletsCPU = alpaka::getPtrNative(nTripletsCPU_buf); + unsigned int* nTripletsCPU = alpaka::getPtrNative(nTripletsCPU_buf); short* module_subdets = alpaka::getPtrNative(module_subdets_buf); short* module_layers = alpaka::getPtrNative(module_layers_buf); @@ -1396,7 +1396,7 @@ unsigned int SDL::Event::getNumberOfTripletsByLayerEndcap(unsigned int layer) { } int SDL::Event::getNumberOfPixelTriplets() { - auto nPixelTriplets_buf = allocBufWrapper(devHost, 1, queue); + auto nPixelTriplets_buf = allocBufWrapper(devHost, 1, queue); alpaka::memcpy(queue, nPixelTriplets_buf, pixelTripletsBuffers->nPixelTriplets_buf, 1); alpaka::wait(queue); @@ -1407,7 +1407,7 @@ int SDL::Event::getNumberOfPixelTriplets() { } int SDL::Event::getNumberOfPixelQuintuplets() { - auto nPixelQuintuplets_buf = allocBufWrapper(devHost, 1, queue); + auto nPixelQuintuplets_buf = allocBufWrapper(devHost, 1, queue); alpaka::memcpy(queue, nPixelQuintuplets_buf, pixelQuintupletsBuffers->nPixelQuintuplets_buf, 1); alpaka::wait(queue); @@ -1445,7 +1445,7 @@ unsigned int SDL::Event::getNumberOfQuintupletsByLayerEndcap(unsigned int layer) } int SDL::Event::getNumberOfTrackCandidates() { - auto nTrackCandidates_buf = allocBufWrapper(devHost, 1, queue); + auto nTrackCandidates_buf = allocBufWrapper(devHost, 1, queue); alpaka::memcpy(queue, nTrackCandidates_buf, trackCandidatesBuffers->nTrackCandidates_buf, 1); alpaka::wait(queue); @@ -1456,7 +1456,7 @@ int SDL::Event::getNumberOfTrackCandidates() { } int SDL::Event::getNumberOfPT5TrackCandidates() { - auto nTrackCandidatesPT5_buf = allocBufWrapper(devHost, 1, queue); + auto nTrackCandidatesPT5_buf = allocBufWrapper(devHost, 1, queue); alpaka::memcpy(queue, nTrackCandidatesPT5_buf, trackCandidatesBuffers->nTrackCandidatespT5_buf, 1); alpaka::wait(queue); @@ -1467,7 +1467,7 @@ int SDL::Event::getNumberOfPT5TrackCandidates() { } int SDL::Event::getNumberOfPT3TrackCandidates() { - auto nTrackCandidatesPT3_buf = allocBufWrapper(devHost, 1, queue); + auto nTrackCandidatesPT3_buf = allocBufWrapper(devHost, 1, queue); alpaka::memcpy(queue, nTrackCandidatesPT3_buf, trackCandidatesBuffers->nTrackCandidatespT3_buf, 1); alpaka::wait(queue); @@ -1478,7 +1478,7 @@ int SDL::Event::getNumberOfPT3TrackCandidates() { } int SDL::Event::getNumberOfPLSTrackCandidates() { - auto nTrackCandidatesPLS_buf = allocBufWrapper(devHost, 1, queue); + auto nTrackCandidatesPLS_buf = allocBufWrapper(devHost, 1, queue); alpaka::memcpy(queue, nTrackCandidatesPLS_buf, trackCandidatesBuffers->nTrackCandidatespLS_buf, 1); alpaka::wait(queue); @@ -1489,8 +1489,8 @@ int SDL::Event::getNumberOfPLSTrackCandidates() { } int SDL::Event::getNumberOfPixelTrackCandidates() { - auto nTrackCandidates_buf = allocBufWrapper(devHost, 1, queue); - auto nTrackCandidatesT5_buf = allocBufWrapper(devHost, 1, queue); + auto nTrackCandidates_buf = allocBufWrapper(devHost, 1, queue); + auto nTrackCandidatesT5_buf = allocBufWrapper(devHost, 1, queue); alpaka::memcpy(queue, nTrackCandidates_buf, trackCandidatesBuffers->nTrackCandidates_buf, 1); alpaka::memcpy(queue, nTrackCandidatesT5_buf, trackCandidatesBuffers->nTrackCandidatesT5_buf, 1); @@ -1503,7 +1503,7 @@ int SDL::Event::getNumberOfPixelTrackCandidates() { } int SDL::Event::getNumberOfT5TrackCandidates() { - auto nTrackCandidatesT5_buf = allocBufWrapper(devHost, 1, queue); + auto nTrackCandidatesT5_buf = allocBufWrapper(devHost, 1, queue); alpaka::memcpy(queue, nTrackCandidatesT5_buf, trackCandidatesBuffers->nTrackCandidatesT5_buf, 1); alpaka::wait(queue); @@ -1712,7 +1712,7 @@ SDL::quintupletsBuffer* SDL::Event::getQuintuplets() { SDL::pixelTripletsBuffer* SDL::Event::getPixelTriplets() { if (pixelTripletsInCPU == nullptr) { // Get nPixelTriplets parameter to initialize host based quintupletsInCPU - auto nPixelTriplets_buf = allocBufWrapper(devHost, 1, queue); + auto nPixelTriplets_buf = allocBufWrapper(devHost, 1, queue); alpaka::memcpy(queue, nPixelTriplets_buf, pixelTripletsBuffers->nPixelTriplets_buf, 1); alpaka::wait(queue); @@ -1753,7 +1753,7 @@ SDL::pixelTripletsBuffer* SDL::Event::getPixelTriplets() { SDL::pixelQuintupletsBuffer* SDL::Event::getPixelQuintuplets() { if (pixelQuintupletsInCPU == nullptr) { // Get nPixelQuintuplets parameter to initialize host based quintupletsInCPU - auto nPixelQuintuplets_buf = allocBufWrapper(devHost, 1, queue); + auto nPixelQuintuplets_buf = allocBufWrapper(devHost, 1, queue); alpaka::memcpy(queue, nPixelQuintuplets_buf, pixelQuintupletsBuffers->nPixelQuintuplets_buf, 1); alpaka::wait(queue); @@ -1790,7 +1790,7 @@ SDL::pixelQuintupletsBuffer* SDL::Event::getPixelQuintuplets() { SDL::trackCandidatesBuffer* SDL::Event::getTrackCandidates() { if (trackCandidatesInCPU == nullptr) { // Get nTrackCanHost parameter to initialize host based trackCandidatesInCPU - auto nTrackCanHost_buf = allocBufWrapper(devHost, 1, queue); + auto nTrackCanHost_buf = allocBufWrapper(devHost, 1, queue); alpaka::memcpy(queue, nTrackCanHost_buf, trackCandidatesBuffers->nTrackCandidates_buf, 1); alpaka::wait(queue); @@ -1824,7 +1824,7 @@ SDL::trackCandidatesBuffer* SDL::Event::getTrackCandidates() { SDL::trackCandidatesBuffer* SDL::Event::getTrackCandidatesInCMSSW() { if (trackCandidatesInCPU == nullptr) { // Get nTrackCanHost parameter to initialize host based trackCandidatesInCPU - auto nTrackCanHost_buf = allocBufWrapper(devHost, 1, queue); + auto nTrackCanHost_buf = allocBufWrapper(devHost, 1, queue); alpaka::memcpy(queue, nTrackCanHost_buf, trackCandidatesBuffers->nTrackCandidates_buf, 1); alpaka::wait(queue); diff --git a/SDL/Hit.h b/SDL/Hit.h index ec18a554..d26d4d73 100644 --- a/SDL/Hit.h +++ b/SDL/Hit.h @@ -93,11 +93,11 @@ namespace SDL { hitRangesUpper_buf(allocBufWrapper(devAccIn, nModules, queue)), hitRangesnLower_buf(allocBufWrapper(devAccIn, nModules, queue)), hitRangesnUpper_buf(allocBufWrapper(devAccIn, nModules, queue)) { - alpaka::memset(queue, hitRanges_buf, -1, nModules * 2); - alpaka::memset(queue, hitRangesLower_buf, -1, nModules); - alpaka::memset(queue, hitRangesUpper_buf, -1, nModules); - alpaka::memset(queue, hitRangesnLower_buf, -1, nModules); - alpaka::memset(queue, hitRangesnUpper_buf, -1, nModules); + alpaka::memset(queue, hitRanges_buf, -1); + alpaka::memset(queue, hitRangesLower_buf, -1); + alpaka::memset(queue, hitRangesUpper_buf, -1); + alpaka::memset(queue, hitRangesnLower_buf, -1); + alpaka::memset(queue, hitRangesnUpper_buf, -1); alpaka::wait(queue); } }; @@ -232,7 +232,7 @@ namespace SDL { Vec const globalThreadIdx = alpaka::getIdx(acc); Vec const gridThreadExtent = alpaka::getWorkDiv(acc); - for (int ihit = globalThreadIdx[2]; ihit < nHits; ihit += gridThreadExtent[2]) { + for (unsigned int ihit = globalThreadIdx[2]; ihit < nHits; ihit += gridThreadExtent[2]) { float ihit_x = hitsInGPU.xs[ihit]; float ihit_y = hitsInGPU.ys[ihit]; float ihit_z = hitsInGPU.zs[ihit]; @@ -264,12 +264,12 @@ namespace SDL { hitsInGPU.lowEdgeYs[ihit] = ihit_y - 2.5f * sin_phi; } // Need to set initial value if index hasn't been seen before. - int old = alpaka::atomicOp(acc, &(hitsInGPU.hitRanges[lastModuleIndex * 2]), -1, ihit); + int old = alpaka::atomicOp(acc, &(hitsInGPU.hitRanges[lastModuleIndex * 2]), -1, (int) ihit); // For subsequent visits, stores the min value. if (old != -1) - alpaka::atomicOp(acc, &hitsInGPU.hitRanges[lastModuleIndex * 2], ihit); + alpaka::atomicOp(acc, &hitsInGPU.hitRanges[lastModuleIndex * 2], (int) ihit); - alpaka::atomicOp(acc, &hitsInGPU.hitRanges[lastModuleIndex * 2 + 1], ihit); + alpaka::atomicOp(acc, &hitsInGPU.hitRanges[lastModuleIndex * 2 + 1], (int) ihit); } } }; diff --git a/SDL/Kernels.h b/SDL/Kernels.h index 2bc264f6..d5d30e19 100644 --- a/SDL/Kernels.h +++ b/SDL/Kernels.h @@ -207,7 +207,7 @@ namespace SDL { for (unsigned int lowmod = globalThreadIdx[0]; lowmod < *modulesInGPU.nLowerModules; lowmod += gridThreadExtent[0]) { - int nQuintuplets_lowmod = quintupletsInGPU.nQuintuplets[lowmod]; + unsigned int nQuintuplets_lowmod = quintupletsInGPU.nQuintuplets[lowmod]; int quintupletModuleIndices_lowmod = rangesInGPU.quintupletModuleIndices[lowmod]; for (unsigned int ix1 = globalThreadIdx[1]; ix1 < nQuintuplets_lowmod; ix1 += gridThreadExtent[1]) { @@ -267,20 +267,20 @@ namespace SDL { for (unsigned int lowmodIdx1 = globalThreadIdx[1]; lowmodIdx1 < *(rangesInGPU.nEligibleT5Modules); lowmodIdx1 += gridThreadExtent[1]) { uint16_t lowmod1 = rangesInGPU.indicesOfEligibleT5Modules[lowmodIdx1]; - int nQuintuplets_lowmod1 = quintupletsInGPU.nQuintuplets[lowmod1]; + unsigned int nQuintuplets_lowmod1 = quintupletsInGPU.nQuintuplets[lowmod1]; if (nQuintuplets_lowmod1 == 0) continue; - int quintupletModuleIndices_lowmod1 = rangesInGPU.quintupletModuleIndices[lowmod1]; + unsigned int quintupletModuleIndices_lowmod1 = rangesInGPU.quintupletModuleIndices[lowmod1]; for (unsigned int lowmodIdx2 = globalThreadIdx[2]; lowmodIdx2 < *(rangesInGPU.nEligibleT5Modules); lowmodIdx2 += gridThreadExtent[2]) { uint16_t lowmod2 = rangesInGPU.indicesOfEligibleT5Modules[lowmodIdx2]; - int nQuintuplets_lowmod2 = quintupletsInGPU.nQuintuplets[lowmod2]; + unsigned int nQuintuplets_lowmod2 = quintupletsInGPU.nQuintuplets[lowmod2]; if (nQuintuplets_lowmod2 == 0) continue; - int quintupletModuleIndices_lowmod2 = rangesInGPU.quintupletModuleIndices[lowmod2]; + unsigned int quintupletModuleIndices_lowmod2 = rangesInGPU.quintupletModuleIndices[lowmod2]; for (unsigned int ix1 = 0; ix1 < nQuintuplets_lowmod1; ix1 += 1) { unsigned int ix = quintupletModuleIndices_lowmod1 + ix1; @@ -382,7 +382,7 @@ namespace SDL { Vec const globalThreadIdx = alpaka::getIdx(acc); Vec const gridThreadExtent = alpaka::getWorkDiv(acc); - int nPixelQuintuplets = *pixelQuintupletsInGPU.nPixelQuintuplets; + unsigned int nPixelQuintuplets = *pixelQuintupletsInGPU.nPixelQuintuplets; for (unsigned int ix = globalThreadIdx[1]; ix < nPixelQuintuplets; ix += gridThreadExtent[1]) { if (secondPass && pixelQuintupletsInGPU.isDup[ix]) continue; @@ -427,7 +427,7 @@ namespace SDL { if (nPixelSegments > N_MAX_PIXEL_SEGMENTS_PER_MODULE) nPixelSegments = N_MAX_PIXEL_SEGMENTS_PER_MODULE; - for (int ix = globalThreadIdx[1]; ix < nPixelSegments; ix += gridThreadExtent[1]) { + for (unsigned int ix = globalThreadIdx[1]; ix < nPixelSegments; ix += gridThreadExtent[1]) { if (secondpass && (!segmentsInGPU.isQuad[ix] || (segmentsInGPU.isDup[ix] & 1))) continue; @@ -439,7 +439,7 @@ namespace SDL { float eta_pix1 = segmentsInGPU.eta[ix]; float phi_pix1 = segmentsInGPU.phi[ix]; - for (int jx = ix + 1 + globalThreadIdx[2]; jx < nPixelSegments; jx += gridThreadExtent[2]) { + for (unsigned int jx = ix + 1 + globalThreadIdx[2]; jx < nPixelSegments; jx += gridThreadExtent[2]) { float eta_pix2 = segmentsInGPU.eta[jx]; float phi_pix2 = segmentsInGPU.phi[jx]; diff --git a/SDL/MiniDoublet.h b/SDL/MiniDoublet.h index 15692eb8..7cdbbfa8 100644 --- a/SDL/MiniDoublet.h +++ b/SDL/MiniDoublet.h @@ -13,8 +13,8 @@ namespace SDL { unsigned int* anchorHitIndices; unsigned int* outerHitIndices; uint16_t* moduleIndices; - int* nMDs; //counter per module - int* totOccupancyMDs; //counter per module + unsigned int* nMDs; //counter per module + unsigned int* totOccupancyMDs; //counter per module float* dphichanges; float* dzs; //will store drt if the module is endcap @@ -100,8 +100,8 @@ namespace SDL { Buf anchorHitIndices_buf; Buf outerHitIndices_buf; Buf moduleIndices_buf; - Buf nMDs_buf; - Buf totOccupancyMDs_buf; + Buf nMDs_buf; + Buf totOccupancyMDs_buf; Buf dphichanges_buf; Buf dzs_buf; @@ -144,8 +144,8 @@ namespace SDL { anchorHitIndices_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)), outerHitIndices_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)), moduleIndices_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)), - nMDs_buf(allocBufWrapper(devAccIn, nLowerModules + 1, queue)), - totOccupancyMDs_buf(allocBufWrapper(devAccIn, nLowerModules + 1, queue)), + nMDs_buf(allocBufWrapper(devAccIn, nLowerModules + 1, queue)), + totOccupancyMDs_buf(allocBufWrapper(devAccIn, nLowerModules + 1, queue)), dphichanges_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)), dzs_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)), dphis_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)), @@ -177,8 +177,8 @@ namespace SDL { outerLowEdgeY_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)), anchorLowEdgePhi_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)), anchorHighEdgePhi_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)) { - alpaka::memset(queue, nMDs_buf, 0, nLowerModules + 1); - alpaka::memset(queue, totOccupancyMDs_buf, 0, nLowerModules + 1); + alpaka::memset(queue, nMDs_buf, 0u); + alpaka::memset(queue, totOccupancyMDs_buf, 0u); alpaka::wait(queue); } }; @@ -954,13 +954,13 @@ namespace SDL { rtUpper); if (success) { int totOccupancyMDs = - alpaka::atomicOp(acc, &mdsInGPU.totOccupancyMDs[lowerModuleIndex], 1); + alpaka::atomicOp(acc, &mdsInGPU.totOccupancyMDs[lowerModuleIndex], 1u); if (totOccupancyMDs >= (rangesInGPU.miniDoubletModuleOccupancy[lowerModuleIndex])) { #ifdef Warnings printf("Mini-doublet excess alert! Module index = %d\n", lowerModuleIndex); #endif } else { - int mdModuleIndex = alpaka::atomicOp(acc, &mdsInGPU.nMDs[lowerModuleIndex], 1); + int mdModuleIndex = alpaka::atomicOp(acc, &mdsInGPU.nMDs[lowerModuleIndex], 1u); unsigned int mdIndex = rangesInGPU.miniDoubletModuleIndices[lowerModuleIndex] + mdModuleIndex; addMDToMemory(acc, diff --git a/SDL/Module.h b/SDL/Module.h index 5c47bfe9..0639cb22 100644 --- a/SDL/Module.h +++ b/SDL/Module.h @@ -150,18 +150,18 @@ namespace SDL { device_nTotalSegs_buf(allocBufWrapper(devAccIn, 1, queue)), device_nTotalTrips_buf(allocBufWrapper(devAccIn, 1, queue)), device_nTotalQuints_buf(allocBufWrapper(devAccIn, 1, queue)) { - alpaka::memset(queue, hitRanges_buf, -1, nMod * 2); - alpaka::memset(queue, hitRangesLower_buf, -1, nMod); - alpaka::memset(queue, hitRangesUpper_buf, -1, nMod); - alpaka::memset(queue, hitRangesnLower_buf, -1, nMod); - alpaka::memset(queue, hitRangesnUpper_buf, -1, nMod); - alpaka::memset(queue, mdRanges_buf, -1, nMod * 2); - alpaka::memset(queue, segmentRanges_buf, -1, nMod * 2); - alpaka::memset(queue, trackletRanges_buf, -1, nMod * 2); - alpaka::memset(queue, tripletRanges_buf, -1, nMod * 2); - alpaka::memset(queue, trackCandidateRanges_buf, -1, nMod * 2); - alpaka::memset(queue, quintupletRanges_buf, -1, nMod * 2); - alpaka::memset(queue, quintupletModuleIndices_buf, -1, nLowerMod); + alpaka::memset(queue, hitRanges_buf, -1); + alpaka::memset(queue, hitRangesLower_buf, -1); + alpaka::memset(queue, hitRangesUpper_buf, -1); + alpaka::memset(queue, hitRangesnLower_buf, -1); + alpaka::memset(queue, hitRangesnUpper_buf, -1); + alpaka::memset(queue, mdRanges_buf, -1); + alpaka::memset(queue, segmentRanges_buf, -1); + alpaka::memset(queue, trackletRanges_buf, -1); + alpaka::memset(queue, tripletRanges_buf, -1); + alpaka::memset(queue, trackCandidateRanges_buf, -1); + alpaka::memset(queue, quintupletRanges_buf, -1); + alpaka::memset(queue, quintupletModuleIndices_buf, -1); alpaka::wait(queue); } }; diff --git a/SDL/PixelTriplet.h b/SDL/PixelTriplet.h index 5ab38402..31260168 100644 --- a/SDL/PixelTriplet.h +++ b/SDL/PixelTriplet.h @@ -14,8 +14,8 @@ namespace SDL { struct pixelTriplets { unsigned int* pixelSegmentIndices; unsigned int* tripletIndices; - int* nPixelTriplets; - int* totOccupancyPixelTriplets; + unsigned int* nPixelTriplets; + unsigned int* totOccupancyPixelTriplets; float* pixelRadiusError; float* rPhiChiSquared; @@ -71,8 +71,8 @@ namespace SDL { struct pixelTripletsBuffer : pixelTriplets { Buf pixelSegmentIndices_buf; Buf tripletIndices_buf; - Buf nPixelTriplets_buf; - Buf totOccupancyPixelTriplets_buf; + Buf nPixelTriplets_buf; + Buf totOccupancyPixelTriplets_buf; Buf pixelRadius_buf; Buf tripletRadius_buf; Buf pt_buf; @@ -97,8 +97,8 @@ namespace SDL { pixelTripletsBuffer(unsigned int maxPixelTriplets, TDevAcc const& devAccIn, TQueue& queue) : pixelSegmentIndices_buf(allocBufWrapper(devAccIn, maxPixelTriplets, queue)), tripletIndices_buf(allocBufWrapper(devAccIn, maxPixelTriplets, queue)), - nPixelTriplets_buf(allocBufWrapper(devAccIn, 1, queue)), - totOccupancyPixelTriplets_buf(allocBufWrapper(devAccIn, 1, queue)), + nPixelTriplets_buf(allocBufWrapper(devAccIn, 1, queue)), + totOccupancyPixelTriplets_buf(allocBufWrapper(devAccIn, 1, queue)), pixelRadius_buf(allocBufWrapper(devAccIn, maxPixelTriplets, queue)), tripletRadius_buf(allocBufWrapper(devAccIn, maxPixelTriplets, queue)), pt_buf(allocBufWrapper(devAccIn, maxPixelTriplets, queue)), @@ -118,9 +118,9 @@ namespace SDL { rPhiChiSquared_buf(allocBufWrapper(devAccIn, maxPixelTriplets, queue)), rPhiChiSquaredInwards_buf(allocBufWrapper(devAccIn, maxPixelTriplets, queue)), rzChiSquared_buf(allocBufWrapper(devAccIn, maxPixelTriplets, queue)) { - alpaka::memset(queue, nPixelTriplets_buf, 0, 1); - alpaka::memset(queue, totOccupancyPixelTriplets_buf, 0, 1); - alpaka::memset(queue, partOfPT5_buf, 0, maxPixelTriplets); + alpaka::memset(queue, nPixelTriplets_buf, 0u); + alpaka::memset(queue, totOccupancyPixelTriplets_buf, 0u); + alpaka::memset(queue, partOfPT5_buf, false); alpaka::wait(queue); } }; @@ -397,7 +397,7 @@ namespace SDL { template ALPAKA_FN_ACC ALPAKA_FN_INLINE float computeChiSquaredpT3(TAcc const& acc, - int nPoints, + unsigned int nPoints, float* xs, float* ys, float* delta1, @@ -1070,10 +1070,10 @@ namespace SDL { Vec const gridThreadExtent = alpaka::getWorkDiv(acc); Vec const blockThreadExtent = alpaka::getWorkDiv(acc); - for (int i_pLS = globalThreadIdx[1]; i_pLS < nPixelSegments; i_pLS += gridThreadExtent[1]) { + for (unsigned int i_pLS = globalThreadIdx[1]; i_pLS < nPixelSegments; i_pLS += gridThreadExtent[1]) { auto iLSModule_max = connectedPixelIndex[i_pLS] + connectedPixelSize[i_pLS]; - for (int iLSModule = connectedPixelIndex[i_pLS] + globalBlockIdx[0]; iLSModule < iLSModule_max; + for (unsigned int iLSModule = connectedPixelIndex[i_pLS] + globalBlockIdx[0]; iLSModule < iLSModule_max; iLSModule += gridBlockExtent[0]) { uint16_t tripletLowerModuleIndex = modulesInGPU @@ -1154,14 +1154,14 @@ namespace SDL { float phi_pix = segmentsInGPU.phi[i_pLS]; float pt = segmentsInGPU.ptIn[i_pLS]; float score = rPhiChiSquared + rPhiChiSquaredInwards; - int totOccupancyPixelTriplets = - alpaka::atomicOp(acc, pixelTripletsInGPU.totOccupancyPixelTriplets, 1); + unsigned int totOccupancyPixelTriplets = + alpaka::atomicOp(acc, pixelTripletsInGPU.totOccupancyPixelTriplets, 1u); if (totOccupancyPixelTriplets >= N_MAX_PIXEL_TRIPLETS) { #ifdef Warnings printf("Pixel Triplet excess alert!\n"); #endif } else { - int pixelTripletIndex = alpaka::atomicOp(acc, pixelTripletsInGPU.nPixelTriplets, 1); + unsigned int pixelTripletIndex = alpaka::atomicOp(acc, pixelTripletsInGPU.nPixelTriplets, 1u); addPixelTripletToMemory(modulesInGPU, mdsInGPU, segmentsInGPU, @@ -1904,8 +1904,8 @@ namespace SDL { struct pixelQuintuplets { unsigned int* pixelIndices; unsigned int* T5Indices; - int* nPixelQuintuplets; - int* totOccupancyPixelQuintuplets; + unsigned int* nPixelQuintuplets; + unsigned int* totOccupancyPixelQuintuplets; bool* isDup; FPX* score; FPX* eta; @@ -1948,8 +1948,8 @@ namespace SDL { struct pixelQuintupletsBuffer : pixelQuintuplets { Buf pixelIndices_buf; Buf T5Indices_buf; - Buf nPixelQuintuplets_buf; - Buf totOccupancyPixelQuintuplets_buf; + Buf nPixelQuintuplets_buf; + Buf totOccupancyPixelQuintuplets_buf; Buf isDup_buf; Buf score_buf; Buf eta_buf; @@ -1969,8 +1969,8 @@ namespace SDL { pixelQuintupletsBuffer(unsigned int maxPixelQuintuplets, TDevAcc const& devAccIn, TQueue& queue) : pixelIndices_buf(allocBufWrapper(devAccIn, maxPixelQuintuplets, queue)), T5Indices_buf(allocBufWrapper(devAccIn, maxPixelQuintuplets, queue)), - nPixelQuintuplets_buf(allocBufWrapper(devAccIn, 1, queue)), - totOccupancyPixelQuintuplets_buf(allocBufWrapper(devAccIn, 1, queue)), + nPixelQuintuplets_buf(allocBufWrapper(devAccIn, 1, queue)), + totOccupancyPixelQuintuplets_buf(allocBufWrapper(devAccIn, 1, queue)), isDup_buf(allocBufWrapper(devAccIn, maxPixelQuintuplets, queue)), score_buf(allocBufWrapper(devAccIn, maxPixelQuintuplets, queue)), eta_buf(allocBufWrapper(devAccIn, maxPixelQuintuplets, queue)), @@ -1985,8 +1985,8 @@ namespace SDL { rzChiSquared_buf(allocBufWrapper(devAccIn, maxPixelQuintuplets, queue)), rPhiChiSquared_buf(allocBufWrapper(devAccIn, maxPixelQuintuplets, queue)), rPhiChiSquaredInwards_buf(allocBufWrapper(devAccIn, maxPixelQuintuplets, queue)) { - alpaka::memset(queue, nPixelQuintuplets_buf, 0, 1); - alpaka::memset(queue, totOccupancyPixelQuintuplets_buf, 0, 1); + alpaka::memset(queue, nPixelQuintuplets_buf, 0u); + alpaka::memset(queue, totOccupancyPixelQuintuplets_buf, 0u); alpaka::wait(queue); } }; @@ -2250,7 +2250,7 @@ namespace SDL { template ALPAKA_FN_ACC ALPAKA_FN_INLINE float computeChiSquaredpT5(TAcc const& acc, - int nPoints, + unsigned int nPoints, float* xs, float* ys, float* delta1, @@ -2301,7 +2301,7 @@ namespace SDL { float* delta2, float* slopes, bool* isFlat, - int nPoints = 5, + unsigned int nPoints = 5, bool anchorHits = true) { /* bool anchorHits required to deal with a weird edge case wherein @@ -2731,9 +2731,9 @@ namespace SDL { Vec const gridThreadExtent = alpaka::getWorkDiv(acc); Vec const blockThreadExtent = alpaka::getWorkDiv(acc); - for (int i_pLS = globalThreadIdx[1]; i_pLS < nPixelSegments; i_pLS += gridThreadExtent[1]) { + for (unsigned int i_pLS = globalThreadIdx[1]; i_pLS < nPixelSegments; i_pLS += gridThreadExtent[1]) { auto iLSModule_max = connectedPixelIndex[i_pLS] + connectedPixelSize[i_pLS]; - for (int iLSModule = connectedPixelIndex[i_pLS] + globalBlockIdx[0]; iLSModule < iLSModule_max; + for (unsigned int iLSModule = connectedPixelIndex[i_pLS] + globalBlockIdx[0]; iLSModule < iLSModule_max; iLSModule += gridBlockExtent[0]) { //these are actual module indices uint16_t quintupletLowerModuleIndex = modulesInGPU.connectedPixels[iLSModule]; @@ -2744,7 +2744,7 @@ namespace SDL { uint16_t pixelModuleIndex = *modulesInGPU.nLowerModules; if (segmentsInGPU.isDup[i_pLS]) continue; - int nOuterQuintuplets = quintupletsInGPU.nQuintuplets[quintupletLowerModuleIndex]; + unsigned int nOuterQuintuplets = quintupletsInGPU.nQuintuplets[quintupletLowerModuleIndex]; if (nOuterQuintuplets == 0) continue; @@ -2781,15 +2781,15 @@ namespace SDL { centerY, static_cast(i_pLS)); if (success) { - int totOccupancyPixelQuintuplets = - alpaka::atomicOp(acc, pixelQuintupletsInGPU.totOccupancyPixelQuintuplets, 1); + unsigned int totOccupancyPixelQuintuplets = + alpaka::atomicOp(acc, pixelQuintupletsInGPU.totOccupancyPixelQuintuplets, 1u); if (totOccupancyPixelQuintuplets >= N_MAX_PIXEL_QUINTUPLETS) { #ifdef Warnings printf("Pixel Quintuplet excess alert!\n"); #endif } else { - int pixelQuintupletIndex = - alpaka::atomicOp(acc, pixelQuintupletsInGPU.nPixelQuintuplets, 1); + unsigned int pixelQuintupletIndex = + alpaka::atomicOp(acc, pixelQuintupletsInGPU.nPixelQuintuplets, 1u); float eta = __H2F(quintupletsInGPU.eta[quintupletIndex]); float phi = __H2F(quintupletsInGPU.phi[quintupletIndex]); diff --git a/SDL/Quintuplet.h b/SDL/Quintuplet.h index 9048e42d..223747f2 100644 --- a/SDL/Quintuplet.h +++ b/SDL/Quintuplet.h @@ -14,8 +14,8 @@ namespace SDL { struct quintuplets { unsigned int* tripletIndices; uint16_t* lowerModuleIndices; - int* nQuintuplets; - int* totOccupancyQuintuplets; + unsigned int* nQuintuplets; + unsigned int* totOccupancyQuintuplets; unsigned int* nMemoryLocations; FPX* innerRadius; @@ -73,8 +73,8 @@ namespace SDL { struct quintupletsBuffer : quintuplets { Buf tripletIndices_buf; Buf lowerModuleIndices_buf; - Buf nQuintuplets_buf; - Buf totOccupancyQuintuplets_buf; + Buf nQuintuplets_buf; + Buf totOccupancyQuintuplets_buf; Buf nMemoryLocations_buf; Buf innerRadius_buf; @@ -103,8 +103,8 @@ namespace SDL { quintupletsBuffer(unsigned int nTotalQuintuplets, unsigned int nLowerModules, TDevAcc const& devAccIn, TQueue& queue) : tripletIndices_buf(allocBufWrapper(devAccIn, 2 * nTotalQuintuplets, queue)), lowerModuleIndices_buf(allocBufWrapper(devAccIn, 5 * nTotalQuintuplets, queue)), - nQuintuplets_buf(allocBufWrapper(devAccIn, nLowerModules, queue)), - totOccupancyQuintuplets_buf(allocBufWrapper(devAccIn, nLowerModules, queue)), + nQuintuplets_buf(allocBufWrapper(devAccIn, nLowerModules, queue)), + totOccupancyQuintuplets_buf(allocBufWrapper(devAccIn, nLowerModules, queue)), nMemoryLocations_buf(allocBufWrapper(devAccIn, 1, queue)), innerRadius_buf(allocBufWrapper(devAccIn, nTotalQuintuplets, queue)), bridgeRadius_buf(allocBufWrapper(devAccIn, nTotalQuintuplets, queue)), @@ -125,11 +125,11 @@ namespace SDL { rzChiSquared_buf(allocBufWrapper(devAccIn, nTotalQuintuplets, queue)), chiSquared_buf(allocBufWrapper(devAccIn, nTotalQuintuplets, queue)), nonAnchorChiSquared_buf(allocBufWrapper(devAccIn, nTotalQuintuplets, queue)) { - alpaka::memset(queue, nQuintuplets_buf, 0, nLowerModules); - alpaka::memset(queue, totOccupancyQuintuplets_buf, 0, nLowerModules); - alpaka::memset(queue, isDup_buf, 0, nTotalQuintuplets); - alpaka::memset(queue, TightCutFlag_buf, 0, nTotalQuintuplets); - alpaka::memset(queue, partOfPT5_buf, 0, nTotalQuintuplets); + alpaka::memset(queue, nQuintuplets_buf, 0u); + alpaka::memset(queue, totOccupancyQuintuplets_buf, 0u); + alpaka::memset(queue, isDup_buf, false); + alpaka::memset(queue, TightCutFlag_buf, false); + alpaka::memset(queue, partOfPT5_buf, false); alpaka::wait(queue); } }; @@ -1171,7 +1171,7 @@ namespace SDL { float* delta2, float* slopes, bool* isFlat, - int nPoints = 5, + unsigned int nPoints = 5, bool anchorHits = true) { /* Bool anchorHits required to deal with a weird edge case wherein @@ -1252,7 +1252,7 @@ namespace SDL { template ALPAKA_FN_ACC ALPAKA_FN_INLINE float computeRadiusUsingRegression(TAcc const& acc, - int nPoints, + unsigned int nPoints, float* xs, float* ys, float* delta1, @@ -1349,7 +1349,7 @@ namespace SDL { template ALPAKA_FN_ACC ALPAKA_FN_INLINE float computeChiSquared(TAcc const& acc, - int nPoints, + unsigned int nPoints, float* xs, float* ys, float* delta1, @@ -3074,7 +3074,7 @@ namespace SDL { uint16_t lowerModule2 = tripletsInGPU.lowerModuleIndices[3 * innerTripletIndex + 1]; uint16_t lowerModule3 = tripletsInGPU.lowerModuleIndices[3 * innerTripletIndex + 2]; unsigned int nOuterTriplets = tripletsInGPU.nTriplets[lowerModule3]; - for (int outerTripletArrayIndex = globalThreadIdx[2]; outerTripletArrayIndex < nOuterTriplets; + for (unsigned int outerTripletArrayIndex = globalThreadIdx[2]; outerTripletArrayIndex < nOuterTriplets; outerTripletArrayIndex += gridThreadExtent[2]) { unsigned int outerTripletIndex = rangesInGPU.tripletModuleIndices[lowerModule3] + outerTripletArrayIndex; uint16_t lowerModule4 = tripletsInGPU.lowerModuleIndices[3 * outerTripletIndex + 1]; @@ -3109,14 +3109,14 @@ namespace SDL { if (success) { int totOccupancyQuintuplets = - alpaka::atomicOp(acc, &quintupletsInGPU.totOccupancyQuintuplets[lowerModule1], 1); + alpaka::atomicOp(acc, &quintupletsInGPU.totOccupancyQuintuplets[lowerModule1], 1u); if (totOccupancyQuintuplets >= rangesInGPU.quintupletModuleOccupancy[lowerModule1]) { #ifdef Warnings printf("Quintuplet excess alert! Module index = %d\n", lowerModule1); #endif } else { int quintupletModuleIndex = - alpaka::atomicOp(acc, &quintupletsInGPU.nQuintuplets[lowerModule1], 1); + alpaka::atomicOp(acc, &quintupletsInGPU.nQuintuplets[lowerModule1], 1u); //this if statement should never get executed! if (rangesInGPU.quintupletModuleIndices[lowerModule1] == -1) { #ifdef Warnings diff --git a/SDL/Segment.h b/SDL/Segment.h index a3b81920..be7bd3fa 100644 --- a/SDL/Segment.h +++ b/SDL/Segment.h @@ -24,8 +24,8 @@ namespace SDL { unsigned int* outerMiniDoubletAnchorHitIndices; int* charge; int* superbin; - int* nSegments; //number of segments per inner lower module - int* totOccupancySegments; //number of segments per inner lower module + unsigned int* nSegments; //number of segments per inner lower module + unsigned int* totOccupancySegments; //number of segments per inner lower module uint4* pLSHitsIdxs; int8_t* pixelType; char* isQuad; @@ -100,8 +100,8 @@ namespace SDL { Buf outerMiniDoubletAnchorHitIndices_buf; Buf charge_buf; Buf superbin_buf; - Buf nSegments_buf; - Buf totOccupancySegments_buf; + Buf nSegments_buf; + Buf totOccupancySegments_buf; Buf pLSHitsIdxs_buf; Buf pixelType_buf; Buf isQuad_buf; @@ -139,8 +139,8 @@ namespace SDL { innerMiniDoubletAnchorHitIndices_buf(allocBufWrapper(devAccIn, nMemoryLocationsIn, queue)), outerMiniDoubletAnchorHitIndices_buf(allocBufWrapper(devAccIn, nMemoryLocationsIn, queue)), nMemoryLocations_buf(allocBufWrapper(devAccIn, 1, queue)), - nSegments_buf(allocBufWrapper(devAccIn, nLowerModules + 1, queue)), - totOccupancySegments_buf(allocBufWrapper(devAccIn, nLowerModules + 1, queue)), + nSegments_buf(allocBufWrapper(devAccIn, nLowerModules + 1, queue)), + totOccupancySegments_buf(allocBufWrapper(devAccIn, nLowerModules + 1, queue)), charge_buf(allocBufWrapper(devAccIn, maxPixelSegments, queue)), superbin_buf(allocBufWrapper(devAccIn, maxPixelSegments, queue)), pLSHitsIdxs_buf(allocBufWrapper(devAccIn, maxPixelSegments, queue)), @@ -160,10 +160,10 @@ namespace SDL { circleCenterX_buf(allocBufWrapper(devAccIn, maxPixelSegments, queue)), circleCenterY_buf(allocBufWrapper(devAccIn, maxPixelSegments, queue)), circleRadius_buf(allocBufWrapper(devAccIn, maxPixelSegments, queue)) { - alpaka::memset(queue, nSegments_buf, 0u, nLowerModules + 1); - alpaka::memset(queue, totOccupancySegments_buf, 0u, nLowerModules + 1); - alpaka::memset(queue, partOfPT5_buf, 0u, maxPixelSegments); - alpaka::memset(queue, pLSHitsIdxs_buf, 0u, maxPixelSegments); + alpaka::memset(queue, nSegments_buf, 0u); + alpaka::memset(queue, totOccupancySegments_buf, 0u); + alpaka::memset(queue, partOfPT5_buf, false); + alpaka::memset(queue, pLSHitsIdxs_buf, 0u); alpaka::wait(queue); } }; @@ -821,13 +821,13 @@ namespace SDL { unsigned int nOuterMDs = mdsInGPU.nMDs[outerLowerModuleIndex]; - int limit = nInnerMDs * nOuterMDs; + unsigned int limit = nInnerMDs * nOuterMDs; if (limit == 0) continue; - for (int hitIndex = blockThreadIdx[2]; hitIndex < limit; hitIndex += blockThreadExtent[2]) { - int innerMDArrayIdx = hitIndex / nOuterMDs; - int outerMDArrayIdx = hitIndex % nOuterMDs; + for (unsigned int hitIndex = blockThreadIdx[2]; hitIndex < limit; hitIndex += blockThreadExtent[2]) { + unsigned int innerMDArrayIdx = hitIndex / nOuterMDs; + unsigned int outerMDArrayIdx = hitIndex % nOuterMDs; if (outerMDArrayIdx >= nOuterMDs) continue; @@ -876,14 +876,14 @@ namespace SDL { if (pass) { unsigned int totOccupancySegments = alpaka::atomicOp( - acc, &segmentsInGPU.totOccupancySegments[innerLowerModuleIndex], 1); - if (totOccupancySegments >= (rangesInGPU.segmentModuleOccupancy[innerLowerModuleIndex])) { + acc, &segmentsInGPU.totOccupancySegments[innerLowerModuleIndex], 1u); + if (totOccupancySegments >= (unsigned int) (rangesInGPU.segmentModuleOccupancy[innerLowerModuleIndex])) { #ifdef Warnings printf("Segment excess alert! Module index = %d\n", innerLowerModuleIndex); #endif } else { unsigned int segmentModuleIdx = - alpaka::atomicOp(acc, &segmentsInGPU.nSegments[innerLowerModuleIndex], 1); + alpaka::atomicOp(acc, &segmentsInGPU.nSegments[innerLowerModuleIndex], 1u); unsigned int segmentIdx = rangesInGPU.segmentModuleIndices[innerLowerModuleIndex] + segmentModuleIdx; addSegmentToMemory(segmentsInGPU, diff --git a/SDL/TrackCandidate.h b/SDL/TrackCandidate.h index 1a9dacc9..205ff7cc 100644 --- a/SDL/TrackCandidate.h +++ b/SDL/TrackCandidate.h @@ -15,11 +15,11 @@ namespace SDL { short* trackCandidateType; // 4-T5 5-pT3 7-pT5 8-pLS unsigned int* directObjectIndices; // Will hold direct indices to each type containers unsigned int* objectIndices; // Will hold tracklet and triplet indices - check the type!! - int* nTrackCandidates; - int* nTrackCandidatespT3; - int* nTrackCandidatespT5; - int* nTrackCandidatespLS; - int* nTrackCandidatesT5; + unsigned int* nTrackCandidates; + unsigned int* nTrackCandidatespT3; + unsigned int* nTrackCandidatespT5; + unsigned int* nTrackCandidatespLS; + unsigned int* nTrackCandidatesT5; uint8_t* logicalLayers; unsigned int* hitIndices; @@ -57,11 +57,11 @@ namespace SDL { Buf trackCandidateType_buf; Buf directObjectIndices_buf; Buf objectIndices_buf; - Buf nTrackCandidates_buf; - Buf nTrackCandidatespT3_buf; - Buf nTrackCandidatespT5_buf; - Buf nTrackCandidatespLS_buf; - Buf nTrackCandidatesT5_buf; + Buf nTrackCandidates_buf; + Buf nTrackCandidatespT3_buf; + Buf nTrackCandidatespT5_buf; + Buf nTrackCandidatespLS_buf; + Buf nTrackCandidatesT5_buf; Buf logicalLayers_buf; Buf hitIndices_buf; @@ -77,11 +77,11 @@ namespace SDL { : trackCandidateType_buf(allocBufWrapper(devAccIn, maxTrackCandidates, queue)), directObjectIndices_buf(allocBufWrapper(devAccIn, maxTrackCandidates, queue)), objectIndices_buf(allocBufWrapper(devAccIn, 2 * maxTrackCandidates, queue)), - nTrackCandidates_buf(allocBufWrapper(devAccIn, 1, queue)), - nTrackCandidatespT3_buf(allocBufWrapper(devAccIn, 1, queue)), - nTrackCandidatespT5_buf(allocBufWrapper(devAccIn, 1, queue)), - nTrackCandidatespLS_buf(allocBufWrapper(devAccIn, 1, queue)), - nTrackCandidatesT5_buf(allocBufWrapper(devAccIn, 1, queue)), + nTrackCandidates_buf(allocBufWrapper(devAccIn, 1, queue)), + nTrackCandidatespT3_buf(allocBufWrapper(devAccIn, 1, queue)), + nTrackCandidatespT5_buf(allocBufWrapper(devAccIn, 1, queue)), + nTrackCandidatespLS_buf(allocBufWrapper(devAccIn, 1, queue)), + nTrackCandidatesT5_buf(allocBufWrapper(devAccIn, 1, queue)), logicalLayers_buf(allocBufWrapper(devAccIn, 7 * maxTrackCandidates, queue)), hitIndices_buf(allocBufWrapper(devAccIn, 14 * maxTrackCandidates, queue)), pixelSeedIndex_buf(allocBufWrapper(devAccIn, maxTrackCandidates, queue)), @@ -89,15 +89,15 @@ namespace SDL { centerX_buf(allocBufWrapper(devAccIn, maxTrackCandidates, queue)), centerY_buf(allocBufWrapper(devAccIn, maxTrackCandidates, queue)), radius_buf(allocBufWrapper(devAccIn, maxTrackCandidates, queue)) { - alpaka::memset(queue, nTrackCandidates_buf, 0, 1); - alpaka::memset(queue, nTrackCandidatesT5_buf, 0, 1); - alpaka::memset(queue, nTrackCandidatespT3_buf, 0, 1); - alpaka::memset(queue, nTrackCandidatespT5_buf, 0, 1); - alpaka::memset(queue, nTrackCandidatespLS_buf, 0, 1); - alpaka::memset(queue, logicalLayers_buf, 0, 7 * maxTrackCandidates); - alpaka::memset(queue, lowerModuleIndices_buf, 0, 7 * maxTrackCandidates); - alpaka::memset(queue, hitIndices_buf, 0, 14 * maxTrackCandidates); - alpaka::memset(queue, pixelSeedIndex_buf, 0, maxTrackCandidates); + alpaka::memset(queue, nTrackCandidates_buf, 0u); + alpaka::memset(queue, nTrackCandidatesT5_buf, 0u); + alpaka::memset(queue, nTrackCandidatespT3_buf, 0u); + alpaka::memset(queue, nTrackCandidatespT5_buf, 0u); + alpaka::memset(queue, nTrackCandidatespLS_buf, 0u); + alpaka::memset(queue, logicalLayers_buf, 0u); + alpaka::memset(queue, lowerModuleIndices_buf, 0u); + alpaka::memset(queue, hitIndices_buf, 0u); + alpaka::memset(queue, pixelSeedIndex_buf, 0); alpaka::wait(queue); } }; @@ -211,7 +211,7 @@ namespace SDL { Vec const gridThreadExtent = alpaka::getWorkDiv(acc); unsigned int nPixelTriplets = *pixelTripletsInGPU.nPixelTriplets; - for (int pixelTripletIndex = globalThreadIdx[2]; pixelTripletIndex < nPixelTriplets; + for (unsigned int pixelTripletIndex = globalThreadIdx[2]; pixelTripletIndex < nPixelTriplets; pixelTripletIndex += gridThreadExtent[2]) { if (pixelTripletsInGPU.isDup[pixelTripletIndex]) continue; @@ -224,7 +224,7 @@ namespace SDL { unsigned int prefix = rangesInGPU.segmentModuleIndices[pixelModuleIndex]; unsigned int nPixelQuintuplets = *pixelQuintupletsInGPU.nPixelQuintuplets; - for (int pixelQuintupletIndex = globalThreadIdx[1]; pixelQuintupletIndex < nPixelQuintuplets; + for (unsigned int pixelQuintupletIndex = globalThreadIdx[1]; pixelQuintupletIndex < nPixelQuintuplets; pixelQuintupletIndex += gridThreadExtent[1]) { unsigned int pLS_jx = pixelQuintupletsInGPU.pixelIndices[pixelQuintupletIndex]; float eta2 = segmentsInGPU.eta[pLS_jx - prefix]; @@ -262,16 +262,16 @@ namespace SDL { continue; unsigned int nQuints = quintupletsInGPU.nQuintuplets[innerInnerInnerLowerModuleArrayIndex]; - for (int innerObjectArrayIndex = globalThreadIdx[1]; innerObjectArrayIndex < nQuints; + for (unsigned int innerObjectArrayIndex = globalThreadIdx[1]; innerObjectArrayIndex < nQuints; innerObjectArrayIndex += gridThreadExtent[1]) { - int quintupletIndex = + unsigned int quintupletIndex = rangesInGPU.quintupletModuleIndices[innerInnerInnerLowerModuleArrayIndex] + innerObjectArrayIndex; // Don't add duplicate T5s or T5s that are accounted in pT5s if (quintupletsInGPU.isDup[quintupletIndex] or quintupletsInGPU.partOfPT5[quintupletIndex]) continue; #ifdef Crossclean_T5 - int loop_bound = *pixelQuintupletsInGPU.nPixelQuintuplets + *pixelTripletsInGPU.nPixelTriplets; + unsigned int loop_bound = *pixelQuintupletsInGPU.nPixelQuintuplets + *pixelTripletsInGPU.nPixelTriplets; // Cross cleaning step float eta1 = __H2F(quintupletsInGPU.eta[quintupletIndex]); float phi1 = __H2F(quintupletsInGPU.phi[quintupletIndex]); @@ -321,7 +321,7 @@ namespace SDL { int pixelModuleIndex = *modulesInGPU.nLowerModules; unsigned int nPixels = segmentsInGPU.nSegments[pixelModuleIndex]; - for (int pixelArrayIndex = globalThreadIdx[2]; pixelArrayIndex < nPixels; + for (unsigned int pixelArrayIndex = globalThreadIdx[2]; pixelArrayIndex < nPixels; pixelArrayIndex += gridThreadExtent[2]) { if (!segmentsInGPU.isQuad[pixelArrayIndex] || segmentsInGPU.isDup[pixelArrayIndex]) continue; @@ -330,8 +330,8 @@ namespace SDL { float phi1 = segmentsInGPU.phi[pixelArrayIndex]; unsigned int prefix = rangesInGPU.segmentModuleIndices[pixelModuleIndex]; - int nTrackCandidates = *(trackCandidatesInGPU.nTrackCandidates); - for (int trackCandidateIndex = globalThreadIdx[1]; trackCandidateIndex < nTrackCandidates; + unsigned int nTrackCandidates = *(trackCandidatesInGPU.nTrackCandidates); + for (unsigned int trackCandidateIndex = globalThreadIdx[1]; trackCandidateIndex < nTrackCandidates; trackCandidateIndex += gridThreadExtent[1]) { short type = trackCandidatesInGPU.trackCandidateType[trackCandidateIndex]; unsigned int innerTrackletIdx = trackCandidatesInGPU.objectIndices[2 * trackCandidateIndex]; @@ -403,23 +403,23 @@ namespace SDL { unsigned int nPixelTriplets = *pixelTripletsInGPU.nPixelTriplets; unsigned int pLS_offset = rangesInGPU.segmentModuleIndices[nLowerModules]; - for (int pixelTripletIndex = globalThreadIdx[2]; pixelTripletIndex < nPixelTriplets; + for (unsigned int pixelTripletIndex = globalThreadIdx[2]; pixelTripletIndex < nPixelTriplets; pixelTripletIndex += gridThreadExtent[2]) { if ((pixelTripletsInGPU.isDup[pixelTripletIndex])) continue; unsigned int trackCandidateIdx = - alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidates, 1); + alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidates, 1u); if (trackCandidateIdx >= N_MAX_PIXEL_TRACK_CANDIDATES) // This is done before any non-pixel TCs are added { #ifdef Warnings printf("Track Candidate excess alert! Type = pT3"); #endif - alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidates, 1); + alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidates, 1u); break; } else { - alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidatespT3, 1); + alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidatespT3, 1u); float radius = 0.5f * (__H2F(pixelTripletsInGPU.pixelRadius[pixelTripletIndex]) + __H2F(pixelTripletsInGPU.tripletRadius[pixelTripletIndex])); @@ -461,15 +461,15 @@ namespace SDL { continue; unsigned int nQuints = quintupletsInGPU.nQuintuplets[idx]; - for (int jdx = globalThreadIdx[2]; jdx < nQuints; jdx += gridThreadExtent[2]) { - int quintupletIndex = rangesInGPU.quintupletModuleIndices[idx] + jdx; + for (unsigned int jdx = globalThreadIdx[2]; jdx < nQuints; jdx += gridThreadExtent[2]) { + unsigned int quintupletIndex = rangesInGPU.quintupletModuleIndices[idx] + jdx; if (quintupletsInGPU.isDup[quintupletIndex] or quintupletsInGPU.partOfPT5[quintupletIndex]) continue; if (!(quintupletsInGPU.TightCutFlag[quintupletIndex])) continue; unsigned int trackCandidateIdx = - alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidates, 1); + alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidates, 1u); if (trackCandidateIdx - *trackCandidatesInGPU.nTrackCandidatespT5 - *trackCandidatesInGPU.nTrackCandidatespT3 >= N_MAX_NONPIXEL_TRACK_CANDIDATES) // pT5 and pT3 TCs have been added, but not pLS TCs @@ -477,10 +477,10 @@ namespace SDL { #ifdef Warnings printf("Track Candidate excess alert! Type = T5"); #endif - alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidates, 1); + alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidates, 1u); break; } else { - alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidatesT5, 1); + alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidatesT5, 1u); addTrackCandidateToMemory(trackCandidatesInGPU, 4 /*track candidate type T5=4*/, quintupletIndex, @@ -514,7 +514,7 @@ namespace SDL { Vec const gridThreadExtent = alpaka::getWorkDiv(acc); unsigned int nPixels = segmentsInGPU.nSegments[nLowerModules]; - for (int pixelArrayIndex = globalThreadIdx[2]; pixelArrayIndex < nPixels; + for (unsigned int pixelArrayIndex = globalThreadIdx[2]; pixelArrayIndex < nPixels; pixelArrayIndex += gridThreadExtent[2]) { #ifdef TC_PLS_TRIPLETS if (segmentsInGPU.isDup[pixelArrayIndex]) @@ -524,18 +524,18 @@ namespace SDL { continue; unsigned int trackCandidateIdx = - alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidates, 1); + alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidates, 1u); if (trackCandidateIdx - *trackCandidatesInGPU.nTrackCandidatesT5 >= N_MAX_PIXEL_TRACK_CANDIDATES) // T5 TCs have already been added { #ifdef Warnings printf("Track Candidate excess alert! Type = pLS"); #endif - alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidates, 1); + alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidates, 1u); break; } else { - alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidatespLS, 1); + alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidatespLS, 1u); addpLSTrackCandidateToMemory(trackCandidatesInGPU, pixelArrayIndex, trackCandidateIdx, @@ -568,17 +568,17 @@ namespace SDL { if (pixelQuintupletsInGPU.isDup[pixelQuintupletIndex]) continue; - int trackCandidateIdx = alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidates, 1); + unsigned int trackCandidateIdx = alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidates, 1u); if (trackCandidateIdx >= N_MAX_PIXEL_TRACK_CANDIDATES) // No other TCs have been added yet { #ifdef Warnings printf("Track Candidate excess alert! Type = pT5"); #endif - alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidates, 1); + alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidates, 1u); break; } else { - alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidatespT5, 1); + alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidatespT5, 1u); float radius = 0.5f * (__H2F(pixelQuintupletsInGPU.pixelRadius[pixelQuintupletIndex]) + __H2F(pixelQuintupletsInGPU.quintupletRadius[pixelQuintupletIndex])); diff --git a/SDL/Triplet.h b/SDL/Triplet.h index 847f2d82..8df4fb1d 100644 --- a/SDL/Triplet.h +++ b/SDL/Triplet.h @@ -11,8 +11,8 @@ namespace SDL { struct triplets { unsigned int* segmentIndices; uint16_t* lowerModuleIndices; //3 of them now - int* nTriplets; - int* totOccupancyTriplets; + unsigned int* nTriplets; + unsigned int* totOccupancyTriplets; unsigned int* nMemoryLocations; uint8_t* logicalLayers; unsigned int* hitIndices; @@ -81,8 +81,8 @@ namespace SDL { struct tripletsBuffer : triplets { Buf segmentIndices_buf; Buf lowerModuleIndices_buf; - Buf nTriplets_buf; - Buf totOccupancyTriplets_buf; + Buf nTriplets_buf; + Buf totOccupancyTriplets_buf; Buf nMemoryLocations_buf; Buf logicalLayers_buf; Buf hitIndices_buf; @@ -115,8 +115,8 @@ namespace SDL { tripletsBuffer(unsigned int maxTriplets, unsigned int nLowerModules, TDevAcc const& devAccIn, TQueue& queue) : segmentIndices_buf(allocBufWrapper(devAccIn, 2 * maxTriplets, queue)), lowerModuleIndices_buf(allocBufWrapper(devAccIn, 3 * maxTriplets, queue)), - nTriplets_buf(allocBufWrapper(devAccIn, nLowerModules, queue)), - totOccupancyTriplets_buf(allocBufWrapper(devAccIn, nLowerModules, queue)), + nTriplets_buf(allocBufWrapper(devAccIn, nLowerModules, queue)), + totOccupancyTriplets_buf(allocBufWrapper(devAccIn, nLowerModules, queue)), nMemoryLocations_buf(allocBufWrapper(devAccIn, 1, queue)), logicalLayers_buf(allocBufWrapper(devAccIn, maxTriplets * 3, queue)), hitIndices_buf(allocBufWrapper(devAccIn, maxTriplets * 6, queue)), @@ -145,11 +145,11 @@ namespace SDL { kZ_buf(allocBufWrapper(devAccIn, maxTriplets, queue)) #endif { - alpaka::memset(queue, nTriplets_buf, 0, nLowerModules); - alpaka::memset(queue, totOccupancyTriplets_buf, 0, nLowerModules); - alpaka::memset(queue, partOfPT5_buf, 0, maxTriplets); - alpaka::memset(queue, partOfT5_buf, 0, maxTriplets); - alpaka::memset(queue, partOfPT3_buf, 0, maxTriplets); + alpaka::memset(queue, nTriplets_buf, 0u); + alpaka::memset(queue, totOccupancyTriplets_buf, 0u); + alpaka::memset(queue, partOfPT5_buf, false); + alpaka::memset(queue, partOfT5_buf, false); + alpaka::memset(queue, partOfPT3_buf, false); } }; @@ -1970,7 +1970,7 @@ namespace SDL { continue; unsigned int nInnerSegments = segmentsInGPU.nSegments[innerInnerLowerModuleIndex]; - for (int innerSegmentArrayIndex = globalThreadIdx[1]; innerSegmentArrayIndex < nInnerSegments; + for (unsigned int innerSegmentArrayIndex = globalThreadIdx[1]; innerSegmentArrayIndex < nInnerSegments; innerSegmentArrayIndex += gridThreadExtent[1]) { unsigned int innerSegmentIndex = rangesInGPU.segmentRanges[innerInnerLowerModuleIndex * 2] + innerSegmentArrayIndex; @@ -1979,7 +1979,7 @@ namespace SDL { uint16_t middleLowerModuleIndex = segmentsInGPU.outerLowerModuleIndices[innerSegmentIndex]; unsigned int nOuterSegments = segmentsInGPU.nSegments[middleLowerModuleIndex]; - for (int outerSegmentArrayIndex = globalThreadIdx[2]; outerSegmentArrayIndex < nOuterSegments; + for (unsigned int outerSegmentArrayIndex = globalThreadIdx[2]; outerSegmentArrayIndex < nOuterSegments; outerSegmentArrayIndex += gridThreadExtent[2]) { unsigned int outerSegmentIndex = rangesInGPU.segmentRanges[2 * middleLowerModuleIndex] + outerSegmentArrayIndex; @@ -2019,14 +2019,14 @@ namespace SDL { if (success) { unsigned int totOccupancyTriplets = alpaka::atomicOp( - acc, &tripletsInGPU.totOccupancyTriplets[innerInnerLowerModuleIndex], 1); - if (totOccupancyTriplets >= (rangesInGPU.tripletModuleOccupancy[innerInnerLowerModuleIndex])) { + acc, &tripletsInGPU.totOccupancyTriplets[innerInnerLowerModuleIndex], 1u); + if (totOccupancyTriplets >= (unsigned int) (rangesInGPU.tripletModuleOccupancy[innerInnerLowerModuleIndex])) { #ifdef Warnings printf("Triplet excess alert! Module index = %d\n", innerInnerLowerModuleIndex); #endif } else { unsigned int tripletModuleIndex = - alpaka::atomicOp(acc, &tripletsInGPU.nTriplets[innerInnerLowerModuleIndex], 1); + alpaka::atomicOp(acc, &tripletsInGPU.nTriplets[innerInnerLowerModuleIndex], 1u); unsigned int tripletIndex = rangesInGPU.tripletModuleIndices[innerInnerLowerModuleIndex] + tripletModuleIndex; #ifdef CUT_VALUE_DEBUG From 9fa195e5fb2a81c5b2aa57700af8ab3a36227703 Mon Sep 17 00:00:00 2001 From: Andres Rios-Tascon Date: Mon, 29 Jan 2024 16:51:25 -0500 Subject: [PATCH 3/7] Removed unused variables --- SDL/MiniDoublet.h | 1 - SDL/PixelTriplet.h | 16 --------------- SDL/Quintuplet.h | 34 +------------------------------- SDL/Segment.h | 1 - SDL/Triplet.h | 49 ---------------------------------------------- 5 files changed, 1 insertion(+), 100 deletions(-) diff --git a/SDL/MiniDoublet.h b/SDL/MiniDoublet.h index 7cdbbfa8..c90e7c70 100644 --- a/SDL/MiniDoublet.h +++ b/SDL/MiniDoublet.h @@ -905,7 +905,6 @@ namespace SDL { int nUpperHits = hitsInGPU.hitRangesnUpper[lowerModuleIndex]; if (hitsInGPU.hitRangesLower[lowerModuleIndex] == -1) continue; - const int maxHits = alpaka::math::max(acc, nUpperHits, nLowerHits); unsigned int upHitArrayIndex = hitsInGPU.hitRangesUpper[lowerModuleIndex]; unsigned int loHitArrayIndex = hitsInGPU.hitRangesLower[lowerModuleIndex]; int limit = nUpperHits * nLowerHits; diff --git a/SDL/PixelTriplet.h b/SDL/PixelTriplet.h index 31260168..bb7df3e3 100644 --- a/SDL/PixelTriplet.h +++ b/SDL/PixelTriplet.h @@ -790,8 +790,6 @@ namespace SDL { float a = -0.299792 * B * charge; for (size_t i = 0; i < 3; i++) { - float xsi = xs[i] / 100; - float ysi = ys[i] / 100; float zsi = zs[i] / 100; float rtsi = rts[i] / 100; uint16_t lowerModuleIndex = lowerModuleIndices[i]; @@ -1065,10 +1063,8 @@ namespace SDL { Vec const globalBlockIdx = alpaka::getIdx(acc); Vec const globalThreadIdx = alpaka::getIdx(acc); - Vec const blockThreadIdx = alpaka::getIdx(acc); Vec const gridBlockExtent = alpaka::getWorkDiv(acc); Vec const gridThreadExtent = alpaka::getWorkDiv(acc); - Vec const blockThreadExtent = alpaka::getWorkDiv(acc); for (unsigned int i_pLS = globalThreadIdx[1]; i_pLS < nPixelSegments; i_pLS += gridThreadExtent[1]) { auto iLSModule_max = connectedPixelIndex[i_pLS] + connectedPixelSize[i_pLS]; @@ -1328,10 +1324,8 @@ namespace SDL { float rt_OutLo = mdsInGPU.anchorRt[thirdMDIndex]; float rt_OutUp = mdsInGPU.anchorRt[fourthMDIndex]; - float z_InLo = mdsInGPU.anchorZ[firstMDIndex]; float z_InUp = mdsInGPU.anchorZ[secondMDIndex]; float z_OutLo = mdsInGPU.anchorZ[thirdMDIndex]; - float z_OutUp = mdsInGPU.anchorZ[fourthMDIndex]; float x_InLo = mdsInGPU.anchorX[firstMDIndex]; float x_InUp = mdsInGPU.anchorX[secondMDIndex]; @@ -1424,11 +1418,9 @@ namespace SDL { //no dphipos cut float midPointX = 0.5f * (x_InLo + x_OutLo); float midPointY = 0.5f * (y_InLo + y_OutLo); - float midPointZ = 0.5f * (z_InLo + z_OutLo); float diffX = x_OutLo - x_InLo; float diffY = y_OutLo - y_InLo; - float diffZ = z_OutLo - z_InLo; dPhi = SDL::deltaPhi(acc, midPointX, midPointY, diffX, diffY); @@ -1452,7 +1444,6 @@ namespace SDL { float tl_axis_x = x_OutUp - x_InUp; float tl_axis_y = y_OutUp - y_InUp; - float tl_axis_z = z_OutUp - z_InUp; float tl_axis_highEdge_x = tl_axis_x; float tl_axis_highEdge_y = tl_axis_y; @@ -1619,10 +1610,8 @@ namespace SDL { bool pass = true; bool isPS_OutLo = (modulesInGPU.moduleType[outerInnerLowerModuleIndex] == SDL::PS); - float z_InLo = mdsInGPU.anchorZ[firstMDIndex]; float z_InUp = mdsInGPU.anchorZ[secondMDIndex]; float z_OutLo = mdsInGPU.anchorZ[thirdMDIndex]; - float z_OutUp = mdsInGPU.anchorZ[fourthMDIndex]; pass = pass and (z_InUp * z_OutLo > 0); if (not pass) @@ -1726,11 +1715,9 @@ namespace SDL { float midPointX = 0.5f * (x_InLo + x_OutLo); float midPointY = 0.5f * (y_InLo + y_OutLo); - float midPointZ = 0.5f * (z_InLo + z_OutLo); float diffX = x_OutLo - x_InLo; float diffY = y_OutLo - y_InLo; - float diffZ = z_OutLo - z_InLo; dPhi = SDL::deltaPhi(acc, midPointX, midPointY, diffX, diffY); @@ -1753,7 +1740,6 @@ namespace SDL { float tl_axis_x = x_OutUp - x_InUp; float tl_axis_y = y_OutUp - y_InUp; - float tl_axis_z = z_OutUp - z_InUp; float tl_axis_highEdge_x = tl_axis_x; float tl_axis_highEdge_y = tl_axis_y; @@ -2726,10 +2712,8 @@ namespace SDL { Vec const globalBlockIdx = alpaka::getIdx(acc); Vec const globalThreadIdx = alpaka::getIdx(acc); - Vec const blockThreadIdx = alpaka::getIdx(acc); Vec const gridBlockExtent = alpaka::getWorkDiv(acc); Vec const gridThreadExtent = alpaka::getWorkDiv(acc); - Vec const blockThreadExtent = alpaka::getWorkDiv(acc); for (unsigned int i_pLS = globalThreadIdx[1]; i_pLS < nPixelSegments; i_pLS += gridThreadExtent[1]) { auto iLSModule_max = connectedPixelIndex[i_pLS] + connectedPixelSize[i_pLS]; diff --git a/SDL/Quintuplet.h b/SDL/Quintuplet.h index 223747f2..dffe08cb 100644 --- a/SDL/Quintuplet.h +++ b/SDL/Quintuplet.h @@ -343,12 +343,10 @@ namespace SDL { const float& x2 = mdsInGPU.anchorX[secondMDIndex] / 100; const float& x3 = mdsInGPU.anchorX[thirdMDIndex] / 100; const float& x4 = mdsInGPU.anchorX[fourthMDIndex] / 100; - const float& x5 = mdsInGPU.anchorX[fifthMDIndex] / 100; const float& y1 = mdsInGPU.anchorY[firstMDIndex] / 100; const float& y2 = mdsInGPU.anchorY[secondMDIndex] / 100; const float& y3 = mdsInGPU.anchorY[thirdMDIndex] / 100; const float& y4 = mdsInGPU.anchorY[fourthMDIndex] / 100; - const float& y5 = mdsInGPU.anchorY[fifthMDIndex] / 100; float residual = 0; float error = 0; @@ -1593,10 +1591,8 @@ namespace SDL { float midPointX = 0.5f * (mdsInGPU.anchorX[firstMDIndex] + mdsInGPU.anchorX[thirdMDIndex]); float midPointY = 0.5f * (mdsInGPU.anchorY[firstMDIndex] + mdsInGPU.anchorY[thirdMDIndex]); - float midPointZ = 0.5f * (mdsInGPU.anchorZ[firstMDIndex] + mdsInGPU.anchorZ[thirdMDIndex]); float diffX = mdsInGPU.anchorX[thirdMDIndex] - mdsInGPU.anchorX[firstMDIndex]; float diffY = mdsInGPU.anchorY[thirdMDIndex] - mdsInGPU.anchorY[firstMDIndex]; - float diffZ = mdsInGPU.anchorZ[thirdMDIndex] - mdsInGPU.anchorZ[firstMDIndex]; dPhi = SDL::deltaPhi(acc, midPointX, midPointY, diffX, diffY); @@ -1627,7 +1623,6 @@ namespace SDL { float tl_axis_x = mdsInGPU.anchorX[fourthMDIndex] - mdsInGPU.anchorX[firstMDIndex]; float tl_axis_y = mdsInGPU.anchorY[fourthMDIndex] - mdsInGPU.anchorY[firstMDIndex]; - float tl_axis_z = mdsInGPU.anchorZ[fourthMDIndex] - mdsInGPU.anchorZ[firstMDIndex]; float tl_axis_highEdge_x = tl_axis_x; float tl_axis_highEdge_y = tl_axis_y; float tl_axis_lowEdge_x = tl_axis_x; @@ -1672,10 +1667,6 @@ namespace SDL { //beta computation float drt_tl_axis = alpaka::math::sqrt(acc, tl_axis_x * tl_axis_x + tl_axis_y * tl_axis_y); - float drt_tl_lowEdge = - alpaka::math::sqrt(acc, tl_axis_lowEdge_x * tl_axis_lowEdge_x + tl_axis_lowEdge_y * tl_axis_lowEdge_y); - float drt_tl_highEdge = - alpaka::math::sqrt(acc, tl_axis_highEdge_x * tl_axis_highEdge_x + tl_axis_highEdge_y * tl_axis_highEdge_y); float corrF = 1.f; //innerOuterAnchor - innerInnerAnchor @@ -1707,8 +1698,6 @@ namespace SDL { (mdsInGPU.anchorY[fourthMDIndex] - mdsInGPU.anchorY[thirdMDIndex])); float sdOut_d = mdsInGPU.anchorRt[fourthMDIndex] - mdsInGPU.anchorRt[thirdMDIndex]; - const float diffDr = alpaka::math::abs(acc, rt_InSeg - sdOut_dr) / alpaka::math::abs(acc, rt_InSeg + sdOut_dr); - SDL::runDeltaBetaIterationsT5(acc, betaIn, betaOut, betaAv, pt_beta, rt_InSeg, sdOut_dr, drt_tl_axis, lIn); const float betaInMMSF = (alpaka::math::abs(acc, betaInRHmin + betaInRHmax) > 0) @@ -1765,8 +1754,6 @@ namespace SDL { if (not pass) return pass; - float pt_betaIn = drt_tl_axis * SDL::k2Rinv1GeVf / alpaka::math::sin(acc, betaIn); - float pt_betaOut = drt_tl_axis * SDL::k2Rinv1GeVf / alpaka::math::sin(acc, betaOut); float dBetaRes = 0.02f / alpaka::math::min(acc, sdOut_d, drt_InSeg); float dBetaCut2 = (dBetaRes * dBetaRes * 2.0f + dBetaMuls * dBetaMuls + dBetaLum2 + dBetaRIn2 + dBetaROut2 + @@ -1884,10 +1871,6 @@ namespace SDL { drtErr += sdlMuls * sdlMuls * multDzDr * multDzDr / 3.f * coshEta * coshEta; //sloppy: relative muls is 1/3 of total muls drtErr = alpaka::math::sqrt(acc, drtErr); - const float drtMean = drtSDIn * dzOutInAbs / alpaka::math::abs(acc, dzSDIn); // - const float rtWindow = drtErr + rtGeom1; - const float rtLo_another = rt_InLo + drtMean / dzDrtScale - rtWindow; - const float rtHi_another = rt_InLo + drtMean + rtWindow; //Cut #3: rt-z pointed pass = pass and ((kZ >= 0) && (rtOut >= rtLo) && (rtOut <= rtHi)); @@ -1906,10 +1889,8 @@ namespace SDL { float midPointX = 0.5f * (mdsInGPU.anchorX[firstMDIndex] + mdsInGPU.anchorX[thirdMDIndex]); float midPointY = 0.5f * (mdsInGPU.anchorY[firstMDIndex] + mdsInGPU.anchorY[thirdMDIndex]); - float midPointZ = 0.5f * (mdsInGPU.anchorZ[firstMDIndex] + mdsInGPU.anchorZ[thirdMDIndex]); float diffX = mdsInGPU.anchorX[thirdMDIndex] - mdsInGPU.anchorX[firstMDIndex]; float diffY = mdsInGPU.anchorY[thirdMDIndex] - mdsInGPU.anchorY[firstMDIndex]; - float diffZ = mdsInGPU.anchorZ[thirdMDIndex] - mdsInGPU.anchorZ[firstMDIndex]; dPhi = SDL::deltaPhi(acc, midPointX, midPointY, diffX, diffY); // Cut #5: deltaPhiChange @@ -1935,7 +1916,6 @@ namespace SDL { float tl_axis_x = mdsInGPU.anchorX[fourthMDIndex] - mdsInGPU.anchorX[firstMDIndex]; float tl_axis_y = mdsInGPU.anchorY[fourthMDIndex] - mdsInGPU.anchorY[firstMDIndex]; - float tl_axis_z = mdsInGPU.anchorZ[fourthMDIndex] - mdsInGPU.anchorZ[firstMDIndex]; betaIn = sdIn_alpha - SDL::phi_mpi_pi(acc, SDL::phi(acc, tl_axis_x, tl_axis_y) - mdsInGPU.anchorPhi[firstMDIndex]); @@ -2057,8 +2037,6 @@ namespace SDL { if (not pass) return pass; - float pt_betaIn = dr * SDL::k2Rinv1GeVf / alpaka::math::sin(acc, betaIn); - float pt_betaOut = dr * SDL::k2Rinv1GeVf / alpaka::math::sin(acc, betaOut); float dBetaRes = 0.02f / alpaka::math::min(acc, sdOut_d, sdIn_d); float dBetaCut2 = (dBetaRes * dBetaRes * 2.0f + dBetaMuls * dBetaMuls + dBetaLum2 + dBetaRIn2 + dBetaROut2 + @@ -2142,7 +2120,6 @@ namespace SDL { : (isInSgInnerMDPS or isOutSgInnerMDPS) ? SDL::pixelPSZpitch + SDL::strip2SZpitch : 2.f * SDL::strip2SZpitch; - float zGeom1 = SDL::copysignf(zGeom, z_InLo); float dz = z_OutLo - z_InLo; rtLo = rt_InLo * (1.f + dz / (z_InLo + dLum) / dzDrtScale) - rtGeom; //slope correction only on the lower end @@ -2159,7 +2136,6 @@ namespace SDL { bool isInSgOuterMDPS = modulesInGPU.moduleType[innerOuterLowerModuleIndex] == SDL::PS; - float drOutIn = rtOut - rt_InLo; const float drtSDIn = rt_InOut - rt_InLo; const float dzSDIn = z_InOut - z_InLo; const float dr3SDIn = alpaka::math::sqrt(acc, rt_InOut * rt_InOut + z_InOut * z_InOut) - @@ -2204,10 +2180,8 @@ namespace SDL { float midPointX = 0.5f * (mdsInGPU.anchorX[firstMDIndex] + mdsInGPU.anchorX[thirdMDIndex]); float midPointY = 0.5f * (mdsInGPU.anchorY[firstMDIndex] + mdsInGPU.anchorY[thirdMDIndex]); - float midPointZ = 0.5f * (mdsInGPU.anchorZ[firstMDIndex] + mdsInGPU.anchorZ[thirdMDIndex]); float diffX = mdsInGPU.anchorX[thirdMDIndex] - mdsInGPU.anchorX[firstMDIndex]; float diffY = mdsInGPU.anchorY[thirdMDIndex] - mdsInGPU.anchorY[firstMDIndex]; - float diffZ = mdsInGPU.anchorZ[thirdMDIndex] - mdsInGPU.anchorZ[firstMDIndex]; dPhi = SDL::deltaPhi(acc, midPointX, midPointY, diffX, diffY); @@ -2230,7 +2204,6 @@ namespace SDL { float tl_axis_x = mdsInGPU.anchorX[fourthMDIndex] - mdsInGPU.anchorX[firstMDIndex]; float tl_axis_y = mdsInGPU.anchorY[fourthMDIndex] - mdsInGPU.anchorY[firstMDIndex]; - float tl_axis_z = mdsInGPU.anchorZ[fourthMDIndex] - mdsInGPU.anchorZ[firstMDIndex]; betaIn = sdIn_alpha - SDL::phi_mpi_pi(acc, SDL::phi(acc, tl_axis_x, tl_axis_y) - mdsInGPU.anchorPhi[firstMDIndex]); @@ -2289,8 +2262,6 @@ namespace SDL { (mdsInGPU.anchorY[fourthMDIndex] - mdsInGPU.anchorY[thirdMDIndex])); float sdOut_d = mdsInGPU.anchorRt[fourthMDIndex] - mdsInGPU.anchorRt[thirdMDIndex]; - float diffDr = alpaka::math::abs(acc, sdIn_dr - sdOut_dr) / alpaka::math::abs(acc, sdIn_dr + sdOut_dr); - SDL::runDeltaBetaIterationsT5(acc, betaIn, betaOut, betaAv, pt_beta, sdIn_dr, sdOut_dr, dr, lIn); const float betaInMMSF = (alpaka::math::abs(acc, betaInRHmin + betaInRHmax) > 0) @@ -2320,7 +2291,6 @@ namespace SDL { const float dBetaInLum = lIn < 11 ? 0.0f : alpaka::math::abs(acc, alphaInAbsReg * SDL::deltaZLum / z_InLo); const float dBetaOutLum = lOut < 11 ? 0.0f : alpaka::math::abs(acc, alphaOutAbsReg * SDL::deltaZLum / z_OutLo); const float dBetaLum2 = (dBetaInLum + dBetaOutLum) * (dBetaInLum + dBetaOutLum); - const float sinDPhi = alpaka::math::sin(acc, dPhi); const float dBetaRIn2 = 0; // TODO-RH @@ -2334,8 +2304,6 @@ namespace SDL { if (not pass) return pass; - float pt_betaIn = dr * SDL::k2Rinv1GeVf / alpaka::math::sin(acc, betaIn); - float pt_betaOut = dr * SDL::k2Rinv1GeVf / alpaka::math::sin(acc, betaOut); float dBetaRes = 0.02f / alpaka::math::min(acc, sdOut_d, sdIn_d); float dBetaCut2 = (dBetaRes * dBetaRes * 2.0f + dBetaMuls * dBetaMuls + dBetaLum2 + dBetaRIn2 + dBetaROut2 + @@ -2763,6 +2731,7 @@ namespace SDL { bridgeRadius = computeRadiusFromThreeAnchorHits(acc, x2, y2, x3, y3, x4, y4, g, f); innerRadius = computeRadiusFromThreeAnchorHits(acc, x1, y1, x2, y2, x3, y3, g, f); +#ifdef USE_RZCHI2 float inner_pt = 2 * k2Rinv1GeVf * innerRadius; bool passRZChi2 = passT5RZConstraint(acc, @@ -2784,7 +2753,6 @@ namespace SDL { g, f, TightCutFlag); -#ifdef USE_RZCHI2 pass = pass and passRZChi2; if (not pass) return pass; diff --git a/SDL/Segment.h b/SDL/Segment.h index be7bd3fa..dff976ff 100644 --- a/SDL/Segment.h +++ b/SDL/Segment.h @@ -603,7 +603,6 @@ namespace SDL { (modulesInGPU.moduleType[outerLowerModuleIndex] == SDL::TwoS); float sdSlope = alpaka::math::asin(acc, alpaka::math::min(acc, rtOut * k2Rinv1GeVf / ptCut, sinAlphaMax)); - float sdPVoff = 0.1 / rtOut; float disks2SMinRadius = 60.f; float rtGeom = ((rtIn < disks2SMinRadius && rtOut < disks2SMinRadius) diff --git a/SDL/Triplet.h b/SDL/Triplet.h index 8df4fb1d..240d8495 100644 --- a/SDL/Triplet.h +++ b/SDL/Triplet.h @@ -348,7 +348,6 @@ namespace SDL { return pass; float drt_OutIn = (rtOut - rtIn); - float invRtIn = 1. / rtIn; float r3In = alpaka::math::sqrt(acc, zIn * zIn + rtIn * rtIn); float drt_InSeg = rtMid - rtIn; @@ -411,15 +410,12 @@ namespace SDL { float alpha1GeV_OutLo = alpaka::math::asin(acc, alpaka::math::min(acc, rtOut * SDL::k2Rinv1GeVf / SDL::ptCut, SDL::sinAlphaMax)); - float rtRatio_OutIn = rtOut / rtIn; // Outer segment beginning rt divided by inner segment beginning rt; float dzDrtScale = alpaka::math::tan(acc, alpha1GeV_OutLo) / alpha1GeV_OutLo; // The track can bend in r-z plane slightly float zpitchIn = (isPSIn ? SDL::pixelPSZpitch : SDL::strip2SZpitch); float zpitchOut = (isPSOut ? SDL::pixelPSZpitch : SDL::strip2SZpitch); float zGeom = zpitchIn + zpitchOut; - float zLo = zIn + (zIn - SDL::deltaZLum) * (rtRatio_OutIn - 1.f) * (zIn > 0.f ? 1.f : dzDrtScale) - zGeom; - // Cut #0: Preliminary (Only here in endcap case) pass = pass and (zIn * zOut > 0); if (not pass) @@ -466,10 +462,6 @@ namespace SDL { drtErr += sdlMuls * sdlMuls * multDzDr * multDzDr / 3.f * coshEta * coshEta; //sloppy: relative muls is 1/3 of total muls drtErr = alpaka::math::sqrt(acc, drtErr); - const float drtMean = drtSDIn * dzOutInAbs / alpaka::math::abs(acc, dzSDIn); - const float rtWindow = drtErr + rtGeom1; - const float rtLo_another = rtIn + drtMean / dzDrtScale - rtWindow; - const float rtHi_another = rtIn + drtMean + rtWindow; //Cut #3: rt-z pointed @@ -491,8 +483,6 @@ namespace SDL { float& zOut, float& rtOut) { bool pass = true; - bool isPSIn = (modulesInGPU.moduleType[innerInnerLowerModuleIndex] == SDL::PS); - bool isPSOut = (modulesInGPU.moduleType[outerOuterLowerModuleIndex] == SDL::PS); float rtIn = mdsInGPU.anchorRt[firstMDIndex]; float rtMid = mdsInGPU.anchorRt[secondMDIndex]; @@ -505,15 +495,8 @@ namespace SDL { float alpha1GeV_Out = alpaka::math::asin(acc, alpaka::math::min(acc, rtOut * SDL::k2Rinv1GeVf / SDL::ptCut, SDL::sinAlphaMax)); - float rtRatio_OutIn = rtOut / rtIn; // Outer segment beginning rt divided by inner segment beginning rt; float dzDrtScale = alpaka::math::tan(acc, alpha1GeV_Out) / alpha1GeV_Out; // The track can bend in r-z plane slightly - float zpitchIn = (isPSIn ? SDL::pixelPSZpitch : SDL::strip2SZpitch); - float zpitchOut = (isPSOut ? SDL::pixelPSZpitch : SDL::strip2SZpitch); - float zGeom = zpitchIn + zpitchOut; - - const float zLo = zIn + (zIn - SDL::deltaZLum) * (rtRatio_OutIn - 1.f) * (zIn > 0.f ? 1.f : dzDrtScale) - - zGeom; //slope-correction only on outer end // Cut #0: Preliminary (Only here in endcap case) pass = pass and (zIn * zOut > 0); @@ -528,7 +511,6 @@ namespace SDL { : (isInSgInnerMDPS or isOutSgOuterMDPS) ? SDL::pixelPSZpitch + SDL::strip2SZpitch : 2.f * SDL::strip2SZpitch; - float zGeom1 = SDL::copysignf(zGeom, zIn); float dz = zOut - zIn; const float rtLo = rtIn * (1.f + dz / (zIn + dLum) / dzDrtScale) - rtGeom; //slope correction only on the lower end const float rtHi = rtIn * (1.f + dz / (zIn - dLum)) + rtGeom; @@ -540,7 +522,6 @@ namespace SDL { bool isInSgOuterMDPS = modulesInGPU.moduleType[outerOuterLowerModuleIndex] == SDL::PS; - float drOutIn = rtOut - rtIn; float drtSDIn = rtMid - rtIn; float dzSDIn = zMid - zIn; float dr3SDIn = @@ -858,10 +839,8 @@ namespace SDL { float midPointX = 0.5f * (mdsInGPU.anchorX[firstMDIndex] + mdsInGPU.anchorX[thirdMDIndex]); float midPointY = 0.5f * (mdsInGPU.anchorY[firstMDIndex] + mdsInGPU.anchorY[thirdMDIndex]); - float midPointZ = 0.5f * (mdsInGPU.anchorZ[firstMDIndex] + mdsInGPU.anchorZ[thirdMDIndex]); float diffX = mdsInGPU.anchorX[thirdMDIndex] - mdsInGPU.anchorX[firstMDIndex]; float diffY = mdsInGPU.anchorY[thirdMDIndex] - mdsInGPU.anchorY[firstMDIndex]; - float diffZ = mdsInGPU.anchorZ[thirdMDIndex] - mdsInGPU.anchorZ[firstMDIndex]; dPhi = SDL::deltaPhi(acc, midPointX, midPointY, diffX, diffY); @@ -892,7 +871,6 @@ namespace SDL { float tl_axis_x = mdsInGPU.anchorX[fourthMDIndex] - mdsInGPU.anchorX[firstMDIndex]; float tl_axis_y = mdsInGPU.anchorY[fourthMDIndex] - mdsInGPU.anchorY[firstMDIndex]; - float tl_axis_z = mdsInGPU.anchorZ[fourthMDIndex] - mdsInGPU.anchorZ[firstMDIndex]; float tl_axis_highEdge_x = tl_axis_x; float tl_axis_highEdge_y = tl_axis_y; float tl_axis_lowEdge_x = tl_axis_x; @@ -937,10 +915,6 @@ namespace SDL { //beta computation float drt_tl_axis = alpaka::math::sqrt(acc, tl_axis_x * tl_axis_x + tl_axis_y * tl_axis_y); - float drt_tl_lowEdge = - alpaka::math::sqrt(acc, tl_axis_lowEdge_x * tl_axis_lowEdge_x + tl_axis_lowEdge_y * tl_axis_lowEdge_y); - float drt_tl_highEdge = - alpaka::math::sqrt(acc, tl_axis_highEdge_x * tl_axis_highEdge_x + tl_axis_highEdge_y * tl_axis_highEdge_y); float corrF = 1.f; //innerOuterAnchor - innerInnerAnchor @@ -972,8 +946,6 @@ namespace SDL { (mdsInGPU.anchorY[fourthMDIndex] - mdsInGPU.anchorY[thirdMDIndex])); float sdOut_d = mdsInGPU.anchorRt[fourthMDIndex] - mdsInGPU.anchorRt[thirdMDIndex]; - const float diffDr = alpaka::math::abs(acc, rt_InSeg - sdOut_dr) / alpaka::math::abs(acc, rt_InSeg + sdOut_dr); - runDeltaBetaIterationsT3(acc, betaIn, betaOut, betaAv, pt_beta, rt_InSeg, sdOut_dr, drt_tl_axis, lIn); const float betaInMMSF = (alpaka::math::abs(acc, betaInRHmin + betaInRHmax) > 0) @@ -1032,8 +1004,6 @@ namespace SDL { if (not pass) return pass; - float pt_betaIn = drt_tl_axis * SDL::k2Rinv1GeVf / alpaka::math::sin(acc, betaIn); - float pt_betaOut = drt_tl_axis * SDL::k2Rinv1GeVf / alpaka::math::sin(acc, betaOut); float dBetaRes = 0.02f / alpaka::math::min(acc, sdOut_d, drt_InSeg); float dBetaCut2 = (dBetaRes * dBetaRes * 2.0f + dBetaMuls * dBetaMuls + dBetaLum2 + dBetaRIn2 + dBetaROut2 + @@ -1151,10 +1121,6 @@ namespace SDL { drtErr += sdlMuls * sdlMuls * multDzDr * multDzDr / 3.f * coshEta * coshEta; //sloppy: relative muls is 1/3 of total muls drtErr = alpaka::math::sqrt(acc, drtErr); - const float drtMean = drtSDIn * dzOutInAbs / alpaka::math::abs(acc, dzSDIn); - const float rtWindow = drtErr + rtGeom1; - const float rtLo_another = rt_InLo + drtMean / dzDrtScale - rtWindow; - const float rtHi_another = rt_InLo + drtMean + rtWindow; //Cut #3: rt-z pointed pass = pass and ((kZ >= 0) && (rtOut >= rtLo) && (rtOut <= rtHi)); @@ -1173,10 +1139,8 @@ namespace SDL { float midPointX = 0.5f * (mdsInGPU.anchorX[firstMDIndex] + mdsInGPU.anchorX[thirdMDIndex]); float midPointY = 0.5f * (mdsInGPU.anchorY[firstMDIndex] + mdsInGPU.anchorY[thirdMDIndex]); - float midPointZ = 0.5f * (mdsInGPU.anchorZ[firstMDIndex] + mdsInGPU.anchorZ[thirdMDIndex]); float diffX = mdsInGPU.anchorX[thirdMDIndex] - mdsInGPU.anchorX[firstMDIndex]; float diffY = mdsInGPU.anchorY[thirdMDIndex] - mdsInGPU.anchorY[firstMDIndex]; - float diffZ = mdsInGPU.anchorZ[thirdMDIndex] - mdsInGPU.anchorZ[firstMDIndex]; dPhi = SDL::deltaPhi(acc, midPointX, midPointY, diffX, diffY); // Cut #5: deltaPhiChange @@ -1202,7 +1166,6 @@ namespace SDL { float tl_axis_x = mdsInGPU.anchorX[fourthMDIndex] - mdsInGPU.anchorX[firstMDIndex]; float tl_axis_y = mdsInGPU.anchorY[fourthMDIndex] - mdsInGPU.anchorY[firstMDIndex]; - float tl_axis_z = mdsInGPU.anchorZ[fourthMDIndex] - mdsInGPU.anchorZ[firstMDIndex]; betaIn = sdIn_alpha - SDL::phi_mpi_pi(acc, SDL::phi(acc, tl_axis_x, tl_axis_y) - mdsInGPU.anchorPhi[firstMDIndex]); @@ -1327,8 +1290,6 @@ namespace SDL { if (not pass) return pass; - float pt_betaIn = dr * SDL::k2Rinv1GeVf / alpaka::math::sin(acc, betaIn); - float pt_betaOut = dr * SDL::k2Rinv1GeVf / alpaka::math::sin(acc, betaOut); float dBetaRes = 0.02f / alpaka::math::min(acc, sdOut_d, sdIn_d); float dBetaCut2 = (dBetaRes * dBetaRes * 2.0f + dBetaMuls * dBetaMuls + dBetaLum2 + dBetaRIn2 + dBetaROut2 + @@ -1412,7 +1373,6 @@ namespace SDL { : (isInSgInnerMDPS or isOutSgInnerMDPS) ? SDL::pixelPSZpitch + SDL::strip2SZpitch : 2.f * SDL::strip2SZpitch; - float zGeom1 = SDL::copysignf(zGeom, z_InLo); float dz = z_OutLo - z_InLo; rtLo = rt_InLo * (1.f + dz / (z_InLo + dLum) / dzDrtScale) - rtGeom; //slope correction only on the lower end @@ -1429,7 +1389,6 @@ namespace SDL { bool isInSgOuterMDPS = modulesInGPU.moduleType[innerOuterLowerModuleIndex] == SDL::PS; - float drOutIn = rtOut - rt_InLo; const float drtSDIn = rt_InOut - rt_InLo; const float dzSDIn = z_InOut - z_InLo; const float dr3SDIn = alpaka::math::sqrt(acc, rt_InOut * rt_InOut + z_InOut * z_InOut) - @@ -1474,10 +1433,8 @@ namespace SDL { float midPointX = 0.5f * (mdsInGPU.anchorX[firstMDIndex] + mdsInGPU.anchorX[thirdMDIndex]); float midPointY = 0.5f * (mdsInGPU.anchorY[firstMDIndex] + mdsInGPU.anchorY[thirdMDIndex]); - float midPointZ = 0.5f * (mdsInGPU.anchorZ[firstMDIndex] + mdsInGPU.anchorZ[thirdMDIndex]); float diffX = mdsInGPU.anchorX[thirdMDIndex] - mdsInGPU.anchorX[firstMDIndex]; float diffY = mdsInGPU.anchorY[thirdMDIndex] - mdsInGPU.anchorY[firstMDIndex]; - float diffZ = mdsInGPU.anchorZ[thirdMDIndex] - mdsInGPU.anchorZ[firstMDIndex]; dPhi = SDL::deltaPhi(acc, midPointX, midPointY, diffX, diffY); @@ -1500,7 +1457,6 @@ namespace SDL { float tl_axis_x = mdsInGPU.anchorX[fourthMDIndex] - mdsInGPU.anchorX[firstMDIndex]; float tl_axis_y = mdsInGPU.anchorY[fourthMDIndex] - mdsInGPU.anchorY[firstMDIndex]; - float tl_axis_z = mdsInGPU.anchorZ[fourthMDIndex] - mdsInGPU.anchorZ[firstMDIndex]; betaIn = sdIn_alpha - SDL::phi_mpi_pi(acc, SDL::phi(acc, tl_axis_x, tl_axis_y) - mdsInGPU.anchorPhi[firstMDIndex]); @@ -1559,8 +1515,6 @@ namespace SDL { (mdsInGPU.anchorY[fourthMDIndex] - mdsInGPU.anchorY[thirdMDIndex])); float sdOut_d = mdsInGPU.anchorRt[fourthMDIndex] - mdsInGPU.anchorRt[thirdMDIndex]; - float diffDr = alpaka::math::abs(acc, sdIn_dr - sdOut_dr) / alpaka::math::abs(acc, sdIn_dr + sdOut_dr); - runDeltaBetaIterationsT3(acc, betaIn, betaOut, betaAv, pt_beta, sdIn_dr, sdOut_dr, dr, lIn); const float betaInMMSF = (alpaka::math::abs(acc, betaInRHmin + betaInRHmax) > 0) @@ -1590,7 +1544,6 @@ namespace SDL { const float dBetaInLum = lIn < 11 ? 0.0f : alpaka::math::abs(acc, alphaInAbsReg * SDL::deltaZLum / z_InLo); const float dBetaOutLum = lOut < 11 ? 0.0f : alpaka::math::abs(acc, alphaOutAbsReg * SDL::deltaZLum / z_OutLo); const float dBetaLum2 = (dBetaInLum + dBetaOutLum) * (dBetaInLum + dBetaOutLum); - const float sinDPhi = alpaka::math::sin(acc, dPhi); const float dBetaRIn2 = 0; // TODO-RH // const float dBetaROut2 = 0; // TODO-RH @@ -1606,8 +1559,6 @@ namespace SDL { if (not pass) return pass; - float pt_betaIn = dr * SDL::k2Rinv1GeVf / alpaka::math::sin(acc, betaIn); - float pt_betaOut = dr * SDL::k2Rinv1GeVf / alpaka::math::sin(acc, betaOut); float dBetaRes = 0.02f / alpaka::math::min(acc, sdOut_d, sdIn_d); float dBetaCut2 = (dBetaRes * dBetaRes * 2.0f + dBetaMuls * dBetaMuls + dBetaLum2 + dBetaRIn2 + dBetaROut2 + From ce1efde3acb9380a4d72ef47e962634775df623e Mon Sep 17 00:00:00 2001 From: Andres Rios-Tascon Date: Mon, 29 Jan 2024 17:05:41 -0500 Subject: [PATCH 4/7] Fixed order of initializations --- SDL/MiniDoublet.h | 6 +++--- SDL/Module.h | 5 ++--- SDL/Segment.h | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/SDL/MiniDoublet.h b/SDL/MiniDoublet.h index c90e7c70..b2b12426 100644 --- a/SDL/MiniDoublet.h +++ b/SDL/MiniDoublet.h @@ -165,6 +165,8 @@ namespace SDL { anchorHighEdgeY_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)), anchorLowEdgeX_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)), anchorLowEdgeY_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)), + anchorLowEdgePhi_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)), + anchorHighEdgePhi_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)), outerX_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)), outerY_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)), outerZ_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)), @@ -174,9 +176,7 @@ namespace SDL { outerHighEdgeX_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)), outerHighEdgeY_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)), outerLowEdgeX_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)), - outerLowEdgeY_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)), - anchorLowEdgePhi_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)), - anchorHighEdgePhi_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)) { + outerLowEdgeY_buf(allocBufWrapper(devAccIn, nMemoryLoc, queue)) { alpaka::memset(queue, nMDs_buf, 0u); alpaka::memset(queue, totOccupancyMDs_buf, 0u); alpaka::wait(queue); diff --git a/SDL/Module.h b/SDL/Module.h index 0639cb22..6895bf9c 100644 --- a/SDL/Module.h +++ b/SDL/Module.h @@ -323,9 +323,8 @@ namespace SDL { isAnchor_buf(allocBufWrapper(devAccIn, nMod)), moduleType_buf(allocBufWrapper(devAccIn, nMod)), moduleLayerType_buf(allocBufWrapper(devAccIn, nMod)), - sdlLayers_buf(allocBufWrapper(devAccIn, nMod)), - - connectedPixels_buf(allocBufWrapper(devAccIn, nPixs)) {} + connectedPixels_buf(allocBufWrapper(devAccIn, nPixs)), + sdlLayers_buf(allocBufWrapper(devAccIn, nMod)) {} }; // PixelMap is never allocated on the device. diff --git a/SDL/Segment.h b/SDL/Segment.h index dff976ff..88bfc287 100644 --- a/SDL/Segment.h +++ b/SDL/Segment.h @@ -136,13 +136,13 @@ namespace SDL { outerLowerModuleIndices_buf(allocBufWrapper(devAccIn, nMemoryLocationsIn, queue)), seedIdx_buf(allocBufWrapper(devAccIn, maxPixelSegments, queue)), mdIndices_buf(allocBufWrapper(devAccIn, nMemoryLocationsIn * 2, queue)), + nMemoryLocations_buf(allocBufWrapper(devAccIn, 1, queue)), innerMiniDoubletAnchorHitIndices_buf(allocBufWrapper(devAccIn, nMemoryLocationsIn, queue)), outerMiniDoubletAnchorHitIndices_buf(allocBufWrapper(devAccIn, nMemoryLocationsIn, queue)), - nMemoryLocations_buf(allocBufWrapper(devAccIn, 1, queue)), - nSegments_buf(allocBufWrapper(devAccIn, nLowerModules + 1, queue)), - totOccupancySegments_buf(allocBufWrapper(devAccIn, nLowerModules + 1, queue)), charge_buf(allocBufWrapper(devAccIn, maxPixelSegments, queue)), superbin_buf(allocBufWrapper(devAccIn, maxPixelSegments, queue)), + nSegments_buf(allocBufWrapper(devAccIn, nLowerModules + 1, queue)), + totOccupancySegments_buf(allocBufWrapper(devAccIn, nLowerModules + 1, queue)), pLSHitsIdxs_buf(allocBufWrapper(devAccIn, maxPixelSegments, queue)), pixelType_buf(allocBufWrapper(devAccIn, maxPixelSegments, queue)), isQuad_buf(allocBufWrapper(devAccIn, maxPixelSegments, queue)), From 87ab527a8ca2b6ac96dbfad33c7a35cbc063660d Mon Sep 17 00:00:00 2001 From: Andres Rios-Tascon Date: Tue, 30 Jan 2024 12:42:36 -0500 Subject: [PATCH 5/7] Use Werror flags by default --- SDL/Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/SDL/Makefile b/SDL/Makefile index 51c7e175..b7b0056c 100644 --- a/SDL/Makefile +++ b/SDL/Makefile @@ -38,6 +38,10 @@ DUPLICATES = -DDUP_pLS -DDUP_T5 -DDUP_pT5 -DDUP_pT3 -DCrossclean_T5 -D CACHEFLAG = PTCUTFLAG = LSTWARNINGSFLAG = +CMSSW_WERRORS_CPU = -Werror=pointer-arith -Werror=overlength-strings -Werror=return-type -Werror=missing-braces -Werror=unused-value -Werror=unused-label \ + -Werror=address -Werror=format -Werror=sign-compare -Werror=write-strings -Werror=delete-non-virtual-dtor -Werror=strict-aliasing -Werror=narrowing \ + -Werror=unused-but-set-variable -Werror=reorder -Werror=unused-variable -Werror=conversion-null -Werror=return-local-addr -Wnon-virtual-dtor -Werror=switch +CMSSW_WERRORS_CUDA = $(patsubst %,-Xcompiler %,$(CMSSW_WERRORS_CPU)) CACHEFLAG_FLAGS = -DCACHE_ALLOC T5CUTFLAGS = $(T5DNNFLAG) $(T5RZCHI2FLAG) $(T5RPHICHI2FLAG) @@ -55,16 +59,16 @@ CUTVALUEFLAG = CUTVALUEFLAG_FLAGS = -DCUT_VALUE_DEBUG LST_cpu.o: LST.cc - $(CXX) -c $(CXXFLAGS_CPU) $(ROOTLIBS) $(PRINTFLAG) $(CACHEFLAG) $(DUPLICATES) $(LSTWARNINGSFLAG) $(ROOTCFLAGS) $(ALPAKAINCLUDE) $(PTCUTFLAG) $(ALPAKASERIAL) $< -o $@ + $(CXX) -c $(CXXFLAGS_CPU) $(ROOTLIBS) $(PRINTFLAG) $(CACHEFLAG) $(DUPLICATES) $(LSTWARNINGSFLAG) $(CMSSW_WERRORS_CPU) $(ROOTCFLAGS) $(ALPAKAINCLUDE) $(PTCUTFLAG) $(ALPAKASERIAL) $< -o $@ LST_cuda.o: LST.cc - $(CXX) -c $(CXXFLAGS_CPU) $(ROOTLIBS) $(PRINTFLAG) $(CACHEFLAG) $(DUPLICATES) $(LSTWARNINGSFLAG) $(ROOTCFLAGS) $(ALPAKAINCLUDE) $(PTCUTFLAG) $(ALPAKASERIAL) $< -o $@ + $(CXX) -c $(CXXFLAGS_CPU) $(ROOTLIBS) $(PRINTFLAG) $(CACHEFLAG) $(DUPLICATES) $(LSTWARNINGSFLAG) $(CMSSW_WERRORS_CPU) $(ROOTCFLAGS) $(ALPAKAINCLUDE) $(PTCUTFLAG) $(ALPAKASERIAL) $< -o $@ %_cpu.o: %.cc - $(COMPILE_CMD_CPU) $(CXXFLAGS_CPU) $(PRINTFLAG) $(CACHEFLAG) $(CUTVALUEFLAG) $(LSTWARNINGSFLAG) $(T5CUTFLAGS) $(NOPLSDUPCLEANFLAG) $(TCPLSTRIPLETSFLAG) $(PTCUTFLAG) $(DUPLICATES) $(ALPAKAINCLUDE) $(ALPAKABACKEND_CPU) $< -o $@ + $(COMPILE_CMD_CPU) $(CXXFLAGS_CPU) $(PRINTFLAG) $(CACHEFLAG) $(CUTVALUEFLAG) $(LSTWARNINGSFLAG) $(CMSSW_WERRORS_CPU) $(T5CUTFLAGS) $(NOPLSDUPCLEANFLAG) $(TCPLSTRIPLETSFLAG) $(PTCUTFLAG) $(DUPLICATES) $(ALPAKAINCLUDE) $(ALPAKABACKEND_CPU) $< -o $@ %_cuda.o: %.cc - $(COMPILE_CMD_CUDA) $(CXXFLAGS_CUDA) $(PRINTFLAG) $(CACHEFLAG) $(CUTVALUEFLAG) $(LSTWARNINGSFLAG) $(T5CUTFLAGS) $(NOPLSDUPCLEANFLAG) $(TCPLSTRIPLETSFLAG) $(PTCUTFLAG) $(DUPLICATES) $(ALPAKAINCLUDE) $(ALPAKABACKEND_CUDA) $< -o $@ + $(COMPILE_CMD_CUDA) $(CXXFLAGS_CUDA) $(PRINTFLAG) $(CACHEFLAG) $(CUTVALUEFLAG) $(LSTWARNINGSFLAG) $(CMSSW_WERRORS_CUDA) $(T5CUTFLAGS) $(NOPLSDUPCLEANFLAG) $(TCPLSTRIPLETSFLAG) $(PTCUTFLAG) $(DUPLICATES) $(ALPAKAINCLUDE) $(ALPAKABACKEND_CUDA) $< -o $@ $(LIB_CUDA): $(CCOBJECTS_CUDA) $(LSTOBJECTS_CUDA) $(LD_CUDA) $(SOFLAGS_CUDA) $^ -o $@ From c293e01a30e9b5891e6a555992c3a34078acf00d Mon Sep 17 00:00:00 2001 From: Andres Rios-Tascon Date: Tue, 30 Jan 2024 13:08:21 -0500 Subject: [PATCH 6/7] Apply clang-format changes --- SDL/Hit.h | 7 ++++--- SDL/LST.cc | 2 +- SDL/PixelTriplet.h | 3 ++- SDL/Segment.h | 2 +- SDL/TrackCandidate.h | 3 ++- SDL/Triplet.h | 3 ++- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/SDL/Hit.h b/SDL/Hit.h index d26d4d73..c0ae3b3e 100644 --- a/SDL/Hit.h +++ b/SDL/Hit.h @@ -264,12 +264,13 @@ namespace SDL { hitsInGPU.lowEdgeYs[ihit] = ihit_y - 2.5f * sin_phi; } // Need to set initial value if index hasn't been seen before. - int old = alpaka::atomicOp(acc, &(hitsInGPU.hitRanges[lastModuleIndex * 2]), -1, (int) ihit); + int old = alpaka::atomicOp( + acc, &(hitsInGPU.hitRanges[lastModuleIndex * 2]), -1, static_cast(ihit)); // For subsequent visits, stores the min value. if (old != -1) - alpaka::atomicOp(acc, &hitsInGPU.hitRanges[lastModuleIndex * 2], (int) ihit); + alpaka::atomicOp(acc, &hitsInGPU.hitRanges[lastModuleIndex * 2], static_cast(ihit)); - alpaka::atomicOp(acc, &hitsInGPU.hitRanges[lastModuleIndex * 2 + 1], (int) ihit); + alpaka::atomicOp(acc, &hitsInGPU.hitRanges[lastModuleIndex * 2 + 1], static_cast(ihit)); } } }; diff --git a/SDL/LST.cc b/SDL/LST.cc index 225f19ff..67c6cb70 100644 --- a/SDL/LST.cc +++ b/SDL/LST.cc @@ -118,7 +118,7 @@ void SDL::LST::prepareInput(const std::vector see_px, std::iota(hitIdxs.begin(), hitIdxs.end(), 0); const int hit_size = trkX.size(); - for(size_t iSeed = 0; iSeed < n_see; iSeed++) { + for (size_t iSeed = 0; iSeed < n_see; iSeed++) { ROOT::Math::PxPyPzMVector p3LH(see_stateTrajGlbPx[iSeed], see_stateTrajGlbPy[iSeed], see_stateTrajGlbPz[iSeed], 0); ROOT::Math::XYZVector p3LH_helper(see_stateTrajGlbPx[iSeed], see_stateTrajGlbPy[iSeed], see_stateTrajGlbPz[iSeed]); float ptIn = p3LH.Pt(); diff --git a/SDL/PixelTriplet.h b/SDL/PixelTriplet.h index bb7df3e3..155dfcbc 100644 --- a/SDL/PixelTriplet.h +++ b/SDL/PixelTriplet.h @@ -1157,7 +1157,8 @@ namespace SDL { printf("Pixel Triplet excess alert!\n"); #endif } else { - unsigned int pixelTripletIndex = alpaka::atomicOp(acc, pixelTripletsInGPU.nPixelTriplets, 1u); + unsigned int pixelTripletIndex = + alpaka::atomicOp(acc, pixelTripletsInGPU.nPixelTriplets, 1u); addPixelTripletToMemory(modulesInGPU, mdsInGPU, segmentsInGPU, diff --git a/SDL/Segment.h b/SDL/Segment.h index 88bfc287..b46f0b71 100644 --- a/SDL/Segment.h +++ b/SDL/Segment.h @@ -876,7 +876,7 @@ namespace SDL { if (pass) { unsigned int totOccupancySegments = alpaka::atomicOp( acc, &segmentsInGPU.totOccupancySegments[innerLowerModuleIndex], 1u); - if (totOccupancySegments >= (unsigned int) (rangesInGPU.segmentModuleOccupancy[innerLowerModuleIndex])) { + if (static_cast(totOccupancySegments) >= rangesInGPU.segmentModuleOccupancy[innerLowerModuleIndex]) { #ifdef Warnings printf("Segment excess alert! Module index = %d\n", innerLowerModuleIndex); #endif diff --git a/SDL/TrackCandidate.h b/SDL/TrackCandidate.h index 205ff7cc..04c971fc 100644 --- a/SDL/TrackCandidate.h +++ b/SDL/TrackCandidate.h @@ -568,7 +568,8 @@ namespace SDL { if (pixelQuintupletsInGPU.isDup[pixelQuintupletIndex]) continue; - unsigned int trackCandidateIdx = alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidates, 1u); + unsigned int trackCandidateIdx = + alpaka::atomicOp(acc, trackCandidatesInGPU.nTrackCandidates, 1u); if (trackCandidateIdx >= N_MAX_PIXEL_TRACK_CANDIDATES) // No other TCs have been added yet { #ifdef Warnings diff --git a/SDL/Triplet.h b/SDL/Triplet.h index 240d8495..de2e8104 100644 --- a/SDL/Triplet.h +++ b/SDL/Triplet.h @@ -1971,7 +1971,8 @@ namespace SDL { if (success) { unsigned int totOccupancyTriplets = alpaka::atomicOp( acc, &tripletsInGPU.totOccupancyTriplets[innerInnerLowerModuleIndex], 1u); - if (totOccupancyTriplets >= (unsigned int) (rangesInGPU.tripletModuleOccupancy[innerInnerLowerModuleIndex])) { + if (static_cast(totOccupancyTriplets) >= + rangesInGPU.tripletModuleOccupancy[innerInnerLowerModuleIndex]) { #ifdef Warnings printf("Triplet excess alert! Module index = %d\n", innerInnerLowerModuleIndex); #endif From b4029c5fe544d423ea0e12099f365359698aecb3 Mon Sep 17 00:00:00 2001 From: Andres Rios-Tascon Date: Fri, 2 Feb 2024 13:02:16 -0500 Subject: [PATCH 7/7] Fixed a small mistake I made while resolving conflicts --- SDL/Module.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SDL/Module.h b/SDL/Module.h index f8aa40cf..aa483d83 100644 --- a/SDL/Module.h +++ b/SDL/Module.h @@ -309,8 +309,8 @@ namespace SDL { isAnchor_buf(allocBufWrapper(devAccIn, nMod)), moduleType_buf(allocBufWrapper(devAccIn, nMod)), moduleLayerType_buf(allocBufWrapper(devAccIn, nMod)), - connectedPixels_buf(allocBufWrapper(devAccIn, nPixs)), - sdlLayers_buf(allocBufWrapper(devAccIn, nMod)) {} + sdlLayers_buf(allocBufWrapper(devAccIn, nMod)), + connectedPixels_buf(allocBufWrapper(devAccIn, nPixs)) {} template inline void copyFromSrc(TQueue queue, const modulesBuffer& src) {