| 760 | |
| 761 | template<typename ShapeType_, typename StorageType_> |
| 762 | LIBRAPID_ALWAYS_INLINE auto |
| 763 | ArrayContainer<ShapeType_, StorageType_>::packet(size_t index) const -> Packet { |
| 764 | auto ptr = LIBRAPID_ASSUME_ALIGNED(m_storage.begin()); |
| 765 | |
| 766 | #if defined(LIBRAPID_NATIVE_ARCH) |
| 767 | LIBRAPID_ASSERT( |
| 768 | reinterpret_cast<uintptr_t>(ptr) % typetraits::TypeInfo<Scalar>::packetWidth == 0, |
| 769 | "ArrayContainer::packet called on unaligned storage"); |
| 770 | |
| 771 | return xsimd::load_aligned(ptr + index); |
| 772 | #else |
| 773 | return xsimd::load_unaligned(ptr + index); |
| 774 | #endif |
| 775 | } |
| 776 | |
| 777 | template<typename ShapeType_, typename StorageType_> |
| 778 | LIBRAPID_ALWAYS_INLINE auto |