ATLAS Offline Software
Loading...
Searching...
No Matches
AthExHIP/src/LinearTransformExampleAlg.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2//
3// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
4//
5#ifndef ATHEXHIP_LINEARTRANSFORMEXAMPLEALG_H
6#define ATHEXHIP_LINEARTRANSFORMEXAMPLEALG_H
7
8// Framework include(s).
10#include "Gaudi/Property.h"
11
12#include "DeviceStateHandler.h"
13
14namespace AthHIPExamples {
15
24
25 public:
27 using AthReentrantAlgorithm::AthReentrantAlgorithm;
28
31
33 virtual StatusCode execute( const EventContext& ctx ) const override;
34
36
40 //virtual StatusCode initialize_global() override;
41 virtual StatusCode initialize_worker() override;
43
44 private:
46 Gaudi::Property< int > m_hipDevice{ this, "HIPDevice", 0,
47 "The HIP device to use with the algorithm" };
48
50 Gaudi::Property< unsigned int > m_arraySize{ this, "ArraySize", 10000,
51 "Size of the float array to perform a linear transformation on" };
52
54 Gaudi::Property< float > m_multiplier{ this, "Multiplier", 1.23f,
55 "Multiplier used in the example linear transformation" };
56
57 Gaudi::Property< float > m_shift{ this, "Shift", 2.34f,
58 "Shift used in the example linear transformation" };
59
60 }; // class LinearTransformExampleAlg
61
62} // namespace AthHIPExamples
63
64#endif // ATHEXHIP_LINEARTRANSFORMEXAMPLEALG_H
Base class to provide common infrastructure for handling multiprocess state transitions for GPU.
Example algorithm running a very simple operation using HIP.
Gaudi::Property< int > m_hipDevice
The HIP device (ID) to use.
Gaudi::Property< float > m_multiplier
The multiplier of the linear transformation.
virtual StatusCode initialize_worker() override
Initialization per process.
Gaudi::Property< unsigned int > m_arraySize
Size of the dummy array to use.
Gaudi::Property< float > m_shift
Shift used in the linear transformation.
virtual StatusCode execute(const EventContext &ctx) const override
The function executing this algorithm.
An algorithm that can be simultaneously executed in multiple threads.