Nektar++
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
tinysimd::scalarT< T, typename > Struct Template Reference

#include <scalar.hpp>

Public Types

using scalarType = T
 
using vectorType = scalarType
 
using scalarArray = scalarType[width]
 

Public Member Functions

 scalarT ()=default
 
 scalarT (const scalarT &rhs)=default
 
 scalarT (const vectorType &rhs)
 
void store (scalarType *p) const
 
template<class flag >
void store (scalarType *p, flag) const
 
void load (const scalarType *p)
 
template<class flag >
void load (const scalarType *p, flag)
 
void broadcast (const scalarType rhs)
 
template<typename U , typename = typename std::enable_if< std::is_integral<U>::value>::type>
void gather (const scalarType *p, const scalarT< U > &indices)
 
template<typename U , typename = typename std::enable_if< std::is_integral<U>::value>::type>
void scatter (scalarType *p, const scalarT< U > &indices) const
 
void fma (const scalarT< T > &a, const scalarT< T > &b)
 
scalarType operator[] (size_t) const
 
scalarTypeoperator[] (size_t)
 
void operator+= (scalarT< T > rhs)
 
void operator-= (scalarT< T > rhs)
 
void operator*= (scalarT< T > rhs)
 
void operator/= (scalarT< T > rhs)
 

Public Attributes

vectorType _data
 

Static Public Attributes

static constexpr unsigned int width = 1
 
static constexpr unsigned int alignment = sizeof(T)
 

Detailed Description

template<typename T, typename>
struct tinysimd::scalarT< T, typename >

Definition at line 89 of file scalar.hpp.

Member Typedef Documentation

◆ scalarArray

template<typename T , typename >
using tinysimd::scalarT< T, typename >::scalarArray = scalarType[width]

Definition at line 96 of file scalar.hpp.

◆ scalarType

template<typename T , typename >
using tinysimd::scalarT< T, typename >::scalarType = T

Definition at line 94 of file scalar.hpp.

◆ vectorType

template<typename T , typename >
using tinysimd::scalarT< T, typename >::vectorType = scalarType

Definition at line 95 of file scalar.hpp.

Constructor & Destructor Documentation

◆ scalarT() [1/3]

template<typename T , typename >
tinysimd::scalarT< T, typename >::scalarT ( )
inlinedefault

◆ scalarT() [2/3]

template<typename T , typename >
tinysimd::scalarT< T, typename >::scalarT ( const scalarT< T, typename > &  rhs)
inlinedefault

◆ scalarT() [3/3]

template<typename T , typename >
tinysimd::scalarT< T, typename >::scalarT ( const vectorType rhs)
inline

Definition at line 104 of file scalar.hpp.

104 : _data(rhs){}
vectorType _data
Definition: scalar.hpp:99

Member Function Documentation

◆ broadcast()

template<typename T , typename >
void tinysimd::scalarT< T, typename >::broadcast ( const scalarType  rhs)
inline

Definition at line 130 of file scalar.hpp.

131  {
132  _data = rhs;
133  }

References tinysimd::scalarT< T, typename >::_data.

◆ fma()

template<typename T , typename >
void tinysimd::scalarT< T, typename >::fma ( const scalarT< T > &  a,
const scalarT< T > &  b 
)
inline

Definition at line 152 of file scalar.hpp.

153  {
154  _data += a._data * b._data;
155  }

References tinysimd::scalarT< T, typename >::_data.

◆ gather()

template<typename T , typename >
template<typename U , typename = typename std::enable_if< std::is_integral<U>::value>::type>
void tinysimd::scalarT< T, typename >::gather ( const scalarType p,
const scalarT< U > &  indices 
)
inline

Definition at line 137 of file scalar.hpp.

138  {
139  _data = *(p + indices._data);
140  }

References tinysimd::scalarT< T, typename >::_data, and CellMLToNektar.cellml_metadata::p.

◆ load() [1/2]

template<typename T , typename >
void tinysimd::scalarT< T, typename >::load ( const scalarType p)
inline

Definition at line 119 of file scalar.hpp.

120  {
121  _data = *p;
122  }

References tinysimd::scalarT< T, typename >::_data, and CellMLToNektar.cellml_metadata::p.

◆ load() [2/2]

template<typename T , typename >
template<class flag >
void tinysimd::scalarT< T, typename >::load ( const scalarType p,
flag   
)
inline

Definition at line 125 of file scalar.hpp.

126  {
127  _data = *p;
128  }

References tinysimd::scalarT< T, typename >::_data, and CellMLToNektar.cellml_metadata::p.

◆ operator*=()

template<typename T , typename >
void tinysimd::scalarT< T, typename >::operator*= ( scalarT< T >  rhs)
inline

Definition at line 179 of file scalar.hpp.

180  {
181  _data *= rhs._data;
182  }

References tinysimd::scalarT< T, typename >::_data.

◆ operator+=()

template<typename T , typename >
void tinysimd::scalarT< T, typename >::operator+= ( scalarT< T >  rhs)
inline

Definition at line 169 of file scalar.hpp.

170  {
171  _data += rhs._data;
172  }

References tinysimd::scalarT< T, typename >::_data.

◆ operator-=()

template<typename T , typename >
void tinysimd::scalarT< T, typename >::operator-= ( scalarT< T >  rhs)
inline

Definition at line 174 of file scalar.hpp.

175  {
176  _data -= rhs._data;
177  }

References tinysimd::scalarT< T, typename >::_data.

◆ operator/=()

template<typename T , typename >
void tinysimd::scalarT< T, typename >::operator/= ( scalarT< T >  rhs)
inline

Definition at line 184 of file scalar.hpp.

185  {
186  _data /= rhs._data;
187  }

References tinysimd::scalarT< T, typename >::_data.

◆ operator[]() [1/2]

template<typename T , typename >
scalarType& tinysimd::scalarT< T, typename >::operator[] ( size_t  )
inline

Definition at line 163 of file scalar.hpp.

164  {
165  return _data;
166  }

References tinysimd::scalarT< T, typename >::_data.

◆ operator[]() [2/2]

template<typename T , typename >
scalarType tinysimd::scalarT< T, typename >::operator[] ( size_t  ) const
inline

Definition at line 158 of file scalar.hpp.

159  {
160  return _data;
161  }

References tinysimd::scalarT< T, typename >::_data.

◆ scatter()

template<typename T , typename >
template<typename U , typename = typename std::enable_if< std::is_integral<U>::value>::type>
void tinysimd::scalarT< T, typename >::scatter ( scalarType p,
const scalarT< U > &  indices 
) const
inline

Definition at line 144 of file scalar.hpp.

145  {
146  p += indices._data;
147  *p = _data;
148  }

References tinysimd::scalarT< T, typename >::_data, and CellMLToNektar.cellml_metadata::p.

◆ store() [1/2]

template<typename T , typename >
void tinysimd::scalarT< T, typename >::store ( scalarType p) const
inline

Definition at line 107 of file scalar.hpp.

108  {
109  *p = _data;
110  }

References tinysimd::scalarT< T, typename >::_data, and CellMLToNektar.cellml_metadata::p.

◆ store() [2/2]

template<typename T , typename >
template<class flag >
void tinysimd::scalarT< T, typename >::store ( scalarType p,
flag   
) const
inline

Definition at line 113 of file scalar.hpp.

114  {
115  *p = _data;
116  }

References tinysimd::scalarT< T, typename >::_data, and CellMLToNektar.cellml_metadata::p.

Member Data Documentation

◆ _data

template<typename T , typename >
vectorType tinysimd::scalarT< T, typename >::_data

◆ alignment

template<typename T , typename >
constexpr unsigned int tinysimd::scalarT< T, typename >::alignment = sizeof(T)
staticconstexpr

Definition at line 92 of file scalar.hpp.

◆ width

template<typename T , typename >
constexpr unsigned int tinysimd::scalarT< T, typename >::width = 1
staticconstexpr

Definition at line 91 of file scalar.hpp.