VectorDual< T, MemorySpace > Class Template Reference
Inheritance diagram for VectorDual< T, MemorySpace >:

Public Types

using iterator = T *
 
using constIterator = const T *
 
using reference = T &
 
using constReference = const T &
 
using valueType = T
 
using pointer = T *
 
using constPointer = const T *
 
using VectorType = VectorDual< T, MemorySpace >
 
using dualViewType = Kokkos::DualView< T *, MemorySpace >
 
using hostMirrorSpace = typename dualViewType::host_mirror_space
 
using deviceViewType = typename dualViewType::t_dev
 
using hostViewType = typename dualViewType::t_host
 
using deviceType = typename deviceViewType::device_type
 
using hostType = typename hostViewType::device_type
 
using viewType = dualViewType
 
using memory_space = typename viewType::memory_space
 
using execution_space = typename deviceType::execution_space
 

Public Member Functions

 TypeInfoTemplateNV2 ("VectorDual", T, memoerySpaceName())
 
 VectorDual ()
 
 VectorDual (const word &name)
 
 VectorDual (size_t n)
 
 VectorDual (const word &name, size_t n)
 
 VectorDual (size_t n, const T &val)
 
 VectorDual (const word &name, size_t n, const T &val)
 
 VectorDual (size_t cap, size_t n, RESERVE)
 
 VectorDual (const word &name, size_t cap, size_t n, RESERVE)
 
 VectorDual (const Vector< T > &src)
 
 VectorDual (const word &name, const Vector< T > &src)
 
 VectorDual (const VectorDual &src)
 
 VectorDual (const word &name, const VectorDual &src)
 
VectorDualoperator= (const VectorDual &rhs)
 
 VectorDual (VectorDual &&)=delete
 
VectorDualoperator= (VectorDual &&)=delete
 
INLINE_FUNCTION_H uniquePtr< VectorDualclone () const
 
INLINE_FUNCTION_H VectorDualclonePtr () const
 
INLINE_FUNCTION_H VectorTypeVectorField ()
 
const INLINE_FUNCTION_H VectorTypeVectorField () const
 
INLINE_FUNCTION_H deviceViewTypedeviceVectorAll ()
 
const INLINE_FUNCTION_H deviceViewTypedeviceVectorAll () const
 
INLINE_FUNCTION_H hostViewTypehostVectorAll ()
 
const INLINE_FUNCTION_H hostViewTypehostVectorAll () const
 
INLINE_FUNCTION_H deviceViewTypedeviceVector ()
 
const INLINE_FUNCTION_H deviceViewTypedeviceVector () const
 
INLINE_FUNCTION_H hostViewTypehostVector ()
 
const INLINE_FUNCTION_H hostViewTypehostVector () const
 
INLINE_FUNCTION_H hostViewType hostVector (int32 start, int32 end) const
 
INLINE_FUNCTION_H deviceViewType deviceVector (int32 start, int32 end) const
 
const INLINE_FUNCTION_H word name () const
 
INLINE_FUNCTION_H size_t size () const
 
INLINE_FUNCTION_H size_t capacity () const
 
INLINE_FUNCTION_H bool empty () const
 
INLINE_FUNCTION_H void reserve (size_t cap)
 
INLINE_FUNCTION_H void resize (size_t n)
 
INLINE_FUNCTION_H void reallocate (size_t cap)
 
INLINE_FUNCTION_H void resizeSync (size_t n)
 
INLINE_FUNCTION_H void resize (size_t n, const T &val)
 
INLINE_FUNCTION_H void resizeSync (size_t n, const T &val)
 
INLINE_FUNCTION_H void clear ()
 
INLINE_FUNCTION_H void fill (const T &val)
 
INLINE_FUNCTION_H void fillHost (const T &val)
 
INLINE_FUNCTION_H void fillDevice (const T &val)
 
FUNCTION_H void assign (size_t n, const T &val)
 
FUNCTION_H void assign (const Vector< T > &src)
 
bool deleteElement (const Vector< label > &indices)
 
INLINE_FUNCTION_H bool insertSetElement (const int32IndexContainer &indices, const T &val)
 
template<typename side = HostSide>
INLINE_FUNCTION_H bool insertSetElement (const int32IndexContainer &indices, const Vector< T > &vals)
 
template<typename side = HostSide>
INLINE_FUNCTION_H bool insertSetElement (const Vector< int32 > &indices, const T &val)
 
template<typename side = HostSide>
INLINE_FUNCTION_H bool insertSetElement (const Vector< int32 > &indices, const Vector< T > &vals)
 
void push_back (const T &val)
 
INLINE_FUNCTION_H pointer data ()
 
INLINE_FUNCTION_H constPointer data () const
 
INLINE_FUNCTION_H iterator begin ()
 
INLINE_FUNCTION_H constIterator begin () const
 
INLINE_FUNCTION_H iterator end ()
 
INLINE_FUNCTION_H constIterator end () const
 
INLINE_FUNCTION_H reference operator[] (label i)
 
INLINE_FUNCTION_H constReference operator[] (label i) const
 
INLINE_FUNCTION_H void modifyOnHost ()
 
INLINE_FUNCTION_H void modifyOnDevice ()
 
INLINE_FUNCTION_H bool hostRequiresSync () const
 
INLINE_FUNCTION_H bool deviceRequiresSync () const
 
INLINE_FUNCTION_H bool areViewsSimilar () const
 
INLINE_FUNCTION_H void copyHostToDevice ()
 
INLINE_FUNCTION_H void copyHostToDevice (int32 start, int32 end, bool setUpdated=true)
 
INLINE_FUNCTION_H void copyDeviceToHost ()
 
INLINE_FUNCTION_H void copyDeviceToHost (int32 start, int32 end, bool setUpdated=true)
 
INLINE_FUNCTION_H void syncToHost ()
 
INLINE_FUNCTION_H void syncToDevice ()
 
INLINE_FUNCTION_H void syncViews ()
 
INLINE_FUNCTION_H void syncViews (int32 start, int32 end)
 
FUNCTION_H bool read (iIstream &is)
 
FUNCTION_H bool write (iOstream &os) const
 

Protected Member Functions

INLINE_FUNCTION_H void changeSize (size_t n, bool actualCap=false)
 
INLINE_FUNCTION_H void setSize (size_t n)
 
INLINE_FUNCTION_H void updateSubViews () const
 

Static Protected Member Functions

constexpr static const char * memoerySpaceName ()
 
static INLINE_FUNCTION_H size_t evalCapacity (size_t n)
 

Protected Attributes

size_t size_ = 0
 
size_t capacity_ = 0
 
dualViewType dualView_
 
deviceViewType deviceSubView_
 
hostViewType hostSubView_
 
bool subViewsUpdated_ = false
 

Static Protected Attributes

static const real growthFactor_ = vectorGrowthFactor__
 
static constexpr bool isHostAccessible_
 
static const word hdName__
 

Detailed Description

template<typename T, typename MemorySpace = void>
class pFlow::VectorDual< T, MemorySpace >

Definition at line 43 of file VectorDual.hpp.

Member Typedef Documentation

◆ iterator

using iterator = T*

Definition at line 51 of file VectorDual.hpp.

◆ constIterator

using constIterator = const T*

Definition at line 53 of file VectorDual.hpp.

◆ reference

using reference = T&

Definition at line 55 of file VectorDual.hpp.

◆ constReference

using constReference = const T&

Definition at line 57 of file VectorDual.hpp.

◆ valueType

using valueType = T

Definition at line 59 of file VectorDual.hpp.

◆ pointer

using pointer = T*

Definition at line 61 of file VectorDual.hpp.

◆ constPointer

using constPointer = const T*

Definition at line 63 of file VectorDual.hpp.

◆ VectorType

using VectorType = VectorDual<T, MemorySpace>

Definition at line 65 of file VectorDual.hpp.

◆ dualViewType

using dualViewType = Kokkos::DualView<T*, MemorySpace>

Definition at line 68 of file VectorDual.hpp.

◆ hostMirrorSpace

using hostMirrorSpace = typename dualViewType::host_mirror_space

Definition at line 71 of file VectorDual.hpp.

◆ deviceViewType

using deviceViewType = typename dualViewType::t_dev

Definition at line 74 of file VectorDual.hpp.

◆ hostViewType

using hostViewType = typename dualViewType::t_host

Definition at line 77 of file VectorDual.hpp.

◆ deviceType

using deviceType = typename deviceViewType::device_type

Definition at line 79 of file VectorDual.hpp.

◆ hostType

using hostType = typename hostViewType::device_type

Definition at line 81 of file VectorDual.hpp.

◆ viewType

Definition at line 84 of file VectorDual.hpp.

◆ memory_space

using memory_space = typename viewType::memory_space

Definition at line 87 of file VectorDual.hpp.

◆ execution_space

using execution_space = typename deviceType::execution_space

Definition at line 90 of file VectorDual.hpp.

Constructor & Destructor Documentation

◆ VectorDual() [1/13]

VectorDual ( )
inline

Definition at line 173 of file VectorDual.hpp.

Referenced by VectorDual< int8 >::clonePtr().

Here is the caller graph for this function:

◆ VectorDual() [2/13]

VectorDual ( const word name)
inline

Definition at line 179 of file VectorDual.hpp.

◆ VectorDual() [3/13]

VectorDual ( size_t  n)
inline

Definition at line 189 of file VectorDual.hpp.

◆ VectorDual() [4/13]

VectorDual ( const word name,
size_t  n 
)
inline

Definition at line 195 of file VectorDual.hpp.

◆ VectorDual() [5/13]

VectorDual ( size_t  n,
const T &  val 
)
inline

Definition at line 205 of file VectorDual.hpp.

◆ VectorDual() [6/13]

VectorDual ( const word name,
size_t  n,
const T &  val 
)
inline

Definition at line 211 of file VectorDual.hpp.

◆ VectorDual() [7/13]

VectorDual ( size_t  cap,
size_t  n,
RESERVE   
)
inline

Definition at line 218 of file VectorDual.hpp.

◆ VectorDual() [8/13]

VectorDual ( const word name,
size_t  cap,
size_t  n,
RESERVE   
)
inline

Definition at line 223 of file VectorDual.hpp.

◆ VectorDual() [9/13]

VectorDual ( const Vector< T > &  src)
inline

Definition at line 232 of file VectorDual.hpp.

◆ VectorDual() [10/13]

VectorDual ( const word name,
const Vector< T > &  src 
)
inline

Definition at line 237 of file VectorDual.hpp.

◆ VectorDual() [11/13]

VectorDual ( const VectorDual< T, MemorySpace > &  src)
inline

Definition at line 246 of file VectorDual.hpp.

◆ VectorDual() [12/13]

VectorDual ( const word name,
const VectorDual< T, MemorySpace > &  src 
)
inline

Definition at line 267 of file VectorDual.hpp.

◆ VectorDual() [13/13]

VectorDual ( VectorDual< T, MemorySpace > &&  )
delete

Member Function Documentation

◆ memoerySpaceName()

constexpr static const char* memoerySpaceName ( )
inlinestaticconstexprprotected

Definition at line 118 of file VectorDual.hpp.

◆ evalCapacity()

static INLINE_FUNCTION_H size_t evalCapacity ( size_t  n)
inlinestaticprotected

Definition at line 123 of file VectorDual.hpp.

Referenced by VectorDual< int8 >::assign(), and VectorDual< int8 >::changeSize().

Here is the caller graph for this function:

◆ changeSize()

INLINE_FUNCTION_H void changeSize ( size_t  n,
bool  actualCap = false 
)
inlineprotected

◆ setSize()

◆ updateSubViews()

INLINE_FUNCTION_H void updateSubViews ( ) const
inlineprotected

Definition at line 156 of file VectorDual.hpp.

Referenced by VectorDual< int8 >::deviceVector(), and VectorDual< int8 >::hostVector().

Here is the caller graph for this function:

◆ TypeInfoTemplateNV2()

TypeInfoTemplateNV2 ( "VectorDual< T, MemorySpace >"  ,
,
memoerySpaceName()   
)

◆ operator=() [1/2]

VectorDual& operator= ( const VectorDual< T, MemorySpace > &  rhs)
inline

Definition at line 288 of file VectorDual.hpp.

◆ operator=() [2/2]

VectorDual& operator= ( VectorDual< T, MemorySpace > &&  )
delete

◆ clone()

INLINE_FUNCTION_H uniquePtr<VectorDual> clone ( ) const
inline

Definition at line 307 of file VectorDual.hpp.

◆ clonePtr()

INLINE_FUNCTION_H VectorDual* clonePtr ( ) const
inline

Definition at line 313 of file VectorDual.hpp.

◆ VectorField() [1/2]

INLINE_FUNCTION_H VectorType& VectorField ( )
inline

Definition at line 322 of file VectorDual.hpp.

◆ VectorField() [2/2]

const INLINE_FUNCTION_H VectorType& VectorField ( ) const
inline

Definition at line 329 of file VectorDual.hpp.

◆ deviceVectorAll() [1/2]

◆ deviceVectorAll() [2/2]

const INLINE_FUNCTION_H deviceViewType& deviceVectorAll ( ) const
inline

Definition at line 340 of file VectorDual.hpp.

◆ hostVectorAll() [1/2]

◆ hostVectorAll() [2/2]

const INLINE_FUNCTION_H hostViewType& hostVectorAll ( ) const
inline

Definition at line 350 of file VectorDual.hpp.

◆ deviceVector() [1/3]

◆ deviceVector() [2/3]

const INLINE_FUNCTION_H deviceViewType& deviceVector ( ) const
inline

Definition at line 359 of file VectorDual.hpp.

◆ hostVector() [1/3]

◆ hostVector() [2/3]

const INLINE_FUNCTION_H hostViewType& hostVector ( ) const
inline

Definition at line 369 of file VectorDual.hpp.

◆ hostVector() [3/3]

INLINE_FUNCTION_H hostViewType hostVector ( int32  start,
int32  end 
) const
inline

Definition at line 375 of file VectorDual.hpp.

◆ deviceVector() [3/3]

INLINE_FUNCTION_H deviceViewType deviceVector ( int32  start,
int32  end 
) const
inline

Definition at line 381 of file VectorDual.hpp.

◆ name()

const INLINE_FUNCTION_H word name ( ) const
inline

Definition at line 386 of file VectorDual.hpp.

◆ size()

◆ capacity()

INLINE_FUNCTION_H size_t capacity ( ) const
inline

Definition at line 396 of file VectorDual.hpp.

Referenced by VectorDual< int8 >::assign(), multiTriSurface::calculateVars(), and VectorDual< int8 >::operator=().

Here is the caller graph for this function:

◆ empty()

◆ reserve()

INLINE_FUNCTION_H void reserve ( size_t  cap)
inline

Definition at line 408 of file VectorDual.hpp.

◆ resize() [1/2]

INLINE_FUNCTION_H void resize ( size_t  n)
inline

Definition at line 414 of file VectorDual.hpp.

Referenced by VectorDual< int8 >::insertSetElement().

Here is the caller graph for this function:

◆ reallocate()

INLINE_FUNCTION_H void reallocate ( size_t  cap)
inline

Definition at line 419 of file VectorDual.hpp.

Referenced by VectorDual< int8 >::assign(), multiTriSurface::calculateVars(), and VectorDual< int8 >::VectorDual().

Here is the caller graph for this function:

◆ resizeSync() [1/2]

INLINE_FUNCTION_H void resizeSync ( size_t  n)
inline

Definition at line 429 of file VectorDual.hpp.

◆ resize() [2/2]

INLINE_FUNCTION_H void resize ( size_t  n,
const T &  val 
)
inline

Definition at line 437 of file VectorDual.hpp.

◆ resizeSync() [2/2]

INLINE_FUNCTION_H void resizeSync ( size_t  n,
const T &  val 
)
inline

Definition at line 443 of file VectorDual.hpp.

◆ clear()

INLINE_FUNCTION_H void clear ( )
inline

Definition at line 448 of file VectorDual.hpp.

Referenced by multiTriSurface::calculateVars(), and multiTriSurface::clear().

Here is the caller graph for this function:

◆ fill()

INLINE_FUNCTION_H void fill ( const T &  val)
inline

Definition at line 455 of file VectorDual.hpp.

Referenced by VectorDual< int8 >::assign().

Here is the caller graph for this function:

◆ fillHost()

INLINE_FUNCTION_H void fillHost ( const T &  val)
inline

Definition at line 463 of file VectorDual.hpp.

◆ fillDevice()

INLINE_FUNCTION_H void fillDevice ( const T &  val)
inline

Definition at line 470 of file VectorDual.hpp.

◆ assign() [1/2]

FUNCTION_H void assign ( size_t  n,
const T &  val 
)
inline

Definition at line 481 of file VectorDual.hpp.

Referenced by VectorDual< int8 >::read(), VectorDual< int8 >::resize(), VectorDual< int8 >::resizeSync(), and VectorDual< int8 >::VectorDual().

Here is the caller graph for this function:

◆ assign() [2/2]

FUNCTION_H void assign ( const Vector< T > &  src)
inline

Definition at line 496 of file VectorDual.hpp.

◆ deleteElement()

bool deleteElement ( const Vector< label > &  indices)
inline

Definition at line 515 of file VectorDual.hpp.

◆ insertSetElement() [1/4]

INLINE_FUNCTION_H bool insertSetElement ( const int32IndexContainer indices,
const T &  val 
)
inline

Definition at line 549 of file VectorDual.hpp.

◆ insertSetElement() [2/4]

INLINE_FUNCTION_H bool insertSetElement ( const int32IndexContainer indices,
const Vector< T > &  vals 
)
inline

Definition at line 580 of file VectorDual.hpp.

◆ insertSetElement() [3/4]

INLINE_FUNCTION_H bool insertSetElement ( const Vector< int32 > &  indices,
const T &  val 
)
inline

Definition at line 641 of file VectorDual.hpp.

◆ insertSetElement() [4/4]

INLINE_FUNCTION_H bool insertSetElement ( const Vector< int32 > &  indices,
const Vector< T > &  vals 
)
inline

Definition at line 686 of file VectorDual.hpp.

◆ push_back()

void push_back ( const T &  val)
inline

Definition at line 741 of file VectorDual.hpp.

Referenced by VectorDual< int8 >::assign(), and multiTriSurface::calculateVars().

Here is the caller graph for this function:

◆ data() [1/2]

INLINE_FUNCTION_H pointer data ( )
inline

Definition at line 753 of file VectorDual.hpp.

Referenced by VectorDual< int8 >::begin(), VectorDual< int8 >::end(), VectorDual< int8 >::insertSetElement(), and VectorDual< int8 >::push_back().

Here is the caller graph for this function:

◆ data() [2/2]

INLINE_FUNCTION_H constPointer data ( ) const
inline

Definition at line 757 of file VectorDual.hpp.

◆ begin() [1/2]

INLINE_FUNCTION_H iterator begin ( )
inline

Definition at line 763 of file VectorDual.hpp.

◆ begin() [2/2]

INLINE_FUNCTION_H constIterator begin ( ) const
inline

Definition at line 769 of file VectorDual.hpp.

◆ end() [1/2]

◆ end() [2/2]

INLINE_FUNCTION_H constIterator end ( ) const
inline

Definition at line 781 of file VectorDual.hpp.

◆ operator[]() [1/2]

INLINE_FUNCTION_H reference operator[] ( label  i)
inline

Definition at line 785 of file VectorDual.hpp.

◆ operator[]() [2/2]

INLINE_FUNCTION_H constReference operator[] ( label  i) const
inline

Definition at line 789 of file VectorDual.hpp.

◆ modifyOnHost()

◆ modifyOnDevice()

INLINE_FUNCTION_H void modifyOnDevice ( )
inline

Definition at line 801 of file VectorDual.hpp.

Referenced by VectorDual< int8 >::fillDevice(), VectorDual< int8 >::insertSetElement(), and VectorDual< int8 >::VectorDual().

Here is the caller graph for this function:

◆ hostRequiresSync()

INLINE_FUNCTION_H bool hostRequiresSync ( ) const
inline

Definition at line 806 of file VectorDual.hpp.

Referenced by VectorDual< int8 >::syncToHost(), VectorDual< int8 >::syncViews(), VectorDual< int8 >::VectorDual(), and VectorDual< int8 >::write().

Here is the caller graph for this function:

◆ deviceRequiresSync()

INLINE_FUNCTION_H bool deviceRequiresSync ( ) const
inline

Definition at line 811 of file VectorDual.hpp.

Referenced by VectorDual< int8 >::syncToDevice(), VectorDual< int8 >::syncViews(), and VectorDual< int8 >::VectorDual().

Here is the caller graph for this function:

◆ areViewsSimilar()

INLINE_FUNCTION_H bool areViewsSimilar ( ) const
inline

Definition at line 816 of file VectorDual.hpp.

◆ copyHostToDevice() [1/2]

INLINE_FUNCTION_H void copyHostToDevice ( )
inline

Definition at line 823 of file VectorDual.hpp.

Referenced by VectorDual< int8 >::syncToDevice(), and VectorDual< int8 >::syncViews().

Here is the caller graph for this function:

◆ copyHostToDevice() [2/2]

INLINE_FUNCTION_H void copyHostToDevice ( int32  start,
int32  end,
bool  setUpdated = true 
)
inline

Definition at line 832 of file VectorDual.hpp.

◆ copyDeviceToHost() [1/2]

INLINE_FUNCTION_H void copyDeviceToHost ( )
inline

Definition at line 842 of file VectorDual.hpp.

Referenced by VectorDual< int8 >::syncToHost(), and VectorDual< int8 >::syncViews().

Here is the caller graph for this function:

◆ copyDeviceToHost() [2/2]

INLINE_FUNCTION_H void copyDeviceToHost ( int32  start,
int32  end,
bool  setUpdated = true 
)
inline

Definition at line 850 of file VectorDual.hpp.

◆ syncToHost()

INLINE_FUNCTION_H void syncToHost ( )
inline

Definition at line 858 of file VectorDual.hpp.

Referenced by VectorDual< int8 >::push_back().

Here is the caller graph for this function:

◆ syncToDevice()

INLINE_FUNCTION_H void syncToDevice ( )
inline

Definition at line 866 of file VectorDual.hpp.

◆ syncViews() [1/2]

◆ syncViews() [2/2]

INLINE_FUNCTION_H void syncViews ( int32  start,
int32  end 
)
inline

Definition at line 887 of file VectorDual.hpp.

◆ read()

FUNCTION_H bool read ( iIstream is)
inline

Definition at line 901 of file VectorDual.hpp.

Referenced by pFlow::operator>>().

Here is the caller graph for this function:

◆ write()

FUNCTION_H bool write ( iOstream os) const
inline

Definition at line 912 of file VectorDual.hpp.

Referenced by pFlow::operator<<().

Here is the caller graph for this function:

Member Data Documentation

◆ size_

◆ capacity_

◆ dualView_

◆ deviceSubView_

deviceViewType deviceSubView_
mutableprotected

◆ hostSubView_

hostViewType hostSubView_
mutableprotected

◆ subViewsUpdated_

bool subViewsUpdated_ = false
mutableprotected

◆ growthFactor_

const real growthFactor_ = vectorGrowthFactor__
inlinestaticprotected

Definition at line 106 of file VectorDual.hpp.

Referenced by VectorDual< int8 >::evalCapacity().

◆ isHostAccessible_

constexpr bool isHostAccessible_
staticconstexprprotected
Initial value:
=
Kokkos::SpaceAccessibility<execution_space,Kokkos::HostSpace>::accessible

Definition at line 109 of file VectorDual.hpp.

◆ hdName__

const word hdName__
inlinestaticprotected
Initial value:
=
word(hostType::memory_space::name())+
word(deviceType::memory_space::name())

Definition at line 113 of file VectorDual.hpp.

Referenced by VectorDual< int8 >::memoerySpaceName().


The documentation for this class was generated from the following file:
pFlow::word
std::string word
Definition: builtinTypes.hpp:63