JayBeams  0.1
Another project to have fun coding.
aligned_multi_array.hpp
Go to the documentation of this file.
1 #ifndef jb_fftw_aligned_multi_array_hpp
2 #define jb_fftw_aligned_multi_array_hpp
3 
4 #include <jb/fftw/allocator.hpp>
5 #include <boost/multi_array.hpp>
6 
7 namespace jb {
8 namespace fftw {
9 
10 /**
11  * Alias boost::multi_array 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 boost::multi_arrays using the
17  * allocator.
18  *
19  * @tparam value_type the type stored by the multi_array
20  * @tparam num_dims the number of dimensions in the multi array
21  */
22 template <typename value_type, std::size_t num_dims>
23 using aligned_multi_array =
24  boost::multi_array<value_type, num_dims, jb::fftw::allocator<value_type>>;
25 
26 } // namespace fftw
27 } // namespace jb
28 
29 #endif // jb_fftw_aligned_multi_array_hpp
boost::multi_array< value_type, num_dims, jb::fftw::allocator< value_type > > aligned_multi_array
Alias boost::multi_array with properly allocated storage for FFTW3.
The top-level namespace for the JayBeams library.
Definition: as_hhmmss.hpp:7