On 10/26/2016 10:00 AM, Michael Marcin wrote: [snip]
The sse emitter test used an aligned_allocator to guarantee 16 byte alignment for the std::vector data.
template< typename T > using sse_vector = vector
>;
I assume that vector<T>'s data is allocated with new,
and new, IIUC, guarantees maximum alignment; hence,
boost::alignment::is_aligned(std::vector<T>::data(),16)
should always be true. What am I missing?
BTW, see the new push:
https://github.com/cppljevans/soa/commit/ea28ff814c8c1ea879fa5ac2453c12fc382...
I've *not tested* it in:
https://github.com/cppljevans/soa/blob/master/soa_compare.benchmark.cpp
but I think it should work. IOW, instead of:
sse_vector<float> position_x;
sse_vector<float> position_y;
sse_vector<float> position_z;
sse_vector<float> velocity_x;
sse_vector<float> velocity_y;
sse_vector<float> velocity_z;
sse_vector<float> acceleration_x;
sse_vector<float> acceleration_y;
sse_vector<float> acceleration_z;
vector<float2> size;
vector<float4> color;
sse_vector<float> energy;
vector<char> alive;
I think you could use:
soa_block
<
type_align