Reference documentation for deal.II version Git 92ca227 2018-05-25 19:47:08 -0500
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

VectorizedArrayoperator= (const double x)
 
double & operator[] (const unsigned int comp)
 
const double & operator[] (const unsigned int comp) const
 
VectorizedArrayoperator+= (const VectorizedArray &vec)
 
VectorizedArrayoperator-= (const VectorizedArray &vec)
 
VectorizedArrayoperator*= (const VectorizedArray &vec)
 
VectorizedArrayoperator/= (const VectorizedArray &vec)
 
void load (const double *ptr)
 
void store (double *ptr) const
 
void streaming_store (double *ptr) const
 
void gather (const double *base_ptr, const unsigned int *offsets)
 
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

VectorizedArray get_sqrt () const
 
VectorizedArray get_abs () const
 
VectorizedArray get_max (const VectorizedArray &other) const
 
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 2191 of file vectorization.h.

Member Function Documentation

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 2204 of file vectorization.h.

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

Access operator.

Definition at line 2214 of file vectorization.h.

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

Constant access operator.

Definition at line 2224 of file vectorization.h.

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

Addition.

Definition at line 2235 of file vectorization.h.

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

Subtraction.

Definition at line 2250 of file vectorization.h.

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

Multiplication.

Definition at line 2265 of file vectorization.h.

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

Division.

Definition at line 2280 of file vectorization.h.

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 2297 of file vectorization.h.

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 2310 of file vectorization.h.

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

Note
Memory must be aligned by 16 bytes.

Definition at line 2320 of file vectorization.h.

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 2341 of file vectorization.h.

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 2361 of file vectorization.h.

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 2380 of file vectorization.h.

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 2393 of file vectorization.h.

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 2411 of file vectorization.h.

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 2424 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 2197 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 2371 of file vectorization.h.


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