ATLAS Offline Software
|
Interface for a CUDA stream pool service. More...
#include <IStreamPoolSvc.h>
Public Member Functions | |
DeclareInterfaceID (AthCUDA::IStreamPoolSvc, 1, 0) | |
Declare the interface ID. More... | |
virtual bool | isEmpty () const =0 |
Check whether any streams are available for the job. More... | |
virtual StreamHolder | getAvailableStream ()=0 |
Get a stream from the pool. More... | |
Protected Member Functions | |
virtual void | yieldStream (StreamHolder &stream)=0 |
Put a given stream back into the pool. More... | |
Friends | |
class | StreamHolder |
Make StreamHolder a friend of this interface. More... | |
Interface for a CUDA stream pool service.
Streams are provided to the entire job through this interface, allowing the code to balance memory copies and computations across all its configured streams.
Definition at line 24 of file IStreamPoolSvc.h.
AthCUDA::IStreamPoolSvc::DeclareInterfaceID | ( | AthCUDA::IStreamPoolSvc | , |
1 | , | ||
0 | |||
) |
Declare the interface ID.
|
pure virtual |
Get a stream from the pool.
Note that the returned holder may point to a null memory address, in case no streams are available at the moment of the call.
|
pure virtual |
Check whether any streams are available for the job.
This is a thread-safe way to check whether any CUDA streams are available at runtime.
true
if the service will under no circumstances return a valid stream, false
if it might
|
protectedpure virtual |
Put a given stream back into the pool.
This is a function called by AthCUDA::StreamHolder
behind the scenes when it goes out of scope. It should not be called by hand.
stream | The stream holder whose stream is to be put back into the pool |
|
friend |
Make StreamHolder a friend of this interface.
Definition at line 27 of file IStreamPoolSvc.h.