Reference documentation for deal.II version Git 05e4468 2017-09-21 10:18:23 +0200
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Friends | List of all members
VectorizedArray< double > Class Template Reference

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

Public Member Functions

DEAL_II_ALWAYS_INLINE VectorizedArrayoperator= (const double x)
 
DEAL_II_ALWAYS_INLINE double & operator[] (const unsigned int comp)
 
DEAL_II_ALWAYS_INLINE const double & operator[] (const unsigned int comp) const
 
DEAL_II_ALWAYS_INLINE VectorizedArrayoperator+= (const VectorizedArray &vec)
 
DEAL_II_ALWAYS_INLINE VectorizedArrayoperator-= (const VectorizedArray &vec)
 
DEAL_II_ALWAYS_INLINE VectorizedArrayoperator*= (const VectorizedArray &vec)
 
DEAL_II_ALWAYS_INLINE VectorizedArrayoperator/= (const VectorizedArray &vec)
 
DEAL_II_ALWAYS_INLINE void load (const double *ptr)
 
DEAL_II_ALWAYS_INLINE void store (double *ptr) const
 
DEAL_II_ALWAYS_INLINE void gather (const double *base_ptr, const unsigned int *offsets)
 
DEAL_II_ALWAYS_INLINE void scatter (const unsigned int *offsets, double *base_ptr) const
 

Public Attributes

__m128d data
 

Static Public Attributes

static const unsigned int n_array_elements = 2
 

Private Member Functions

DEAL_II_ALWAYS_INLINE VectorizedArray get_sqrt () const
 
DEAL_II_ALWAYS_INLINE VectorizedArray get_abs () const
 
DEAL_II_ALWAYS_INLINE VectorizedArray get_max (const VectorizedArray &other) const
 
DEAL_II_ALWAYS_INLINE VectorizedArray get_min (const VectorizedArray &other) const
 

Friends

template<typename Number2 >
VectorizedArray< Number2 > std::sqrt (const VectorizedArray< Number2 > &)
 

Detailed Description

template<>
class VectorizedArray< double >

Specialization for double and SSE2.

Definition at line 2051 of file vectorization.h.

Member Function Documentation

DEAL_II_ALWAYS_INLINE VectorizedArray& VectorizedArray< double >::operator= ( const double  x)
inline

This function can be used to set all data fields to a given scalar.

Definition at line 2064 of file vectorization.h.

DEAL_II_ALWAYS_INLINE double& VectorizedArray< double >::operator[] ( const unsigned int  comp)
inline

Access operator.

Definition at line 2075 of file vectorization.h.

DEAL_II_ALWAYS_INLINE const double& VectorizedArray< double >::operator[] ( const unsigned int  comp) const
inline

Constant access operator.

Definition at line 2086 of file vectorization.h.

DEAL_II_ALWAYS_INLINE VectorizedArray& VectorizedArray< double >::operator+= ( const VectorizedArray< double > &  vec)
inline

Addition.

Definition at line 2097 of file vectorization.h.

DEAL_II_ALWAYS_INLINE VectorizedArray& VectorizedArray< double >::operator-= ( const VectorizedArray< double > &  vec)
inline

Subtraction.

Definition at line 2112 of file vectorization.h.

DEAL_II_ALWAYS_INLINE VectorizedArray& VectorizedArray< double >::operator*= ( const VectorizedArray< double > &  vec)
inline

Multiplication.

Definition at line 2127 of file vectorization.h.

DEAL_II_ALWAYS_INLINE VectorizedArray& VectorizedArray< double >::operator/= ( const VectorizedArray< double > &  vec)
inline

Division.

Definition at line 2142 of file vectorization.h.

DEAL_II_ALWAYS_INLINE void VectorizedArray< double >::load ( const double *  ptr)
inline

Load n_array_elements from memory into the calling class, starting at the given address. The memory need not be aligned by 16 bytes, as opposed to casting a double address to VectorizedArray<double>*.

Definition at line 2158 of file vectorization.h.

DEAL_II_ALWAYS_INLINE void VectorizedArray< double >::store ( double *  ptr) const
inline

Write the content of the calling class into memory in form of n_array_elements to the given address. The memory need not be aligned by 16 bytes, as opposed to casting a double address to VectorizedArray<double>*.

Definition at line 2170 of file vectorization.h.

DEAL_II_ALWAYS_INLINE void VectorizedArray< double >::gather ( const double *  base_ptr,
const unsigned int *  offsets 
)
inline

Load n_array_elements from memory into the calling class, starting at the given address and with given offsets, each entry from the offset providing one element of the vectorized array.

This operation corresponds to the following code (but uses a more efficient implementation in case the hardware allows for that):

for (unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
this->operator[](v) = base_ptr[offsets[v]];

Definition at line 2188 of file vectorization.h.

DEAL_II_ALWAYS_INLINE void VectorizedArray< double >::scatter ( const unsigned int *  offsets,
double *  base_ptr 
) const
inline

Write the content of the calling class into memory in form of n_array_elements to the given address and the given offsets, filling the elements of the vectorized array into each offset.

This operation corresponds to the following code (but uses a more efficient implementation in case the hardware allows for that):

for (unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
base_ptr[offsets[v]] = this->operator[](v);

Definition at line 2208 of file vectorization.h.

DEAL_II_ALWAYS_INLINE VectorizedArray VectorizedArray< double >::get_sqrt ( ) const
inlineprivate

Return the square root of this field. Not for use in user code. Use sqrt(x) instead.

Definition at line 2228 of file vectorization.h.

DEAL_II_ALWAYS_INLINE VectorizedArray VectorizedArray< double >::get_abs ( ) const
inlineprivate

Return the absolute value of this field. Not for use in user code. Use abs(x) instead.

Definition at line 2241 of file vectorization.h.

DEAL_II_ALWAYS_INLINE VectorizedArray VectorizedArray< double >::get_max ( const VectorizedArray< double > &  other) const
inlineprivate

Return the component-wise maximum of this field and another one. Not for use in user code. Use max(x,y) instead.

Definition at line 2259 of file vectorization.h.

DEAL_II_ALWAYS_INLINE VectorizedArray VectorizedArray< double >::get_min ( const VectorizedArray< double > &  other) const
inlineprivate

Return the component-wise minimum of this field and another one. Not for use in user code. Use min(x,y) instead.

Definition at line 2272 of file vectorization.h.

Friends And Related Function Documentation

template<typename Number2 >
VectorizedArray<Number2> std::sqrt ( const VectorizedArray< Number2 > &  )
friend

Make a few functions friends.

Member Data Documentation

const unsigned int VectorizedArray< double >::n_array_elements = 2
static

This gives the number of vectors collected in this class.

Definition at line 2057 of file vectorization.h.

__m128d VectorizedArray< double >::data

Actual data field. Since this class represents a POD data type, it remains public.

Definition at line 2219 of file vectorization.h.


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