Compadre  1.5.7
Public Types | Public Attributes | List of all members
Compadre::NeighborLists< view_type > Struct Template Reference

NeighborLists assists in accessing entries of compressed row neighborhood lists. More...

Detailed Description

template<typename view_type>
struct Compadre::NeighborLists< view_type >

NeighborLists assists in accessing entries of compressed row neighborhood lists.

Definition at line 11 of file Compadre_NeighborLists.hpp.

#include <Compadre_NeighborLists.hpp>

Public Types

typedef view_type internal_view_type
 
typedef Kokkos::View< global_index_type *, typename view_type::array_layout, typename view_type::memory_space, typename view_type::memory_traits > internal_row_offsets_view_type
 

Public Member Functions

Constructors

Ways to initialize a NeighborLists object

 NeighborLists ()
 Constructor for the purpose of classes who have NeighborLists as a member object. More...
 
 NeighborLists (view_type cr_neighbor_lists, view_type number_of_neighbors_list, internal_row_offsets_view_type neighbor_lists_row_offsets, bool compute_max=true)
 Constructor for when compressed row cr_neighbor_lists is preallocated/populated, number_of_neighbors_list and neighbor_lists_row_offsets have already been populated. More...
 
 NeighborLists (view_type cr_neighbor_lists, view_type number_of_neighbors_list)
 Constructor for when compressed row cr_neighbor_lists is preallocated/populated, and number_of_neighbors_list is already populated, and row offsets still need to be computed. More...
 
 NeighborLists (view_type number_of_neighbors_list)
 Constructor for when number_of_neighbors_list is already populated. Will allocate space for compressed row neighbor lists data, and will allocate then populate information for row offsets. More...
 
Public modifiers
KOKKOS_INLINE_FUNCTION void setNeighborDevice (int target_index, int neighbor_num, int new_value)
 Setter function for N(i,j) indexing where N(i,j) is the index of the jth neighbor of i. More...
 
void computeMaxNumNeighbors ()
 Calculate the maximum number of neighbors of all targets' neighborhoods (host) More...
 
void computeMinNumNeighbors ()
 Calculate the minimum number of neighbors of all targets' neighborhoods (host) More...
 
void computeRowOffsets ()
 Calculate the row offsets for each target's neighborhood (host) More...
 
void copyDeviceDataToHost ()
 Sync the host from the device (copy device data to host) More...
 
view_type getNeighborLists () const
 Device view into neighbor lists data (use with caution) More...
 
view_type getNumberOfNeighborsList () const
 Device view into number of neighbors list (use with caution) More...
 
Public accessors
KOKKOS_INLINE_FUNCTION int getNumberOfTargets () const
 Get number of total targets having neighborhoods (host/device). More...
 
int getNumberOfNeighborsHost (int target_index) const
 Get number of neighbors for a given target (host) More...
 
KOKKOS_INLINE_FUNCTION int getNumberOfNeighborsDevice (int target_index) const
 Get number of neighbors for a given target (device) More...
 
global_index_type getRowOffsetHost (int target_index) const
 Get offset into compressed row neighbor lists (host) More...
 
KOKKOS_INLINE_FUNCTION global_index_type getRowOffsetDevice (int target_index) const
 Get offset into compressed row neighbor lists (device) More...
 
int getNeighborHost (int target_index, int neighbor_num) const
 Offers N(i,j) indexing where N(i,j) is the index of the jth neighbor of i (host) More...
 
KOKKOS_INLINE_FUNCTION int getNeighborDevice (int target_index, int neighbor_num) const
 Offers N(i,j) indexing where N(i,j) is the index of the jth neighbor of i (device) More...
 
KOKKOS_INLINE_FUNCTION int getMaxNumNeighbors () const
 Get the maximum number of neighbors of all targets' neighborhoods (host/device) More...
 
KOKKOS_INLINE_FUNCTION int getMinNumNeighbors () const
 Get the minimum number of neighbors of all targets' neighborhoods (host/device) More...
 
global_index_type getTotalNeighborsOverAllListsHost () const
 Get the sum of the number of neighbors of all targets' neighborhoods (host) More...
 
KOKKOS_INLINE_FUNCTION global_index_type getTotalNeighborsOverAllListsDevice () const
 Get the sum of the number of neighbors of all targets' neighborhoods (device) More...
 

Public Attributes

int _max_neighbor_list_row_storage_size
 
int _min_neighbor_list_row_storage_size
 
bool _needs_sync_to_host
 
int _number_of_targets
 
internal_row_offsets_view_type _row_offsets
 
view_type _cr_neighbor_lists
 
view_type _number_of_neighbors_list
 
internal_row_offsets_view_type::HostMirror _host_row_offsets
 
view_type::HostMirror _host_cr_neighbor_lists
 
view_type::HostMirror _host_number_of_neighbors_list
 

Member Typedef Documentation

◆ internal_row_offsets_view_type

template<typename view_type >
typedef Kokkos::View<global_index_type*, typename view_type::array_layout, typename view_type::memory_space, typename view_type::memory_traits> Compadre::NeighborLists< view_type >::internal_row_offsets_view_type

Definition at line 15 of file Compadre_NeighborLists.hpp.

◆ internal_view_type

template<typename view_type >
typedef view_type Compadre::NeighborLists< view_type >::internal_view_type

Definition at line 13 of file Compadre_NeighborLists.hpp.

Constructor & Destructor Documentation

◆ NeighborLists() [1/4]

template<typename view_type >
Compadre::NeighborLists< view_type >::NeighborLists ( )
inline

Constructor for the purpose of classes who have NeighborLists as a member object.

Definition at line 36 of file Compadre_NeighborLists.hpp.

◆ NeighborLists() [2/4]

template<typename view_type >
Compadre::NeighborLists< view_type >::NeighborLists ( view_type  cr_neighbor_lists,
view_type  number_of_neighbors_list,
internal_row_offsets_view_type  neighbor_lists_row_offsets,
bool  compute_max = true 
)
inline

Constructor for when compressed row cr_neighbor_lists is preallocated/populated, number_of_neighbors_list and neighbor_lists_row_offsets have already been populated.

Definition at line 46 of file Compadre_NeighborLists.hpp.

◆ NeighborLists() [3/4]

template<typename view_type >
Compadre::NeighborLists< view_type >::NeighborLists ( view_type  cr_neighbor_lists,
view_type  number_of_neighbors_list 
)
inline

Constructor for when compressed row cr_neighbor_lists is preallocated/populated, and number_of_neighbors_list is already populated, and row offsets still need to be computed.

Definition at line 82 of file Compadre_NeighborLists.hpp.

◆ NeighborLists() [4/4]

template<typename view_type >
Compadre::NeighborLists< view_type >::NeighborLists ( view_type  number_of_neighbors_list)
inline

Constructor for when number_of_neighbors_list is already populated. Will allocate space for compressed row neighbor lists data, and will allocate then populate information for row offsets.

Definition at line 115 of file Compadre_NeighborLists.hpp.

Member Function Documentation

◆ computeMaxNumNeighbors()

template<typename view_type >
void Compadre::NeighborLists< view_type >::computeMaxNumNeighbors ( )
inline

Calculate the maximum number of neighbors of all targets' neighborhoods (host)

Definition at line 157 of file Compadre_NeighborLists.hpp.

◆ computeMinNumNeighbors()

template<typename view_type >
void Compadre::NeighborLists< view_type >::computeMinNumNeighbors ( )
inline

Calculate the minimum number of neighbors of all targets' neighborhoods (host)

Definition at line 172 of file Compadre_NeighborLists.hpp.

◆ computeRowOffsets()

template<typename view_type >
void Compadre::NeighborLists< view_type >::computeRowOffsets ( )
inline

Calculate the row offsets for each target's neighborhood (host)

Definition at line 187 of file Compadre_NeighborLists.hpp.

◆ copyDeviceDataToHost()

template<typename view_type >
void Compadre::NeighborLists< view_type >::copyDeviceDataToHost ( )
inline

Sync the host from the device (copy device data to host)

Definition at line 201 of file Compadre_NeighborLists.hpp.

◆ getMaxNumNeighbors()

template<typename view_type >
KOKKOS_INLINE_FUNCTION int Compadre::NeighborLists< view_type >::getMaxNumNeighbors ( ) const
inline

Get the maximum number of neighbors of all targets' neighborhoods (host/device)

Definition at line 274 of file Compadre_NeighborLists.hpp.

◆ getMinNumNeighbors()

template<typename view_type >
KOKKOS_INLINE_FUNCTION int Compadre::NeighborLists< view_type >::getMinNumNeighbors ( ) const
inline

Get the minimum number of neighbors of all targets' neighborhoods (host/device)

Definition at line 281 of file Compadre_NeighborLists.hpp.

◆ getNeighborDevice()

template<typename view_type >
KOKKOS_INLINE_FUNCTION int Compadre::NeighborLists< view_type >::getNeighborDevice ( int  target_index,
int  neighbor_num 
) const
inline

Offers N(i,j) indexing where N(i,j) is the index of the jth neighbor of i (device)

Definition at line 265 of file Compadre_NeighborLists.hpp.

◆ getNeighborHost()

template<typename view_type >
int Compadre::NeighborLists< view_type >::getNeighborHost ( int  target_index,
int  neighbor_num 
) const
inline

Offers N(i,j) indexing where N(i,j) is the index of the jth neighbor of i (host)

Definition at line 254 of file Compadre_NeighborLists.hpp.

◆ getNeighborLists()

template<typename view_type >
view_type Compadre::NeighborLists< view_type >::getNeighborLists ( ) const
inline

Device view into neighbor lists data (use with caution)

Definition at line 208 of file Compadre_NeighborLists.hpp.

◆ getNumberOfNeighborsDevice()

template<typename view_type >
KOKKOS_INLINE_FUNCTION int Compadre::NeighborLists< view_type >::getNumberOfNeighborsDevice ( int  target_index) const
inline

Get number of neighbors for a given target (device)

Definition at line 235 of file Compadre_NeighborLists.hpp.

◆ getNumberOfNeighborsHost()

template<typename view_type >
int Compadre::NeighborLists< view_type >::getNumberOfNeighborsHost ( int  target_index) const
inline

Get number of neighbors for a given target (host)

Definition at line 228 of file Compadre_NeighborLists.hpp.

◆ getNumberOfNeighborsList()

template<typename view_type >
view_type Compadre::NeighborLists< view_type >::getNumberOfNeighborsList ( ) const
inline

Device view into number of neighbors list (use with caution)

Definition at line 213 of file Compadre_NeighborLists.hpp.

◆ getNumberOfTargets()

template<typename view_type >
KOKKOS_INLINE_FUNCTION int Compadre::NeighborLists< view_type >::getNumberOfTargets ( ) const
inline

Get number of total targets having neighborhoods (host/device).

Definition at line 223 of file Compadre_NeighborLists.hpp.

◆ getRowOffsetDevice()

template<typename view_type >
KOKKOS_INLINE_FUNCTION global_index_type Compadre::NeighborLists< view_type >::getRowOffsetDevice ( int  target_index) const
inline

Get offset into compressed row neighbor lists (device)

Definition at line 248 of file Compadre_NeighborLists.hpp.

◆ getRowOffsetHost()

template<typename view_type >
global_index_type Compadre::NeighborLists< view_type >::getRowOffsetHost ( int  target_index) const
inline

Get offset into compressed row neighbor lists (host)

Definition at line 241 of file Compadre_NeighborLists.hpp.

◆ getTotalNeighborsOverAllListsDevice()

template<typename view_type >
KOKKOS_INLINE_FUNCTION global_index_type Compadre::NeighborLists< view_type >::getTotalNeighborsOverAllListsDevice ( ) const
inline

Get the sum of the number of neighbors of all targets' neighborhoods (device)

Definition at line 297 of file Compadre_NeighborLists.hpp.

◆ getTotalNeighborsOverAllListsHost()

template<typename view_type >
global_index_type Compadre::NeighborLists< view_type >::getTotalNeighborsOverAllListsHost ( ) const
inline

Get the sum of the number of neighbors of all targets' neighborhoods (host)

Definition at line 287 of file Compadre_NeighborLists.hpp.

◆ setNeighborDevice()

template<typename view_type >
KOKKOS_INLINE_FUNCTION void Compadre::NeighborLists< view_type >::setNeighborDevice ( int  target_index,
int  neighbor_num,
int  new_value 
)
inline

Setter function for N(i,j) indexing where N(i,j) is the index of the jth neighbor of i.

Definition at line 149 of file Compadre_NeighborLists.hpp.

Member Data Documentation

◆ _cr_neighbor_lists

template<typename view_type >
view_type Compadre::NeighborLists< view_type >::_cr_neighbor_lists

Definition at line 23 of file Compadre_NeighborLists.hpp.

◆ _host_cr_neighbor_lists

template<typename view_type >
view_type::HostMirror Compadre::NeighborLists< view_type >::_host_cr_neighbor_lists

Definition at line 27 of file Compadre_NeighborLists.hpp.

◆ _host_number_of_neighbors_list

template<typename view_type >
view_type::HostMirror Compadre::NeighborLists< view_type >::_host_number_of_neighbors_list

Definition at line 28 of file Compadre_NeighborLists.hpp.

◆ _host_row_offsets

template<typename view_type >
internal_row_offsets_view_type::HostMirror Compadre::NeighborLists< view_type >::_host_row_offsets

Definition at line 26 of file Compadre_NeighborLists.hpp.

◆ _max_neighbor_list_row_storage_size

template<typename view_type >
int Compadre::NeighborLists< view_type >::_max_neighbor_list_row_storage_size

Definition at line 17 of file Compadre_NeighborLists.hpp.

◆ _min_neighbor_list_row_storage_size

template<typename view_type >
int Compadre::NeighborLists< view_type >::_min_neighbor_list_row_storage_size

Definition at line 18 of file Compadre_NeighborLists.hpp.

◆ _needs_sync_to_host

template<typename view_type >
bool Compadre::NeighborLists< view_type >::_needs_sync_to_host

Definition at line 19 of file Compadre_NeighborLists.hpp.

◆ _number_of_neighbors_list

template<typename view_type >
view_type Compadre::NeighborLists< view_type >::_number_of_neighbors_list

Definition at line 24 of file Compadre_NeighborLists.hpp.

◆ _number_of_targets

template<typename view_type >
int Compadre::NeighborLists< view_type >::_number_of_targets

Definition at line 20 of file Compadre_NeighborLists.hpp.

◆ _row_offsets

template<typename view_type >
internal_row_offsets_view_type Compadre::NeighborLists< view_type >::_row_offsets

Definition at line 22 of file Compadre_NeighborLists.hpp.


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