ATLAS Offline Software
Public Member Functions | Protected Member Functions | Friends | List of all members
AthCUDA::IStreamPoolSvc Class Referenceabstract

Interface for a CUDA stream pool service. More...

#include <IStreamPoolSvc.h>

Inheritance diagram for AthCUDA::IStreamPoolSvc:
Collaboration diagram for AthCUDA::IStreamPoolSvc:

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...
 

Detailed Description

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.

Author
Attila Krasznahorkay Attil.nosp@m.a.Kr.nosp@m.aszna.nosp@m.hork.nosp@m.ay@ce.nosp@m.rn.c.nosp@m.h

Definition at line 24 of file IStreamPoolSvc.h.

Member Function Documentation

◆ DeclareInterfaceID()

AthCUDA::IStreamPoolSvc::DeclareInterfaceID ( AthCUDA::IStreamPoolSvc  ,
,
 
)

Declare the interface ID.

◆ getAvailableStream()

virtual StreamHolder AthCUDA::IStreamPoolSvc::getAvailableStream ( )
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.

Returns
A stream holder describing a possibly abailable stream

◆ isEmpty()

virtual bool AthCUDA::IStreamPoolSvc::isEmpty ( ) const
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.

Returns
true if the service will under no circumstances return a valid stream, false if it might

◆ yieldStream()

virtual void AthCUDA::IStreamPoolSvc::yieldStream ( StreamHolder stream)
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.

Parameters
streamThe stream holder whose stream is to be put back into the pool

Friends And Related Function Documentation

◆ StreamHolder

friend class StreamHolder
friend

Make StreamHolder a friend of this interface.

Definition at line 27 of file IStreamPoolSvc.h.


The documentation for this class was generated from the following file: