-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GPU TPC: Create and distribute TPC Cluster Occupancy Map
- Loading branch information
Showing
17 changed files
with
223 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
// All rights not expressly granted are reserved. | ||
// | ||
// This software is distributed under the terms of the GNU General Public | ||
// License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
// | ||
// In applying this license CERN does not waive the privileges and immunities | ||
// granted to it by virtue of its status as an Intergovernmental Organization | ||
// or submit itself to any jurisdiction. | ||
|
||
/// \file GPUTPCClusterOccupancyMap.cxx | ||
/// \author David Rohr | ||
|
||
#include "GPUTPCClusterOccupancyMap.h" | ||
#include "GPUParam.h" | ||
|
||
using namespace GPUCA_NAMESPACE::gpu; | ||
|
||
GPUd() unsigned int GPUTPCClusterOccupancyMapBin::getNBins(const GPUParam& param) | ||
{ | ||
unsigned int maxTimeBin = param.par.continuousTracking ? param.par.continuousMaxTimeBin : TPC_MAX_TIME_BIN_TRIGGERED; | ||
return (maxTimeBin + param.rec.tpc.occupancyMapTimeBins) / param.rec.tpc.occupancyMapTimeBins; // Not -1, since maxTimeBin is allowed | ||
} | ||
|
||
GPUd() unsigned int GPUTPCClusterOccupancyMapBin::getTotalSize(const GPUParam& param) | ||
{ | ||
return getNBins(param) * sizeof(GPUTPCClusterOccupancyMapBin); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
// All rights not expressly granted are reserved. | ||
// | ||
// This software is distributed under the terms of the GNU General Public | ||
// License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
// | ||
// In applying this license CERN does not waive the privileges and immunities | ||
// granted to it by virtue of its status as an Intergovernmental Organization | ||
// or submit itself to any jurisdiction. | ||
|
||
/// \file GPUTPCClusterOccupancyMap.h | ||
/// \author David Rohr | ||
|
||
#ifndef GPUTPCCLUSTEROCCUPANCYMAP_H | ||
#define GPUTPCCLUSTEROCCUPANCYMAP_H | ||
|
||
#include "GPUCommonDef.h" | ||
#include "GPUDefConstantsAndSettings.h" | ||
|
||
namespace GPUCA_NAMESPACE::gpu | ||
{ | ||
struct GPUParam; | ||
struct GPUTPCClusterOccupancyMapBin { | ||
unsigned short bin[GPUCA_NSLICES][GPUCA_ROW_COUNT]; | ||
|
||
GPUd() static unsigned int getNBins(const GPUParam& param); | ||
GPUd() static unsigned int getTotalSize(const GPUParam& param); | ||
}; | ||
|
||
} // namespace GPUCA_NAMESPACE::gpu | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
// All rights not expressly granted are reserved. | ||
// | ||
// This software is distributed under the terms of the GNU General Public | ||
// License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
// | ||
// In applying this license CERN does not waive the privileges and immunities | ||
// granted to it by virtue of its status as an Intergovernmental Organization | ||
// or submit itself to any jurisdiction. | ||
|
||
/// \file GPUTPCCreateOccupancyMap.cxx | ||
/// \author David Rohr | ||
|
||
#include "GPUTPCCreateOccupancyMap.h" | ||
#include "GPUTPCClusterOccupancyMap.h" | ||
|
||
using namespace GPUCA_NAMESPACE::gpu; | ||
|
||
template <> | ||
GPUdii() void GPUTPCCreateOccupancyMap::Thread<0>(int nBlocks, int nThreads, int iBlock, int iThread, GPUsharedref() GPUSharedMemory& smem, processorType& GPUrestrict() processors, GPUTPCClusterOccupancyMapBin* GPUrestrict() map) | ||
{ | ||
const GPUTrackingInOutPointers& GPUrestrict() ioPtrs = processors.ioPtrs; | ||
const o2::tpc::ClusterNativeAccess* GPUrestrict() clusters = ioPtrs.clustersNative; | ||
GPUParam& GPUrestrict() param = processors.param; | ||
const int iSliceRow = iBlock * nThreads + iThread; | ||
if (iSliceRow >= GPUCA_ROW_COUNT * GPUCA_NSLICES) { | ||
return; | ||
} | ||
const unsigned int iSlice = iSliceRow / GPUCA_ROW_COUNT; | ||
const unsigned int iRow = iSliceRow % GPUCA_ROW_COUNT; | ||
for (unsigned int i = 0; i < clusters->nClusters[iSlice][iRow]; i++) { | ||
const unsigned int bin = clusters->clusters[iSlice][iRow][i].getTime() / param.rec.tpc.occupancyMapTimeBins; | ||
map[bin].bin[iSlice][iRow]++; | ||
} | ||
} | ||
|
||
template <> | ||
GPUdii() void GPUTPCCreateOccupancyMap::Thread<1>(int nBlocks, int nThreads, int iBlock, int iThread, GPUsharedref() GPUSharedMemory& smem, processorType& GPUrestrict() processors, GPUTPCClusterOccupancyMapBin* GPUrestrict() map) | ||
{ | ||
GPUParam& GPUrestrict() param = processors.param; | ||
const int iSliceRow = iBlock * nThreads + iThread; | ||
if (iSliceRow > GPUCA_ROW_COUNT * GPUCA_NSLICES) { | ||
return; | ||
} | ||
const unsigned int iSlice = iSliceRow / GPUCA_ROW_COUNT; | ||
const unsigned int iRow = iSliceRow % GPUCA_ROW_COUNT; | ||
const unsigned int nBins = GPUTPCClusterOccupancyMapBin::getNBins(param); | ||
const unsigned int nFoldBins = CAMath::Min(5u, nBins); | ||
unsigned int sum = 0; | ||
for (unsigned int i = 0; i < nFoldBins; i++) { | ||
sum += map[i].bin[iSlice][iRow]; | ||
} | ||
unsigned short lastVal; | ||
for (unsigned int i = 0; i < nBins; i++) { | ||
lastVal = map[i].bin[iSlice][iRow]; | ||
map[i].bin[iSlice][iRow] = sum / nFoldBins; | ||
sum += map[CAMath::Min(i + nFoldBins, nBins - 1)].bin[iSlice][iRow] - lastVal; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
// All rights not expressly granted are reserved. | ||
// | ||
// This software is distributed under the terms of the GNU General Public | ||
// License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
// | ||
// In applying this license CERN does not waive the privileges and immunities | ||
// granted to it by virtue of its status as an Intergovernmental Organization | ||
// or submit itself to any jurisdiction. | ||
|
||
/// \file GPUTPCCreateOccupancyMap.h | ||
/// \author David Rohr | ||
|
||
#ifndef GPUTPCCREATEOCCUPANCYMAP_H | ||
#define GPUTPCCREATEOCCUPANCYMAP_H | ||
|
||
#include "GPUTPCDef.h" | ||
#include "GPUGeneralKernels.h" | ||
#include "GPUConstantMem.h" | ||
|
||
namespace GPUCA_NAMESPACE::gpu | ||
{ | ||
struct GPUTPCClusterOccupancyMapBin; | ||
|
||
class GPUTPCCreateOccupancyMap : public GPUKernelTemplate | ||
{ | ||
public: | ||
enum K { defaultKernel = 0, | ||
fill = 0, | ||
fold = 1 }; | ||
GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCSliceTracking; } | ||
template <int iKernel = defaultKernel> | ||
GPUd() static void Thread(int nBlocks, int nThreads, int iBlock, int iThread, GPUsharedref() GPUSharedMemory& smem, processorType& processors, GPUTPCClusterOccupancyMapBin* map); | ||
}; | ||
|
||
} // namespace GPUCA_NAMESPACE::gpu | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.