deal.II version GIT relicensing-2017-g7ae82fad8b 2024-10-22 19:20:00+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
MemorySpace::MemorySpaceData< T, MemorySpace > Struct Template Reference

#include <deal.II/base/memory_space_data.h>

Inheritance diagram for MemorySpace::MemorySpaceData< T, MemorySpace >:
Inheritance graph
[legend]

Public Member Functions

 MemorySpaceData ()
 
void copy_to (T *begin, const std::size_t n_elements)
 
void copy_from (const T *begin, const std::size_t n_elements)
 

Public Attributes

Kokkos::View< T *, Kokkos::HostSpace > values_host_buffer
 
Kokkos::View< T *, typename MemorySpace::kokkos_space > values
 
std::shared_ptr< T > values_sm_ptr
 
std::vector< ArrayView< const T > > values_sm
 

Detailed Description

template<typename T, typename MemorySpace>
struct MemorySpace::MemorySpaceData< T, MemorySpace >

Structure which stores data on the host or the device depending on the template parameter MemorySpace. Valid choices are MemorySpace::Host and MemorySpace::Default. The data is copied into the structure which then owns the data and will release the memory when the destructor is called.

Definition at line 43 of file memory_space_data.h.

Constructor & Destructor Documentation

◆ MemorySpaceData()

template<typename T , typename MemorySpace >
MemorySpace::MemorySpaceData< T, MemorySpace >::MemorySpaceData ( )

Member Function Documentation

◆ copy_to()

template<typename T , typename MemorySpace >
void MemorySpace::MemorySpaceData< T, MemorySpace >::copy_to ( T *  begin,
const std::size_t  n_elements 
)

Copy the class member values to begin. If the data is on the device it is moved to the host.

◆ copy_from()

template<typename T , typename MemorySpace >
void MemorySpace::MemorySpaceData< T, MemorySpace >::copy_from ( const T *  begin,
const std::size_t  n_elements 
)

Copy the data in begin to the class member values. The pointer begin must be on the host.

Member Data Documentation

◆ values_host_buffer

template<typename T , typename MemorySpace >
Kokkos::View<T *, Kokkos::HostSpace> MemorySpace::MemorySpaceData< T, MemorySpace >::values_host_buffer

Kokkos View owning a host buffer used for MPI communication.

Definition at line 66 of file memory_space_data.h.

◆ values

template<typename T , typename MemorySpace >
Kokkos::View<T *, typename MemorySpace::kokkos_space> MemorySpace::MemorySpaceData< T, MemorySpace >::values

Kokkos View owning the data on the device (unless values_sm_ptr is used).

Definition at line 74 of file memory_space_data.h.

◆ values_sm_ptr

template<typename T , typename MemorySpace >
std::shared_ptr<T> MemorySpace::MemorySpaceData< T, MemorySpace >::values_sm_ptr

Pointer to data on the host. The pointer points to the same data as values when using shared memory and the memory space is MemorySpace::Host. Otherwise it is not set.

Definition at line 86 of file memory_space_data.h.

◆ values_sm

template<typename T , typename MemorySpace >
std::vector<ArrayView<const T> > MemorySpace::MemorySpaceData< T, MemorySpace >::values_sm

Pointers to the data of the processes sharing the same memory.

Definition at line 91 of file memory_space_data.h.


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