ATLAS Offline Software
Loading...
Searching...
No Matches
StreamPoolSvc.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 ATHCUDASERVICES_STREAMPOOLSVC_H
6#define ATHCUDASERVICES_STREAMPOOLSVC_H
7
8// Local include(s).
9#include "StreamPoolSvcImpl.h"
10
11// AthCUDA include(s).
13
14// Framework include(s).
15#include "Gaudi/Property.h"
17
18// System include(s).
19#include <memory>
20
21namespace AthCUDA {
22
31 class StreamPoolSvc : public extends< AthService, IStreamPoolSvc > {
32
33 public:
35 using extends::extends;
36
39
41 virtual StatusCode initialize() override;
42
44 virtual StatusCode finalize() override;
45
47
50
59 virtual bool isEmpty() const override;
60
68 virtual StreamHolder getAvailableStream() override;
69
77 virtual void yieldStream( StreamHolder& stream ) override;
78
80
81 private:
84
86 Gaudi::Property< unsigned int > m_nStreams{ this, "NStreams", 2,
87 "The number of CUDA streams to use" };
88
90
93
95 std::unique_ptr< StreamPoolSvcImpl > m_impl;
96
98
99 }; // class StreamPoolSvc
100
101} // namespace AthCUDA
102
103#endif // ATHCUDASERVICES_STREAMPOOLSVC_H
Helper class for handling CUDA streams.
Service managing a fixed number of CUDA streams for an application.
virtual StatusCode initialize() override
Initialise the service.
virtual StreamHolder getAvailableStream() override
Get a stream from the pool.
virtual void yieldStream(StreamHolder &stream) override
Put a given stream back into the pool.
virtual bool isEmpty() const override
Check whether any streams are available for the job.
Gaudi::Property< unsigned int > m_nStreams
The number of streams to use.
virtual StatusCode finalize() override
Finalise the service.
std::unique_ptr< StreamPoolSvcImpl > m_impl
The object implementing the interaction with CUDA.
Definition Info.h:14