JayBeams  0.1
Another project to have fun coding.
aligned_vector.hpp
Go to the documentation of this file.
1 #ifndef jb_fftw_aligned_vector_hpp
2 #define jb_fftw_aligned_vector_hpp
3 
4 #include <jb/fftw/allocator.hpp>
5 #include <vector>
6 
7 namespace jb {
8 namespace fftw {
9 
10 /**
11  * Alias std::vector with properly allocated storage for FFTW3.
12  *
13  * FFTW3 recommends using storage aligned for SIMD operations.
14  * jb::fftw defines an STL allocator to take advantage of the FFTW3
15  * memory allocation functions that guarantee this alignment. This
16  * type alias makes it easy to create std::vectors using the
17  * allocator.
18  *
19  * @tparam T the type stored by the vector
20  */
21 template <typename T>
22 using aligned_vector = std::vector<T, jb::fftw::allocator<T>>;
23 
24 } // namespace fftw
25 } // namespace jb
26 
27 #endif // jb_fftw_aligned_vector_hpp
std::vector< T, jb::fftw::allocator< T > > aligned_vector
Alias std::vector with properly allocated storage for FFTW3.
The top-level namespace for the JayBeams library.
Definition: as_hhmmss.hpp:7