|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #ifndef CALORECGPU_CALOGPUHYBRIDCLUSTERPROCESSOR_H
8 #define CALORECGPU_CALOGPUHYBRIDCLUSTERPROCESSOR_H
12 #include "GaudiKernel/ToolHandle.h"
77 ToolHandle<ICaloClusterGPUConstantTransformer>
m_transformConstantData{
this,
"ConstantDataToGPUTool",
"",
"Tool for transforming the constant data and sending it to the GPU"};
83 ToolHandleArray<CaloClusterCollectionProcessor>
m_preGPUoperations{
this,
"BeforeGPUTools", {},
"Tools to be applied to the clusters on the CPU before processing them on the GPU"};
90 ToolHandle<ICaloClusterGPUInputTransformer>
m_transformForGPU{
this,
"EventDataToGPUTool",
"",
"Tool for transforming the event data and sending it to the GPU"};
96 ToolHandleArray<CaloClusterGPUProcessor>
m_GPUoperations{
this,
"GPUTools", {},
"Tools to be applied to the clusters on the GPU"};
102 ToolHandle<ICaloClusterGPUOutputTransformer>
m_transformBackToCPU{
this,
"GPUToEventDataTool", {},
"Tool for getting the data from the GPU back to the CPU Athena data structures"};
108 ToolHandleArray<CaloClusterCollectionProcessor>
m_postGPUoperations{
this,
"AfterGPUTools", {},
"Tools to be applied to the clusters on the CPU after returning from the GPU"};
114 Gaudi::Property<bool>
m_doPlots{
this,
"DoPlots",
false,
"Do plots based on the plotter tool optionally provided."};
120 ToolHandle<ICaloClusterGPUPlotter>
m_plotterTool{
this,
"PlotterTool",
"",
"An optional plotter, for testing and/or debugging purposes"};
125 Gaudi::Property<bool>
m_doMonitoring{
this,
"DoMonitoring",
false,
"Do monitoring."};
126 Gaudi::Property<bool>
m_monitorCells{
this,
"MonitorCells",
false,
"Whether to monitor cells too."};
127 Gaudi::Property<float>
m_monitoring1thr {
this,
"Thr1", 2,
"First Threshold to pass for cell monitoring" };
128 Gaudi::Property<float>
m_monitoring2thr {
this,
"Thr2", 4,
"Second Threshold to pass for cell monitoring" };
136 ToolHandle<GenericMonitoringTool>
m_moniTool {
this,
"MonitoringTool",
"",
"Monitoring tool" };
143 Gaudi::Property<bool>
m_writeTriggerSpecificInfo{
this,
"WriteTriggerSpecificInfo",
false,
"Write some trigger-specific decorations and use the trigger auxiliary container."};
154 Gaudi::Property<size_t>
m_numPreAllocatedGPUData{
this,
"NumPreAllocatedDataHolders", 0,
"Number of event data holders to pre-allocate on GPU memory"};
173 Gaudi::Property<bool>
m_deferConstantDataToFirstEvent {
this,
"DeferConstantDataPreparationToFirstEvent",
true,
"Convert and send event data on first event instead of during initialize (needed for exporting geometry and noise properly)?"};
178 Gaudi::Property<bool>
m_skipConversions {
this,
"SkipConversions",
false,
"If true, skip converting CPU to GPU data (useful if only instanting CPU tools)"};
213 other.m_ptr =
nullptr;
225 if (
m_ptr !=
nullptr)
280 #endif //CALORECGPU_CALOGPUHYBRIDCLUSTERPROCESSOR_H
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
ToolHandle< ICaloClusterGPUOutputTransformer > m_transformBackToCPU
The tool that will convert the data from the GPU back to the CPU.
Gaudi::Property< bool > m_skipConversions
If true, both constant and event data conversion is skipped.
virtual StatusCode finalize() override
void allocate(const size_t size)
CaloRecGPU::Helpers::separate_thread_holder< simple_GPU_pointer_holder > m_temporariesThreadedHolder ATLAS_THREAD_SAFE
A way to reduce allocations over multiple threads by keeping a cache of previously allocated objects ...
size_t m_temporariesSize
The size of the temporary buffer to allocate for the GPU tools that will be called.
Gaudi::Property< bool > m_doMonitoring
If true, uses the monitoring tool specified by m_monitorTool.
SG::ReadDecorHandleKey< xAOD::EventInfo > m_avgMuKey
Event input: To get <mu> from Event Info.
Gaudi::Property< bool > m_writeTriggerSpecificInfo
If true, writes some trigger-specific decorations.
ToolHandle< ICaloClusterGPUPlotter > m_plotterTool
An optional plotter, for testing and/or debugging purposes.
simple_GPU_pointer_holder(simple_GPU_pointer_holder &&other)
ToolHandleArray< CaloClusterGPUProcessor > m_GPUoperations
Tools to be applied to the clusters on the GPU.
virtual StatusCode execute(const EventContext &ctx) const override
~simple_GPU_pointer_holder()
virtual StatusCode initialize_CUDA() override
Initialization that invokes CUDA functions.
Base class to provide some basic common infrastructure for timing measurements...
Gaudi::Property< float > m_monitoring1thr
CaloGPUHybridClusterProcessor(const std::string &name, ISvcLocator *pSvcLocator)
An algorithm that can be simultaneously executed in multiple threads.
void deallocate(void *address)
Deallocates address in GPU memory.
Gaudi::Property< bool > m_doPlots
If true, calls the plotter specified by m_plotterTool at every tool execution.
virtual StatusCode initialize_non_CUDA() override
Initialization that does not invoke CUDA functions.
virtual StatusCode initialize()
Gaudi::Property< float > m_monitoring2thr
SG::ReadCondHandleKey< CaloNoise > m_noiseCDOKey
ToolHandle< GenericMonitoringTool > m_moniTool
Monitoring tool.
simple_GPU_pointer_holder()
CaloRecGPU::Helpers::separate_thread_holder< CaloRecGPU::EventDataHolder > m_eventDataThreadedHolder ATLAS_THREAD_SAFE
A way to reduce allocations over multiple threads by keeping a cache of previously allocated objects ...
std::mutex m_mutex
This mutex is locked when sending the constant data on the first event to ensure thread safety.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
CaloRecGPU::ConstantDataHolder m_constantData ATLAS_THREAD_SAFE
Constant data, common for all events and persisted throughout the run.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Property< bool > m_deferConstantDataToFirstEvent
If true, the constant data is only converted and sent to the GPU on the first event,...
Gaudi::Property< bool > m_monitorCells
Base class to provide some basic common infrastructure for initializing CUDA only at the right place ...
simple_GPU_pointer_holder & operator=(const simple_GPU_pointer_holder &)=delete
Algorithm to reconstruct CaloCluster objects with GPU acceleration, providing interoperability for ca...
virtual StatusCode initialize() override
std::atomic< bool > m_constantDataSent
A flag to signal that the constant data has been adequately sent to the GPU.
SG::WriteHandleKey< CaloClusterCellLinkContainer > m_clusterCellLinkOutput
The name of the key in StoreGate for the output CaloClusterCellLinkContainer.
void * allocate(const size_t num)
Allocates and returns the address of num bytes from GPU memory.
simple_GPU_pointer_holder(const simple_GPU_pointer_holder &)=delete
SG::ReadHandleKey< CaloCellContainer > m_cellsKey
vector of names of the cell containers to use as input.
Base class for cluster processing tools called from CaloClusterMaker.
ToolHandleArray< CaloClusterCollectionProcessor > m_postGPUoperations
Tools to be applied to the clusters after returning from the GPU.
SG::WriteDecorHandleKey< xAOD::CaloClusterContainer > m_mDecor_ncells
Key to the handle for writing the number of cells as a decoration.
A simple RAII wrapper to ensure proper allocation and deallocation of GPU memory in a void * for the ...
virtual ~CaloGPUHybridClusterProcessor() override=default
Handle class for reading a decoration on an object.
Gaudi::Property< size_t > m_numPreAllocatedGPUData
Number of events for which to pre-allocate space on GPU memory (should ideally be set to the expected...
ToolHandleArray< CaloClusterCollectionProcessor > m_preGPUoperations
Tools to be applied to the clusters before being sent to the GPU for processing.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Define macros for attributes used to control the static checker.
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_clusterOutput
The name of the key in StoreGate for the output CaloClusterContainer.
ToolHandle< ICaloClusterGPUConstantTransformer > m_transformConstantData
The tool that will convert the constant data from the CPU to the GPU.
ToolHandle< ICaloClusterGPUInputTransformer > m_transformForGPU
The tool that will actually convert the data from the CPU to the GPU.