Opm::gpuistl::PointerView< T > Class Template Reference

A view towards a smart pointer to GPU-allocated memory. More...

#include <gpu_smart_pointer.hpp>

Public Member Functions

 PointerView (const PointerView &other)=default
 
 PointerView (const std::shared_ptr< T > &ptr)
 
template<class Deleter >
 PointerView (const std::unique_ptr< T, Deleter > &ptr)
 
 PointerView (T *ptr)
 
OPM_HOST_DEVICE T * get () const
 
OPM_HOST_DEVICE T & operator* () const
 
OPM_HOST_DEVICE T * operator-> () const
 

Detailed Description

template<class T>
class Opm::gpuistl::PointerView< T >

A view towards a smart pointer to GPU-allocated memory.

This will emulate a smart pointer to GPU-allocated memory, but without ownership semantics, and being compatible with the requirements of the GPU kernels. This is useful when we want to pass a smart pointer to a GPU kernel, but we do not want to transfer the ownership of the memory.

Constructor & Destructor Documentation

◆ PointerView() [1/4]

template<class T >
Opm::gpuistl::PointerView< T >::PointerView ( const PointerView< T > &  other)
default

◆ PointerView() [2/4]

template<class T >
Opm::gpuistl::PointerView< T >::PointerView ( const std::shared_ptr< T > &  ptr)
inline

◆ PointerView() [3/4]

template<class T >
template<class Deleter >
Opm::gpuistl::PointerView< T >::PointerView ( const std::unique_ptr< T, Deleter > &  ptr)
inline

◆ PointerView() [4/4]

template<class T >
Opm::gpuistl::PointerView< T >::PointerView ( T *  ptr)
inline

Member Function Documentation

◆ get()

template<class T >
OPM_HOST_DEVICE T * Opm::gpuistl::PointerView< T >::get ( ) const
inline

◆ operator*()

template<class T >
OPM_HOST_DEVICE T & Opm::gpuistl::PointerView< T >::operator* ( ) const
inline

◆ operator->()

template<class T >
OPM_HOST_DEVICE T * Opm::gpuistl::PointerView< T >::operator-> ( ) const
inline

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