Reference documentation for deal.II version 9.3.3
\(\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\}}\)
Public Member Functions | Public Attributes | List of all members
MemorySpace::MemorySpaceData< Number, MemorySpace > Struct Template Reference

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

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

Public Member Functions

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

Public Attributes

std::unique_ptr< Number[], std::function< void(Number *)> > values
 
std::unique_ptr< Number[]> values_dev
 
std::vector< ArrayView< const Number > > values_sm
 

Detailed Description

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

Data structure

Definition at line 38 of file memory_space_data.h.

Constructor & Destructor Documentation

◆ MemorySpaceData()

template<typename Number , typename MemorySpace >
MemorySpace::MemorySpaceData< Number, MemorySpace >::MemorySpaceData ( )
inline

Definition at line 40 of file memory_space_data.h.

Member Function Documentation

◆ copy_to()

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

Copy the active data (values for Host and values_dev for CUDA) to begin. If the data is on the device it is moved to the host.

Definition at line 52 of file memory_space_data.h.

◆ copy_from()

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

Copy the data in begin to the active data of the structure (values for Host and values_dev for CUDA). The pointer begin must be on the host.

Definition at line 63 of file memory_space_data.h.

Member Data Documentation

◆ values

template<typename Number , typename MemorySpace >
std::unique_ptr<Number[], std::function<void(Number *)> > MemorySpace::MemorySpaceData< Number, MemorySpace >::values

Pointer to data on the host.

Definition at line 72 of file memory_space_data.h.

◆ values_dev

template<typename Number , typename MemorySpace >
std::unique_ptr<Number[]> MemorySpace::MemorySpaceData< Number, MemorySpace >::values_dev

Pointer to data on the device.

Definition at line 77 of file memory_space_data.h.

◆ values_sm

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

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

Definition at line 82 of file memory_space_data.h.


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