AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::quest::TempArrayView< ExecSpace > Class Template Reference

Provides a view over an MFEM grid function. MFEM grid functions are assumed to live in host memory. This class performs data movement needed to access the grid function data within a GPU device lambda. This view is limited in scope, though could be expanded in the future. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/quest/IntersectionShaper.hpp>

Public Member Functions

AXOM_HOST TempArrayView (axom::Array< double > &gf, bool _needResult=true)
 Host constructor that accepts data in an Array. More...
 
AXOM_HOST TempArrayView (axom::ArrayView< double > &gf, bool _needResult=true)
 Host constructor that accepts data in an ArrayView. More...
 
AXOM_HOST_DEVICE TempArrayView (const TempArrayView &obj)
 Copy constructor, which is called to make a copy of the host object so it is accessible inside a RAJA kernel. Any data movement happened in the host constructor. This version sets hostData to nullptr so we know not to clean up in the destructor. More...
 
AXOM_HOST_DEVICE ~TempArrayView ()
 Destructor. On the host, this method may move data from the device and deallocate device storage. More...
 
AXOM_HOST_DEVICE double & operator[] (int i)
 Indexing operator for accessing the data. More...
 
AXOM_HOST_DEVICE double & operator[] (int i) const
 

Detailed Description

template<typename ExecSpace>
class axom::quest::TempArrayView< ExecSpace >

Provides a view over an MFEM grid function. MFEM grid functions are assumed to live in host memory. This class performs data movement needed to access the grid function data within a GPU device lambda. This view is limited in scope, though could be expanded in the future.

Template Parameters
ExecSpaceThe execution space where the grid function data will be accessed.

Constructor & Destructor Documentation

◆ TempArrayView() [1/3]

template<typename ExecSpace >
AXOM_HOST axom::quest::TempArrayView< ExecSpace >::TempArrayView ( axom::Array< double > &  gf,
bool  _needResult = true 
)
inline

Host constructor that accepts data in an Array.

Parameters
gfThe data that will be accessed/modified by this view.
_needResultWhether the data needs to be brought back to the host from the device.

References axom::Array< T, DIM, SPACE, StoragePolicy >::data(), and axom::Array< T, DIM, SPACE, StoragePolicy >::size().

◆ TempArrayView() [2/3]

template<typename ExecSpace >
AXOM_HOST axom::quest::TempArrayView< ExecSpace >::TempArrayView ( axom::ArrayView< double > &  gf,
bool  _needResult = true 
)
inline

Host constructor that accepts data in an ArrayView.

Parameters
gfThe data that will be accessed/modified by this view.
_needResultWhether the data needs to be brought back to the host from the device.

References axom::ArrayView< T, DIM, SPACE >::data(), and axom::ArrayView< T, DIM, SPACE >::size().

◆ TempArrayView() [3/3]

template<typename ExecSpace >
AXOM_HOST_DEVICE axom::quest::TempArrayView< ExecSpace >::TempArrayView ( const TempArrayView< ExecSpace > &  obj)
inline

Copy constructor, which is called to make a copy of the host object so it is accessible inside a RAJA kernel. Any data movement happened in the host constructor. This version sets hostData to nullptr so we know not to clean up in the destructor.

◆ ~TempArrayView()

template<typename ExecSpace >
AXOM_HOST_DEVICE axom::quest::TempArrayView< ExecSpace >::~TempArrayView ( )
inline

Destructor. On the host, this method may move data from the device and deallocate device storage.

Member Function Documentation

◆ operator[]() [1/2]

template<typename ExecSpace >
AXOM_HOST_DEVICE double& axom::quest::TempArrayView< ExecSpace >::operator[] ( int  i)
inline

Indexing operator for accessing the data.

Parameters
iThe index at which to access the data.
Returns
A reference to the data at index i.

◆ operator[]() [2/2]

template<typename ExecSpace >
AXOM_HOST_DEVICE double& axom::quest::TempArrayView< ExecSpace >::operator[] ( int  i) const
inline

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