| 22 | |
| 23 | template<class T, int AlignBytes, class IntT> |
| 24 | inline constexpr IntT aligned_length(IntT ncols) { |
| 25 | static_assert(AlignBytes >= 0, "AlignBytes must be nonnegative"); |
| 26 | assert(ncols > 0); |
| 27 | if (AlignBytes == 0) { return ncols; } |
| 28 | |
| 29 | int16_t align_elements = AlignBytes / sizeof(T); |
| 30 | int16_t remaindr = ncols % align_elements; |
| 31 | if (remaindr > 0) { |
| 32 | ncols += align_elements - remaindr; |
| 33 | } |
| 34 | return ncols; |
| 35 | } |
| 36 | |
| 37 | // helper struct to get Eigen::Map<> MapOptions based on alignment in bytes |
| 38 | template<int AlignBytes> struct _AlignHelper {}; |
nothing calls this directly
no outgoing calls
no test coverage detected