ATLAS Offline Software
Namespaces | Typedefs
aligned_vector.h File Reference

std::vector with extra alignment. More...

#include "boost/align/aligned_allocator.hpp"
#include <vector>
Include dependency graph for aligned_vector.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 CxxUtils
 

Typedefs

template<class T , size_t Alignment = 1>
using CxxUtils::aligned_vector = std::vector< T, boost::alignment::aligned_allocator< T, Alignment > >
 A std::vector with extra alignment. More...
 
template<class T >
using CxxUtils::vec_aligned_vector = aligned_vector< T, 64 >
 A std::vector with alignment sufficient for any vector instructions on this platform. More...
 

Detailed Description

std::vector with extra alignment.

Author
scott snyder snyde.nosp@m.r@bn.nosp@m.l.gov
Date
Feb, 2020 The payload of a std::vector<T> is aligned appropriately for T. However, there are some times when one would like to force a larger alignment, for example if the vector is being used to hold data to be processed with vector instructions. aligned_vector defined here is a std::vector with higher alignment. vec_aligned_vector is a vector that should be sufficiently aligned for any vector instructions on this platform.

Definition in file aligned_vector.h.