Skip to content

Commit

Permalink
Apply reco comments: Naming values and sqrt, loop, etc. simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
VourMa committed Jul 3, 2024
1 parent 236ad8c commit a97714a
Show file tree
Hide file tree
Showing 11 changed files with 1,105 additions and 1,135 deletions.
17 changes: 17 additions & 0 deletions RecoTracker/LSTCore/interface/alpaka/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,20 @@ namespace SDL {
const unsigned int size_superbins = 45000;

//defining the constant host device variables right up here
ALPAKA_STATIC_ACC_MEM_GLOBAL const int layers_pLS = 2;
ALPAKA_STATIC_ACC_MEM_GLOBAL const int layers_LS = 2;
ALPAKA_STATIC_ACC_MEM_GLOBAL const int layers_T3 = 3;
ALPAKA_STATIC_ACC_MEM_GLOBAL const int layers_pT3 = 5;
ALPAKA_STATIC_ACC_MEM_GLOBAL const int layers_T5 = 5;
ALPAKA_STATIC_ACC_MEM_GLOBAL const int layers_pT5 = 7;

ALPAKA_STATIC_ACC_MEM_GLOBAL const int hits_pLS = 4;
ALPAKA_STATIC_ACC_MEM_GLOBAL const int hits_LS = 4;
ALPAKA_STATIC_ACC_MEM_GLOBAL const int hits_T3 = 6;
ALPAKA_STATIC_ACC_MEM_GLOBAL const int hits_pT3 = 10;
ALPAKA_STATIC_ACC_MEM_GLOBAL const int hits_T5 = 10;
ALPAKA_STATIC_ACC_MEM_GLOBAL const int hits_pT5 = 14;

ALPAKA_STATIC_ACC_MEM_GLOBAL const float miniMulsPtScaleBarrel[6] = {0.0052, 0.0038, 0.0034, 0.0034, 0.0032, 0.0034};
ALPAKA_STATIC_ACC_MEM_GLOBAL const float miniMulsPtScaleEndcap[5] = {0.006, 0.006, 0.006, 0.006, 0.006};
ALPAKA_STATIC_ACC_MEM_GLOBAL const float miniRminMeanBarrel[6] = {
Expand All @@ -132,7 +146,10 @@ namespace SDL {
ALPAKA_STATIC_ACC_MEM_GLOBAL const float ptCut = PT_CUT;
ALPAKA_STATIC_ACC_MEM_GLOBAL const float deltaZLum = 15.0;
ALPAKA_STATIC_ACC_MEM_GLOBAL const float pixelPSZpitch = 0.15;
ALPAKA_STATIC_ACC_MEM_GLOBAL const float stripPSZpitch = 2.4;
ALPAKA_STATIC_ACC_MEM_GLOBAL const float strip2SZpitch = 5.0;
ALPAKA_STATIC_ACC_MEM_GLOBAL const float width2S = 0.009;
ALPAKA_STATIC_ACC_MEM_GLOBAL const float widthPS = 0.01;
ALPAKA_STATIC_ACC_MEM_GLOBAL const float pt_betaMax = 7.0;
ALPAKA_STATIC_ACC_MEM_GLOBAL const float magnetic_field = 3.8112;
// Since C++ can't represent infinity, SDL_INF = 123456789 was used to represent infinity in the data table
Expand Down
20 changes: 12 additions & 8 deletions RecoTracker/LSTCore/src/alpaka/Event.dev.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1622,8 +1622,8 @@ SDL::tripletsBuffer<alpaka::DevCpu>* SDL::Event<SDL::Acc>::getTriplets() {
alpaka::memcpy(queue, tripletsInCPU->rtLo_buf, tripletsBuffers->rtLo_buf, nMemHost);
alpaka::memcpy(queue, tripletsInCPU->rtHi_buf, tripletsBuffers->rtHi_buf, nMemHost);
#endif
alpaka::memcpy(queue, tripletsInCPU->hitIndices_buf, tripletsBuffers->hitIndices_buf, 6 * nMemHost);
alpaka::memcpy(queue, tripletsInCPU->logicalLayers_buf, tripletsBuffers->logicalLayers_buf, 3 * nMemHost);
alpaka::memcpy(queue, tripletsInCPU->hitIndices_buf, tripletsBuffers->hitIndices_buf, hits_T3 * nMemHost);
alpaka::memcpy(queue, tripletsInCPU->logicalLayers_buf, tripletsBuffers->logicalLayers_buf, layers_T3 * nMemHost);
alpaka::memcpy(queue, tripletsInCPU->segmentIndices_buf, tripletsBuffers->segmentIndices_buf, 2 * nMemHost);
alpaka::memcpy(queue, tripletsInCPU->betaIn_buf, tripletsBuffers->betaIn_buf, nMemHost);
alpaka::memcpy(queue, tripletsInCPU->circleRadius_buf, tripletsBuffers->circleRadius_buf, nMemHost);
Expand All @@ -1650,8 +1650,10 @@ SDL::quintupletsBuffer<alpaka::DevCpu>* SDL::Event<SDL::Acc>::getQuintuplets() {
alpaka::memcpy(
queue, quintupletsInCPU->totOccupancyQuintuplets_buf, quintupletsBuffers->totOccupancyQuintuplets_buf);
alpaka::memcpy(queue, quintupletsInCPU->tripletIndices_buf, quintupletsBuffers->tripletIndices_buf, 2 * nMemHost);
alpaka::memcpy(
queue, quintupletsInCPU->lowerModuleIndices_buf, quintupletsBuffers->lowerModuleIndices_buf, 5 * nMemHost);
alpaka::memcpy(queue,
quintupletsInCPU->lowerModuleIndices_buf,
quintupletsBuffers->lowerModuleIndices_buf,
layers_T5 * nMemHost);
alpaka::memcpy(queue, quintupletsInCPU->innerRadius_buf, quintupletsBuffers->innerRadius_buf, nMemHost);
alpaka::memcpy(queue, quintupletsInCPU->bridgeRadius_buf, quintupletsBuffers->bridgeRadius_buf, nMemHost);
alpaka::memcpy(queue, quintupletsInCPU->outerRadius_buf, quintupletsBuffers->outerRadius_buf, nMemHost);
Expand Down Expand Up @@ -1757,11 +1759,13 @@ SDL::trackCandidatesBuffer<alpaka::DevCpu>* SDL::Event<SDL::Acc>::getTrackCandid

*alpaka::getPtrNative(trackCandidatesInCPU->nTrackCandidates_buf) = nTrackCanHost;
alpaka::memcpy(
queue, trackCandidatesInCPU->hitIndices_buf, trackCandidatesBuffers->hitIndices_buf, 14 * nTrackCanHost);
queue, trackCandidatesInCPU->hitIndices_buf, trackCandidatesBuffers->hitIndices_buf, hits_pT5 * nTrackCanHost);
alpaka::memcpy(
queue, trackCandidatesInCPU->pixelSeedIndex_buf, trackCandidatesBuffers->pixelSeedIndex_buf, nTrackCanHost);
alpaka::memcpy(
queue, trackCandidatesInCPU->logicalLayers_buf, trackCandidatesBuffers->logicalLayers_buf, 7 * nTrackCanHost);
alpaka::memcpy(queue,
trackCandidatesInCPU->logicalLayers_buf,
trackCandidatesBuffers->logicalLayers_buf,
layers_pT5 * nTrackCanHost);
alpaka::memcpy(queue,
trackCandidatesInCPU->directObjectIndices_buf,
trackCandidatesBuffers->directObjectIndices_buf,
Expand Down Expand Up @@ -1791,7 +1795,7 @@ SDL::trackCandidatesBuffer<alpaka::DevCpu>* SDL::Event<SDL::Acc>::getTrackCandid

*alpaka::getPtrNative(trackCandidatesInCPU->nTrackCandidates_buf) = nTrackCanHost;
alpaka::memcpy(
queue, trackCandidatesInCPU->hitIndices_buf, trackCandidatesBuffers->hitIndices_buf, 14 * nTrackCanHost);
queue, trackCandidatesInCPU->hitIndices_buf, trackCandidatesBuffers->hitIndices_buf, hits_pT5 * nTrackCanHost);
alpaka::memcpy(
queue, trackCandidatesInCPU->pixelSeedIndex_buf, trackCandidatesBuffers->pixelSeedIndex_buf, nTrackCanHost);
alpaka::memcpy(queue,
Expand Down
Loading

0 comments on commit a97714a

Please sign in to comment.