SUNphi  1.0
SUNphi::TensStor< TK, T > Class Template Reference

#include <TensStor.hpp>

Inheritance diagram for SUNphi::TensStor< TK, T >:
SUNphi::ConstrainIsBaseOf< Base, Derived >

Public Types

using Tk = TK
 Tensor Kind mapped.
 

Public Member Functions

template<class... Args, class = ConstrainAreSame<int,Args...>>
T & eval (const Args &...args)
 
template<class... Args, class = ConstrainAreSame<int,Args...>>
const T & eval (const Args &...args) const
 
template<typename TC , TypeIf<(isDynamic< TC >), void * > = nullptr>
constexpr int compSize () const
 Returns the size of a given component in the case it is Dynamic.
 
template<typename TC , TypeIf<(not isDynamic< TC >), void * > = nullptr>
int compSize () const
 Returns the size of a given component in the case it is not Dynamic.
 
template<int Beg, int End>
int compsRangeSize () const
 Returns the total size of the range [Beg, End)
 
template<int... Delims, int... DynComps>
decltype(auto) compsRangeGroupsSize (const IntSeq< Delims... > &, const IntSeq< DynComps... > &mergedDynCompPos) const
 Creat the full list of dynamical sizes of the grouped comps.
 
template<typename Is >
decltype(auto) mergedComps () const
 Returns a components-merged version of the TensStor. More...
 
void alloc ()
 Allocator.
 
template<class... DynSizes, typename = EnableIf<areIntegrals<Unqualified<DynSizes>...>>, class = ConstrainNTypes<TK::nDynamic,DynSizes...>>
 TensStor (DynSizes &&...extDynSizes)
 Constructor (test)
 
 TensStor (const DynSizes< TK::nDynamic > &dynSizes, T *v)
 Constructor taking dynSizes and pointer (test)
 
 TensStor (const TensStor &oth)
 
 ~TensStor ()
 Destructor.
 

Public Attributes

T *& _v
 Debug access to internal storage. More...
 
int totSize
 Debug store size.
 
DynSizes< TK::nDynamic > dynSizes
 Dynamic sizes.
 

Private Types

using type = typename TK::types
 Tuple containg all mapped type.
 

Private Attributes

T * v
 Internal storage.
 
bool created
 Store whether this has been created or is a reference. More...
 

Detailed Description

template<class TK, class T>
class SUNphi::TensStor< TK, T >

Tensor Storage holding the resources for a tensor

The tensor storage allocates and deallocates the memory location where a tensor is materially stored, keeping track of the amount of memory allocated. Facilities to reallocate the memory are provided.

Todo:
many things, including considering a static storage if size is small and statically known

Definition at line 29 of file TensStor.hpp.

Constructor & Destructor Documentation

template<class TK, class T>
SUNphi::TensStor< TK, T >::TensStor ( const TensStor< TK, T > &  oth)
inlineexplicit

Copy constructor (test)

Todo:
improve memcpy, this could be parallelized in many ways, we have to implement memory manager soon

Definition at line 205 of file TensStor.hpp.

Member Function Documentation

template<class TK, class T>
template<class... Args, class = ConstrainAreSame<int,Args...>>
T& SUNphi::TensStor< TK, T >::eval ( const Args &...  args)
inline

Returns a reference to a TensStor given a set of components

Parameters
argsComponents to extract

Definition at line 69 of file TensStor.hpp.

template<class TK, class T>
template<class... Args, class = ConstrainAreSame<int,Args...>>
const T& SUNphi::TensStor< TK, T >::eval ( const Args &...  args) const
inline

Returns a const reference to a TensStor given a set of components

< Components to extract

Definition at line 70 of file TensStor.hpp.

template<class TK, class T>
template<typename Is >
decltype(auto) SUNphi::TensStor< TK, T >::mergedComps ( ) const
inline

Returns a components-merged version of the TensStor.

Returned TensKind

Returned type

Position of the merged dynamical components

Dynamic sizes after merge

Definition at line 135 of file TensStor.hpp.

Member Data Documentation

template<class TK, class T>
T* & SUNphi::TensStor< TK, T >::_v
Initial value:
=
v

Debug access to internal storage.

Definition at line 50 of file TensStor.hpp.

template<class TK, class T>
bool SUNphi::TensStor< TK, T >::created
private
Initial value:
=
false

Store whether this has been created or is a reference.

Definition at line 40 of file TensStor.hpp.


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