MFEM  v4.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected Attributes | List of all members
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. More...
 
template<typename... Args>
 DeviceTensor (Scalar *_data, Args...args)
 Constructor to initialize a tensor from the Scalar array _data. More...
 
MFEM_HOST_DEVICE DeviceTensor (const DeviceTensor &t)
 Copy constructor. More...
 
 operator Scalar * () const
 Conversion to Scalar *. More...
 
template<typename... Args>
MFEM_HOST_DEVICE Scalar & operator() (Args...args) const
 Const accessor for the data. More...
 
MFEM_HOST_DEVICE Scalar & operator[] (int i) const
 Subscript operator where the tensor is viewed as a 1D array. More...
 

Protected Attributes

int capacity
 
Scalar * data
 
int sizes [Dim]
 

Detailed Description

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

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

Definition at line 80 of file dtensor.hpp.

Constructor & Destructor Documentation

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

Default constructor.

template<int Dim, typename Scalar = double>
template<typename... Args>
mfem::DeviceTensor< Dim, Scalar >::DeviceTensor ( Scalar *  _data,
Args...  args 
)
inline

Constructor to initialize a tensor from the Scalar array _data.

Definition at line 93 of file dtensor.hpp.

template<int Dim, typename Scalar = double>
MFEM_HOST_DEVICE mfem::DeviceTensor< Dim, Scalar >::DeviceTensor ( const DeviceTensor< Dim, Scalar > &  t)
inline

Copy constructor.

Definition at line 103 of file dtensor.hpp.

Member Function Documentation

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

Conversion to Scalar *.

Definition at line 114 of file dtensor.hpp.

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

Const accessor for the data.

Definition at line 118 of file dtensor.hpp.

template<int Dim, typename Scalar = double>
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 125 of file dtensor.hpp.

Member Data Documentation

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

Definition at line 83 of file dtensor.hpp.

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

Definition at line 84 of file dtensor.hpp.

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

Definition at line 85 of file dtensor.hpp.


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