MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::DeviceTensor< Dim, Scalar > Class Template Reference

A basic generic Tensor class, appropriate for use on the GPU. More...

#include <dtensor.hpp>

Public Member Functions

 DeviceTensor ()=delete
 Default constructor.
 
template<typename... Args>
MFEM_HOST_DEVICE DeviceTensor (Scalar *data_, Args... args)
 Constructor to initialize a tensor from the Scalar array data_.
 
 DeviceTensor (const DeviceTensor &)=default
 Copy constructor (default)
 
DeviceTensoroperator= (const DeviceTensor &)=default
 Copy assignment (default)
 
MFEM_HOST_DEVICE operator Scalar * () const
 Conversion to Scalar *.
 
template<typename... Args>
MFEM_HOST_DEVICE Scalar & operator() (Args... args) const
 Const accessor for the data.
 
MFEM_HOST_DEVICE Scalar & operator[] (int i) const
 Subscript operator where the tensor is viewed as a 1D array.
 

Protected Attributes

int capacity
 
Scalar * data
 
int sizes [Dim]
 

Detailed Description

template<int Dim, typename Scalar = real_t>
class mfem::DeviceTensor< Dim, Scalar >

A basic generic Tensor class, appropriate for use on the GPU.

Definition at line 81 of file dtensor.hpp.

Constructor & Destructor Documentation

◆ DeviceTensor() [1/3]

template<int Dim, typename Scalar = real_t>
mfem::DeviceTensor< Dim, Scalar >::DeviceTensor ( )
delete

Default constructor.

◆ DeviceTensor() [2/3]

template<int Dim, typename Scalar = real_t>
template<typename... Args>
MFEM_HOST_DEVICE mfem::DeviceTensor< Dim, Scalar >::DeviceTensor ( Scalar * data_,
Args... args )
inline

Constructor to initialize a tensor from the Scalar array data_.

Definition at line 94 of file dtensor.hpp.

◆ DeviceTensor() [3/3]

template<int Dim, typename Scalar = real_t>
mfem::DeviceTensor< Dim, Scalar >::DeviceTensor ( const DeviceTensor< Dim, Scalar > & )
default

Copy constructor (default)

Member Function Documentation

◆ operator Scalar *()

template<int Dim, typename Scalar = real_t>
MFEM_HOST_DEVICE mfem::DeviceTensor< Dim, Scalar >::operator Scalar * ( ) const
inline

Conversion to Scalar *.

Definition at line 110 of file dtensor.hpp.

◆ operator()()

template<int Dim, typename Scalar = real_t>
template<typename... Args>
MFEM_HOST_DEVICE Scalar & mfem::DeviceTensor< Dim, Scalar >::operator() ( Args... args) const
inline

Const accessor for the data.

Definition at line 114 of file dtensor.hpp.

◆ operator=()

template<int Dim, typename Scalar = real_t>
DeviceTensor & mfem::DeviceTensor< Dim, Scalar >::operator= ( const DeviceTensor< Dim, Scalar > & )
default

Copy assignment (default)

◆ operator[]()

template<int Dim, typename Scalar = real_t>
MFEM_HOST_DEVICE Scalar & mfem::DeviceTensor< Dim, Scalar >::operator[] ( int i) const
inline

Subscript operator where the tensor is viewed as a 1D array.

Definition at line 121 of file dtensor.hpp.

Member Data Documentation

◆ capacity

template<int Dim, typename Scalar = real_t>
int mfem::DeviceTensor< Dim, Scalar >::capacity
protected

Definition at line 84 of file dtensor.hpp.

◆ data

template<int Dim, typename Scalar = real_t>
Scalar* mfem::DeviceTensor< Dim, Scalar >::data
protected

Definition at line 85 of file dtensor.hpp.

◆ sizes

template<int Dim, typename Scalar = real_t>
int mfem::DeviceTensor< Dim, Scalar >::sizes[Dim]
protected

Definition at line 86 of file dtensor.hpp.


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