Tpetra parallel linear algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
Tpetra::Details::Spaces::InstanceLifetimeManager< ExecSpace > Class Template Reference

Provides reusable Kokkos execution space instances. More...

#include <Tpetra_Details_ExecutionSpaces.hpp>

Public Member Functions

template<Priority priority = Priority::medium>
rcp_type space_instance (int i=0)
 Retrieve a strong Teuchos::RCP<const ExecSpace> to instance i More...
 
 ~InstanceLifetimeManager ()
 Issue a warning if any Tpetra-managed execution space instances survive to the end of static lifetime. More...
 

Detailed Description

template<typename ExecSpace>
class Tpetra::Details::Spaces::InstanceLifetimeManager< ExecSpace >

Provides reusable Kokkos execution space instances.

Template Parameters
ExecSpacethe type of Kokkos execution space to manage

Holds a weak RCP to exec space instances, but provides strong RCPs to callers. Callers in Tpetra can use this to quickly get an execution space instance on-demand.

When all strong RCP holders go away, the referenced instance will also go away. This prevents the spaces from living longer than Kokkos.

Definition at line 207 of file Tpetra_Details_ExecutionSpaces.hpp.

Constructor & Destructor Documentation

template<typename ExecSpace >
Tpetra::Details::Spaces::InstanceLifetimeManager< ExecSpace >::~InstanceLifetimeManager ( )
inline

Issue a warning if any Tpetra-managed execution space instances survive to the end of static lifetime.

Definition at line 272 of file Tpetra_Details_ExecutionSpaces.hpp.

Member Function Documentation

template<typename ExecSpace >
template<Priority priority = Priority::medium>
rcp_type Tpetra::Details::Spaces::InstanceLifetimeManager< ExecSpace >::space_instance ( int  i = 0)
inline

Retrieve a strong Teuchos::RCP<const ExecSpace> to instance i

Template Parameters
prioritythe Spaces::Details::Priority of the provided instance
Parameters
iWhich execution space instance to provide (default = Tpetra::Details::Spaces::Priority::medium)

Definition at line 219 of file Tpetra_Details_ExecutionSpaces.hpp.


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