Re: [eigen] Tensor Module: Continuous Memory? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Tensor Module: Continuous Memory?
- From: Nathan Yonkee <nathan.yonkee@xxxxxxxxx>
- Date: Wed, 7 Oct 2015 10:31:55 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; bh=pS8WVcS8N6rLb0SSEMFUi0/tQ8Vo7DR/jo6U9S8PaD4=; b=bOy4rooVUNxM7fjbFr4yf62459ZUWGdp2JtIA1wrXpZqLfFemlOoDhKDw6mdeZsI/i 2hr2MfPinQh8tTssbEa4kEsZSf9YmBS1FxNCbT1s/f2s/6plYLsWs7xN8GhYGSRYXPy0 4Pj99oZBCWqXyJWa2If/YDzdO5R0erw1f/LwHd4ZKy4v7Jg2LmnvfKiK/S3Dj606I/rV D924oPPqlDy4rFBASXe09Pm/zfRVQqIcuk5drYd1mTfXTuAHggs5kF9Yk3gntnYaujYT Crf+rukp2jY5hJigavw1hRX/1ixFBFONBwCAykrnljb4B8iEa+aM/BnyN7XJPgppFXW7 SFNg==
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>