ATLAS Offline Software
Loading...
Searching...
No Matches
StreamHolder.cxx
Go to the documentation of this file.
1//
2// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3//
4
5// Local include(s).
8
9namespace AthCUDA {
10
12 : m_stream( nullptr ), m_pool( nullptr ) {
13
14 }
15
17 : m_stream( stream ), m_pool( pool ) {
18
19 }
20
22 : m_stream( parent.m_stream ), m_pool( parent.m_pool ) {
23
24 parent.m_stream = nullptr;
25 parent.m_pool = nullptr;
26 }
27
29
30 if( ( m_stream != nullptr ) && ( m_pool != nullptr ) ) {
31 m_pool->yieldStream( *this );
32 }
33 }
34
36
37 // Check if anything needs to be done.
38 if( this == &rhs ) {
39 return *this;
40 }
41
42 // Perform the move.
43 m_stream = rhs.m_stream;
44 rhs.m_stream = nullptr;
45 m_pool = rhs.m_pool;
46 rhs.m_pool = nullptr;
47 return *this;
48 }
49
50 StreamHolder::operator bool() const {
51
52 return ( m_stream != nullptr );
53 }
54
55} // namespace AthCUDA
Interface for a CUDA stream pool service.
StreamHolder & operator=(const StreamHolder &)=delete
Copy assignment operator.
IStreamPoolSvc * m_pool
The pool that this holder is attached to.
void * m_stream
The managed stream.
~StreamHolder()
Destructor.
StreamHolder()
Friend declaration(s).
Definition Info.h:14
pool namespace
Definition libname.h:15