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

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

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[], decltype(&std::free)> values
 
std::unique_ptr< Number[]> values_dev
 

Detailed Description

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

Data structure

Definition at line 54 of file memory_space.h.

Constructor & Destructor Documentation

◆ MemorySpaceData()

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

Definition at line 56 of file memory_space.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 68 of file memory_space.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 79 of file memory_space.h.

Member Data Documentation

◆ values

template<typename Number , typename MemorySpace >
std::unique_ptr<Number[], decltype(&std::free)> MemorySpace::MemorySpaceData< Number, MemorySpace >::values

Pointer to data on the host.

Definition at line 88 of file memory_space.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 93 of file memory_space.h.


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