|
ATLAS Offline Software
|
Go to the documentation of this file.
16 #include "boost/chrono/chrono.hpp"
17 #include "boost/chrono/thread_clock.hpp"
28 declareInterface<CaloClusterGPUProcessor> (
this);
40 auto get_option_from_string = [](
const std::string &
str,
bool & failed)
79 auto process_sampling = [&get_option_from_string](
const std::vector<std::string> & sampling_names, std::string & invalid_names, PackType & sampling_option)
82 for (
const std::string & samp_name : sampling_names)
85 const PackType sampling = (PackType) get_option_from_string(samp_name, failed);
89 if (invalid_names.size() == 0)
91 invalid_names =
"'" + samp_name +
"'";
95 invalid_names +=
", '" + samp_name +
"'";
100 sampling_option |= ((PackType) 1) << sampling;
105 std::string invalid_names;
109 if (invalid_names.size() > 0)
112 <<
" are not a valid Calorimeter sampling name and will be ignored! "
113 <<
"Valid names are: "
114 <<
"PreSamplerB, EMB1, EMB2, EMB3, "
115 <<
"PreSamplerE, EME1, EME2, EME3, "
116 <<
"HEC0, HEC1, HEC2, HEC3, "
117 <<
"TileBar0, TileBar1, TileBar2, "
118 <<
"TileGap1, TileGap2, TileGap3, "
119 <<
"TileExt0, TileExt1, TileExt2, "
120 <<
"FCAL0, FCAL1, FCAL2." );
123 invalid_names.clear();
127 if (invalid_names.size() > 0)
130 <<
" are not a valid Calorimeter sampling name and will be ignored! "
131 <<
"Valid names are: "
132 <<
"PreSamplerB, EMB1, EMB2, EMB3, "
133 <<
"PreSamplerE, EME1, EME2, EME3, "
134 <<
"HEC0, HEC1, HEC2, HEC3, "
135 <<
"TileBar0, TileBar1, TileBar2, "
136 <<
"TileGap1, TileGap2, TileGap3, "
137 <<
"TileExt0, TileExt1, TileExt2, "
138 <<
"FCAL0, FCAL1, FCAL2." );
141 auto get_neighbour_option_from_string = [](
const std::string &
str,
bool & failed)
175 bool neigh_failed =
false;
199 return StatusCode::SUCCESS;
207 return StatusCode::SUCCESS;
214 using clock_type = boost::chrono::thread_clock;
215 auto time_cast = [](
const auto & before,
const auto & after)
217 return boost::chrono::duration_cast<boost::chrono::microseconds>(after - before).count();
248 time_cast(
start, preprocessing_end),
249 time_cast(preprocessing_end, after_neighs),
250 time_cast(after_neighs, after_maxima),
251 time_cast(after_maxima, after_secondary_maxima),
252 time_cast(after_secondary_maxima, after_growing),
253 time_cast(after_growing,
end)
257 return StatusCode::SUCCESS;
267 print_times(
"Preprocessing Fill_List_of_Intra-Cluster_Neighbours Find_Local_Maxima Find_Secondary_Maxima Splitter_Tag_Propagation Cell_Weighting_And_Finalization", 6);
269 return StatusCode::SUCCESS;
virtual StatusCode finalize() override
void sendToGPU(const bool clear_CPU=false)
Gaudi::Property< std::string > m_neighborOptionString
type of neighbor relations to use.
virtual StatusCode initialize_non_CUDA() override
Initialization that does not invoke CUDA functions.
Gaudi::Property< std::vector< std::string > > m_secondarySamplingNames
vector of names of the secondary calorimeter samplings to consider.
void splitClusterGrowing(CaloRecGPU::EventDataHolder &holder, const CaloRecGPU::ConstantDataHolder &instance_data, const TASOptionsHolder &options, const IGPUKernelSizeOptimizer &optimizer, const bool synchronize=false, CaloRecGPU::CUDA_Helpers::CUDAStreamPtrHolder stream_to_use={})
CaloRecGPU::Helpers::CPU_object< TopoAutomatonSplittingOptions > m_options
Gaudi::Property< std::vector< std::string > > m_samplingNames
vector of names of the calorimeter samplings to consider for seeds.
Base class to provide some basic common infrastructure for timing measurements...
virtual StatusCode initialize_CUDA() override
Initialization that invokes CUDA functions.
#define CRGPU_CHEAP_STRING_TO_ENUM(VAR, PREFIX, ONE,...)
Checks a string variable, VAR, for matching enum identifiers (ONE and the remaining variadic argument...
Gaudi::Property< bool > m_restrictHECIWandFCalNeighbors
if set to true limit the neighbors in HEC IW and FCal2&3.
TASplitting::TASOptionsHolder m_options
Options for the algorithm, held in a GPU-friendly way.
#define CRGPU_RECURSIVE_MACRO(...)
Expands recursive macros.
::StatusCode StatusCode
StatusCode definition for legacy code.
void print_times(const std::string &header, const size_t time_size) const
ServiceHandle< IGPUKernelSizeOptimizerSvc > m_kernelSizeOptimizer
Handle to the CUDA kernel block and grid size optimization service.
void cellWeightingAndFinalization(CaloRecGPU::EventDataHolder &holder, const CaloRecGPU::ConstantDataHolder &instance_data, const TASOptionsHolder &options, const IGPUKernelSizeOptimizer &optimizer, const bool synchronize=false, CaloRecGPU::CUDA_Helpers::CUDAStreamPtrHolder stream_to_use={})
void excludeSecondaryMaxima(CaloRecGPU::EventDataHolder &holder, const CaloRecGPU::ConstantDataHolder &instance_data, const TASOptionsHolder &options, const IGPUKernelSizeOptimizer &optimizer, const bool synchronize=false, CaloRecGPU::CUDA_Helpers::CUDAStreamPtrHolder stream_to_use={})
Gaudi::Property< bool > m_shareBorderCells
share cells at the border between two local maxima
Gaudi::Property< float > m_emShowerScale
typical EM shower scale to use for distance criteria in shared cells
Gaudi::Property< bool > m_restrictPSNeighbors
if set to true limit the neighbors in presampler Barrel and Endcap.
virtual StatusCode execute(const EventContext &ctx, const CaloRecGPU::ConstantDataHolder &constant_data, CaloRecGPU::EventDataHolder &event_data, void *temporary_buffer) const override
Process the clusters on GPU.
static constexpr unsigned int getNumberOfSamplings()
Get number of available samplings.
void record_times(const size_t event_num, const std::vector< size_t > ×) const
void findLocalMaxima(CaloRecGPU::EventDataHolder &holder, const CaloRecGPU::ConstantDataHolder &instance_data, const TASOptionsHolder &options, const IGPUKernelSizeOptimizer &optimizer, const bool synchronize=false, CaloRecGPU::CUDA_Helpers::CUDAStreamPtrHolder stream_to_use={})
Gaudi::Property< bool > m_measureTimes
If true, times are recorded to the file given by m_timeFileName.
Gaudi::Property< bool > m_absOpt
if set to true, splitter only looks at absolute value of Energy in order to identify potential seed c...
void register_kernels(IGPUKernelSizeOptimizer &optimizer)
Gaudi::Property< float > m_minEnergy
local maxima need at least this energy content
Gaudi::Property< int > m_nCells
local maxima need at least this number of neighbors to become seeds
void fillNeighbours(CaloRecGPU::EventDataHolder &holder, const CaloRecGPU::ConstantDataHolder &instance_data, const TASOptionsHolder &options, const IGPUKernelSizeOptimizer &optimizer, const bool synchronize=false, CaloRecGPU::CUDA_Helpers::CUDAStreamPtrHolder stream_to_use={})
Gaudi::Property< bool > m_treatL1PredictedCellsAsGood
if set to true treat cells with a dead OTX which can be predicted by L1 trigger info as good instead ...
TopoAutomatonSplitting(const std::string &type, const std::string &name, const IInterface *parent)