Re: [eigen] Tensor Module: Continuous Memory?

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


That is correct Gabriel the data is stored in a single, fixed size array, the data is also aligned in case you have vectorized CPU insructions (SSE or AVX). I'm only confident for fixed sized objects, it may be different if you use dynamically sized ones.

An aside, all of the values in an array are contiGuous in memory - meaning their addresses are sequential; a chunk of aligned memory (2 or 4 doubles) is truly contiNuous so that the CPU can "blindly" operate on a whole chunk in one cycle.

On Wed, 7 Oct 2015 14:51:03 +0200
Gabriel <gnuetzi@xxxxxxxxx> wrote:

> Hello =)
> 
> Trying to use the Tensor module to store some 3d Matrix and save it into 
> a HDF5 file.
> 
> Question:
> 
> When I do
> 
> Tensor<double,3> *a*(19,4,3);
> 
> is *a* then guaranteed to be continuous in memory as it is the case for 
> all DenseBase<>  objects? As far as I am aware off :-)
> 
> 
> Thanks !
> 
> BR Gabriel Nützi
> 
> 
> 


-- 
Nathan Yonkee <nathan.yonkee@xxxxxxxxx>



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/