Boost logo

Boost :

Subject: Re: [boost] interest in structure of arrays container?
From: Joaquin M López Muñoz (joaquinlopezmunoz_at_[hidden])
Date: 2016-10-18 12:00:26

El 15/10/2016 a las 10:44, Andreas Schäfer escribió:
> Heya,
> On 21:43 Fri 14 Oct , Michael Marcin wrote:
>> Does this already exist somewhere?
> you may want to take a look at LibFlatArray. It's a struct-of-arrays
> library for C++, which also helps with vectorization and address
> generation:

Jumping in a bit late, sorry. Two inconveniences I find with the approaches
I've seen so far are:

* Switching from AOS to SOA requires changing the syntax to access the code
* There is no easy way to quickly experiment with SOA vs. AOS without
rewriting /refactoring code.

I played with these concepts some months ago and came up with some sketches:


The key idea of this approach is to decouple user's code from actual
access to the
data making the former templatized on an Access policy, which can then be
changed from AOS to SOA and back without further modifications. The sketch
also includes a SOA container along this line. With a little more work it is
possible to have not only "pure" AOS and SOA but also mixed layouts where
some data members are given their own cache line while others are grouped
together etc. Switching from one to other quckly would allow for easy
and tuning for the specific access profiles of a given application.

Of course eveything above was a mere experiment very far away from
production-ready code, but maybe someone can take advantage of the ideas
to write something more robust.

Joaquín M López Muñoz

Boost list run by bdawes at, gregod at, cpdaniel at, john at