Mundy: Multibody Nonlocal Dynamics Version of the Day
Loading...
Searching...
No Matches
mundy::mesh::NgpEntityPoolT< MemorySpace, SizeType > Class Template Reference

NgpEntityPoolT is a Kokkos-compatible pool of stk::mesh::Entity objects. More...

#include <NgpEntityPool.hpp>

Inheritance diagram for mundy::mesh::NgpEntityPoolT< MemorySpace, SizeType >:
[legend]

Public Types

using memory_space = MemorySpace
using execution_space = typename MemorySpace::execution_space
using entity_vector_t = std::vector<stk::mesh::Entity>
using entity_view_t = NgpViewT<stk::mesh::Entity*, MemorySpace>
using our_size_t = SizeType
using base_t = NgpPoolT<stk::mesh::Entity, MemorySpace, SizeType>
using pool_vector_t
using pool_view_t
using value_type

Public Member Functions

 NgpEntityPoolT ()=default
 NgpEntityPoolT (stk::mesh::BulkData &bulk_data, stk::mesh::EntityRank rank)
 NgpEntityPoolT (stk::mesh::BulkData &bulk_data, stk::mesh::EntityRank rank, size_t capacity)
 ~NgpEntityPoolT ()=default
 NgpEntityPoolT (const NgpEntityPoolT &)=default
NgpEntityPoolToperator= (const NgpEntityPoolT &)=default
 NgpEntityPoolT (NgpEntityPoolT &&)=default
NgpEntityPoolToperator= (NgpEntityPoolT &&)=default
void reserve_and_declare (our_size_t requested_capacity)
Accessors
our_size_t capacity () const
our_size_t capacity_host () const
our_size_t size () const
our_size_t size_host () const
void reserve (our_size_t requested_capacity)
value_type acquire () const
 Acquire a value from the pool. Returns by move. Modifies on device but does not mark as modified. It's up to you to mark the pool as modified on the device after using this.
value_type acquire_host () const
 Acquire a value from the pool. Returns by move. Modifies on host but does not mark as modified. It's up to you to mark the pool as modified on the host after using this.
void add (value_type p) const
 Add an object into the pool. Modifies on device but does not mark as modified.
void add_host (value_type p) const
 Add an object into the pool. Modifies on host but does not mark as modified.
pool_view_t batch_acquire (our_size_t n)
 Acquire N objects from the pool. Returns by move. Modifies on device and marks as modified. Results are returned in an NgpViewT<ValueType, MemorySpace>.
pool_vector_t batch_acquire_host (our_size_t n)
 Acquire N objects from the pool. Returns by move. Modifies on host and marks as modified. Results are returned in an std::vector<ValueType>.
void batch_add (pool_view_t p)
 Add N objects into the pool. Modifies on device and marks as modified.
void batch_add_host (pool_vector_t p)
 Add N objects into the pool. Modifies on host and marks as modified.
Ngp interface
void modify_on_host ()
 Mark the host pool as modified.
void modify_on_device ()
 Mark the device pool as modified.
void modify_on ()
 Abstract method for marking the pool as modified.
void sync_to_host ()
 Synchronize the host pool to the device pool if needed.
void sync_to_device ()
 Synchronize the device pool to the host pool if needed.
void sync_to ()
 Abstract method for synchronizing the pool.
bool need_sync_to_host () const
 Return if we need to sync to the host.
bool need_sync_to_device () const
 Return if we need to sync to the device.
bool need_sync_to () const
 Abstract method for checking if we need to sync.

Detailed Description

template<typename MemorySpace, typename SizeType = long int>
class mundy::mesh::NgpEntityPoolT< MemorySpace, SizeType >

Unlike a regular NgpPool, we offer a reserve and declare method to both reserve space within the pool and fill that space with entities from a given mesh.

Member Typedef Documentation

◆ memory_space

template<typename MemorySpace, typename SizeType = long int>
using mundy::mesh::NgpEntityPoolT< MemorySpace, SizeType >::memory_space = MemorySpace

◆ execution_space

template<typename MemorySpace, typename SizeType = long int>
using mundy::mesh::NgpEntityPoolT< MemorySpace, SizeType >::execution_space = typename MemorySpace::execution_space

◆ entity_vector_t

template<typename MemorySpace, typename SizeType = long int>
using mundy::mesh::NgpEntityPoolT< MemorySpace, SizeType >::entity_vector_t = std::vector<stk::mesh::Entity>

◆ entity_view_t

template<typename MemorySpace, typename SizeType = long int>
using mundy::mesh::NgpEntityPoolT< MemorySpace, SizeType >::entity_view_t = NgpViewT<stk::mesh::Entity*, MemorySpace>

◆ our_size_t

template<typename MemorySpace, typename SizeType = long int>
using mundy::mesh::NgpEntityPoolT< MemorySpace, SizeType >::our_size_t = SizeType

◆ base_t

template<typename MemorySpace, typename SizeType = long int>
using mundy::mesh::NgpEntityPoolT< MemorySpace, SizeType >::base_t = NgpPoolT<stk::mesh::Entity, MemorySpace, SizeType>

◆ pool_vector_t

using mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::pool_vector_t
inherited

◆ pool_view_t

using mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::pool_view_t
inherited

◆ value_type

using mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::value_type
inherited

Constructor & Destructor Documentation

◆ NgpEntityPoolT() [1/5]

template<typename MemorySpace, typename SizeType = long int>
mundy::mesh::NgpEntityPoolT< MemorySpace, SizeType >::NgpEntityPoolT ( )
default

◆ NgpEntityPoolT() [2/5]

template<typename MemorySpace, typename SizeType = long int>
mundy::mesh::NgpEntityPoolT< MemorySpace, SizeType >::NgpEntityPoolT ( stk::mesh::BulkData & bulk_data,
stk::mesh::EntityRank rank )
inline

◆ NgpEntityPoolT() [3/5]

template<typename MemorySpace, typename SizeType = long int>
mundy::mesh::NgpEntityPoolT< MemorySpace, SizeType >::NgpEntityPoolT ( stk::mesh::BulkData & bulk_data,
stk::mesh::EntityRank rank,
size_t capacity )
inline

◆ ~NgpEntityPoolT()

template<typename MemorySpace, typename SizeType = long int>
mundy::mesh::NgpEntityPoolT< MemorySpace, SizeType >::~NgpEntityPoolT ( )
default

◆ NgpEntityPoolT() [4/5]

template<typename MemorySpace, typename SizeType = long int>
mundy::mesh::NgpEntityPoolT< MemorySpace, SizeType >::NgpEntityPoolT ( const NgpEntityPoolT< MemorySpace, SizeType > & )
default

◆ NgpEntityPoolT() [5/5]

template<typename MemorySpace, typename SizeType = long int>
mundy::mesh::NgpEntityPoolT< MemorySpace, SizeType >::NgpEntityPoolT ( NgpEntityPoolT< MemorySpace, SizeType > && )
default

Member Function Documentation

◆ operator=() [1/2]

template<typename MemorySpace, typename SizeType = long int>
NgpEntityPoolT & mundy::mesh::NgpEntityPoolT< MemorySpace, SizeType >::operator= ( const NgpEntityPoolT< MemorySpace, SizeType > & )
default

◆ operator=() [2/2]

template<typename MemorySpace, typename SizeType = long int>
NgpEntityPoolT & mundy::mesh::NgpEntityPoolT< MemorySpace, SizeType >::operator= ( NgpEntityPoolT< MemorySpace, SizeType > && )
default

◆ reserve_and_declare()

template<typename MemorySpace, typename SizeType = long int>
void mundy::mesh::NgpEntityPoolT< MemorySpace, SizeType >::reserve_and_declare ( our_size_t requested_capacity)
inline

◆ capacity()

our_size_t mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::capacity ( ) const
inlineinherited

◆ capacity_host()

our_size_t mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::capacity_host ( ) const
inlineinherited

◆ size()

our_size_t mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::size ( ) const
inlineinherited

◆ size_host()

our_size_t mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::size_host ( ) const
inlineinherited

◆ reserve()

void mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::reserve ( our_size_t requested_capacity)
inlineinherited

◆ acquire()

value_type mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::acquire ( ) const
inlineinherited

Something to be aware of: This function is const because a KOKKOS_LAMBDA will const capture this class making acquire on the device impossible otherwise. This is why we mark size, capacity, and our internal pool as mutable.

◆ acquire_host()

value_type mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::acquire_host ( ) const
inlineinherited

◆ add()

void mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::add ( value_type p) const
inlineinherited

◆ add_host()

void mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::add_host ( value_type p) const
inlineinherited

◆ batch_acquire()

pool_view_t mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::batch_acquire ( our_size_t n)
inlineinherited

◆ batch_acquire_host()

pool_vector_t mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::batch_acquire_host ( our_size_t n)
inlineinherited

◆ batch_add()

void mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::batch_add ( pool_view_t p)
inlineinherited

◆ batch_add_host()

void mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::batch_add_host ( pool_vector_t p)
inlineinherited

◆ modify_on_host()

void mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::modify_on_host ( )
inlineinherited

Call this method after updating the host pool so that the NgpPoolT is aware that the device pool may now be out of date.

◆ modify_on_device()

void mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::modify_on_device ( )
inlineinherited

Call this method after updating the device pool so that the NgpPoolT is aware that the host pool may now be out of date.

◆ modify_on()

void mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::modify_on ( )
inlineinherited

◆ sync_to_host()

void mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::sync_to_host ( )
inlineinherited

If the device pool has been modified more recently than the host pool, this function performs a deep copy from the device pool to the host pool.

◆ sync_to_device()

void mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::sync_to_device ( )
inlineinherited

If the host pool has been modified more recently than the device pool, this function performs a deep copy from the host pool to the device pool.

◆ sync_to()

void mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::sync_to ( )
inlineinherited

◆ need_sync_to_host()

bool mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::need_sync_to_host ( ) const
inlineinherited

◆ need_sync_to_device()

bool mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::need_sync_to_device ( ) const
inlineinherited

◆ need_sync_to()

bool mundy::NgpPoolT< stk::mesh::Entity, MemorySpace, long int >::need_sync_to ( ) const
inlineinherited