The Gaudi Framework
master (750c24bb)
Toggle main menu visibility
Loading...
Searching...
No Matches
GPUCruncher.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2026 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#pragma once
12
13
#include <
Gaudi/AsynchronousAlgorithm.h
>
14
#include <
GaudiKernel/DataObjectHandle.h
>
15
#include <
GaudiKernel/IRndmGenSvc.h
>
16
#include <
GaudiKernel/RegistryEntry.h
>
17
#include <
GaudiKernel/RndmGenerators.h
>
18
#include <tbb/concurrent_hash_map.h>
19
20
//------------------------------------------------------------------------------
21
26
class
GPUCruncher
:
public
Gaudi::AsynchronousAlgorithm
{
27
28
public
:
29
bool
isClonable
()
const override
{
return
true
; }
30
32
StatusCode
execute
(
const
EventContext
& ctx )
const override
;
34
StatusCode
initialize
()
override
;
36
StatusCode
finalize
()
override
;
37
38
GPUCruncher
(
const
std::string&
name
,
// the algorithm instance name
39
ISvcLocator
* pSvc );
// the Service Locator
40
42
virtual
~GPUCruncher
();
// virtual & protected destructor
43
44
private
:
46
GPUCruncher
();
// no default constructor
48
GPUCruncher
(
const
GPUCruncher
& );
// no copy constructor
50
GPUCruncher
&
operator=
(
const
GPUCruncher
& );
// no assignment
52
StatusCode
gpuExecute
(
const
std::vector<double>& in, std::vector<double>& out )
const
;
53
54
Gaudi::Property<std::vector<std::string>
>
m_inpKeys
{
this
,
"inpKeys"
, {},
""
};
55
Gaudi::Property<std::vector<std::string>
>
m_outKeys
{
this
,
"outKeys"
, {},
""
};
56
57
Gaudi::Property<double>
m_avg_runtime
{
this
,
"avgRuntime"
, 1.,
"Average runtime of the module."
};
58
Gaudi::Property<double>
m_var_runtime
{
this
,
"varRuntime"
, 0.01,
"Variance of the runtime of the module."
};
59
60
std::vector<DataObjectHandle<DataObject>*>
m_inputHandles
;
61
std::vector<DataObjectHandle<DataObject>*>
m_outputHandles
;
62
63
using
CHM
= tbb::concurrent_hash_map<std::string, unsigned int>;
64
static
CHM
m_name_ncopies_map
;
65
};
AsynchronousAlgorithm.h
DataObjectHandle.h
IRndmGenSvc.h
RegistryEntry.h
RndmGenerators.h
EventContext
This class represents an entry point to all the event specific data.
Definition
EventContext.h:35
GPUCruncher::isClonable
bool isClonable() const override
Definition
GPUCruncher.h:29
GPUCruncher::GPUCruncher
GPUCruncher()
the default constructor is disabled
GPUCruncher::finalize
StatusCode finalize() override
the finalization of the algorithm
Definition
GPUCruncher.cpp:197
GPUCruncher::gpuExecute
StatusCode gpuExecute(const std::vector< double > &in, std::vector< double > &out) const
The GPU intensive function.
GPUCruncher::GPUCruncher
GPUCruncher(const GPUCruncher &)
the copy constructor is disabled
GPUCruncher::m_inputHandles
std::vector< DataObjectHandle< DataObject > * > m_inputHandles
Definition
GPUCruncher.h:60
GPUCruncher::m_name_ncopies_map
static CHM m_name_ncopies_map
Definition
GPUCruncher.h:64
GPUCruncher::GPUCruncher
GPUCruncher(const std::string &name, ISvcLocator *pSvc)
Definition
GPUCruncher.cpp:32
GPUCruncher::m_var_runtime
Gaudi::Property< double > m_var_runtime
Definition
GPUCruncher.h:58
GPUCruncher::m_avg_runtime
Gaudi::Property< double > m_avg_runtime
Definition
GPUCruncher.h:57
GPUCruncher::operator=
GPUCruncher & operator=(const GPUCruncher &)
the assignment operator is disabled
GPUCruncher::CHM
tbb::concurrent_hash_map< std::string, unsigned int > CHM
Definition
GPUCruncher.h:63
GPUCruncher::~GPUCruncher
virtual ~GPUCruncher()
virtual & protected destructor
Definition
GPUCruncher.cpp:43
GPUCruncher::execute
StatusCode execute(const EventContext &ctx) const override
the execution of the algorithm
Definition
GPUCruncher.cpp:80
GPUCruncher::m_inpKeys
Gaudi::Property< std::vector< std::string > > m_inpKeys
Definition
GPUCruncher.h:54
GPUCruncher::m_outputHandles
std::vector< DataObjectHandle< DataObject > * > m_outputHandles
Definition
GPUCruncher.h:61
GPUCruncher::initialize
StatusCode initialize() override
Its initialization.
Definition
GPUCruncher.cpp:49
GPUCruncher::m_outKeys
Gaudi::Property< std::vector< std::string > > m_outKeys
Definition
GPUCruncher.h:55
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition
Algorithm.cpp:518
Gaudi::AsynchronousAlgorithm
Base class for asynchronous algorithms.
Definition
AsynchronousAlgorithm.h:33
Gaudi::Property
Implementation of property with value of concrete type.
Definition
Property.h:35
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition
ISvcLocator.h:42
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
GaudiCUDA
src
GPUCruncher.h
Generated on
for The Gaudi Framework by
1.17.0