Reference documentation for deal.II version 9.6.0
\(\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
MemorySpace::MemorySpaceData< T, MemorySpace > Struct Template Reference

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

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, MemorySpace::Default, and MemorySpace::CUDA (if CUDA was enabled in deal.II). 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 44 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 67 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 75 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 87 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 92 of file memory_space_data.h.


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