Ginkgo  Generated from tags/v1.0.0^0 branch based on master. Ginkgo version 1.0.0
A numerical linear algebra library targeting many-core architectures
Public Types | Public Member Functions | List of all members
gko::temporary_clone< T > Class Template Reference

A temporary_clone is a special smart pointer-like object that is designed to hold an object temporarily copied to another executor. More...

#include <ginkgo/core/base/utils.hpp>

Public Types

using value_type = T
 
using pointer = T *
 

Public Member Functions

 temporary_clone (std::shared_ptr< const Executor > exec, pointer ptr)
 Creates a temporary_clone. More...
 
T * get () const
 Returns the object held by temporary_clone. More...
 
T * operator-> () const
 Calls a method on the underlying object. More...
 

Detailed Description

template<typename T>
class gko::temporary_clone< T >

A temporary_clone is a special smart pointer-like object that is designed to hold an object temporarily copied to another executor.

After the temporary_clone goes out of scope, the stored object will be copied back to its original location. This class is optimized to avoid copies if the object is already on the correct executor, in which case it will just hold a reference to that object, without performing the copy.

Template Parameters
Tthe type of object held in the temporary_clone

Constructor & Destructor Documentation

◆ temporary_clone()

template<typename T >
gko::temporary_clone< T >::temporary_clone ( std::shared_ptr< const Executor exec,
pointer  ptr 
)
inlineexplicit

Creates a temporary_clone.

Parameters
execthe executor where the clone will be created
ptra pointer to the object of which the clone will be created

References gko::clone().

Member Function Documentation

◆ get()

template<typename T >
T* gko::temporary_clone< T >::get ( ) const
inline

Returns the object held by temporary_clone.

Returns
the object held by temporary_clone

◆ operator->()

template<typename T >
T* gko::temporary_clone< T >::operator-> ( ) const
inline

Calls a method on the underlying object.

Returns
the underlying object

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