diff --git a/include/aare/NDView.hpp b/include/aare/NDView.hpp index 0aa4f78..98d7224 100644 --- a/include/aare/NDView.hpp +++ b/include/aare/NDView.hpp @@ -93,6 +93,12 @@ class NDView : public ArrayExpr, Ndim> { : buffer_(buffer), strides_(c_strides(shape)), shape_(shape), size_(std::accumulate(std::begin(shape), std::end(shape), 1, std::multiplies<>())) {} + + // stride-aware constructor + NDView(T* buffer, std::array shape, std::array strides) + : buffer_(buffer), shape_(shape), strides_(strides), + size_(std::accumulate(std::begin(shape), std::end(shape), 1, + std::multiplies<>())) {} template std::enable_if_t operator()(Ix... index) {