diff --git a/dpctl/tensor/libtensor/include/utils/offset_utils.hpp b/dpctl/tensor/libtensor/include/utils/offset_utils.hpp index 1438def12a..b8ae599142 100644 --- a/dpctl/tensor/libtensor/include/utils/offset_utils.hpp +++ b/dpctl/tensor/libtensor/include/utils/offset_utils.hpp @@ -617,8 +617,8 @@ struct NthStrideOffset template struct FixedDimStridedIndexer { - FixedDimStridedIndexer(const std::array _shape, - const std::array _strides, + FixedDimStridedIndexer(const std::array &_shape, + const std::array &_strides, ssize_t _offset) : _ind(_shape), strides(_strides), starting_offset(_offset) { @@ -642,15 +642,15 @@ template struct FixedDimStridedIndexer private: dpctl::tensor::strides::CIndexer_array _ind; - const std::array strides; + std::array strides; ssize_t starting_offset; }; template struct TwoOffsets_FixedDimStridedIndexer { - TwoOffsets_FixedDimStridedIndexer(const std::array _shape, - const std::array _strides1, - const std::array _strides2, + TwoOffsets_FixedDimStridedIndexer(const std::array &_shape, + const std::array &_strides1, + const std::array &_strides2, ssize_t _offset1, ssize_t _offset2) : _ind(_shape), strides1(_strides1), strides2(_strides2), @@ -684,21 +684,22 @@ template struct TwoOffsets_FixedDimStridedIndexer private: dpctl::tensor::strides::CIndexer_array _ind; - const std::array strides1; - const std::array strides2; + std::array strides1; + std::array strides2; ssize_t starting_offset1; ssize_t starting_offset2; }; template struct ThreeOffsets_FixedDimStridedIndexer { - ThreeOffsets_FixedDimStridedIndexer(const std::array _shape, - const std::array _strides1, - const std::array _strides2, - const std::array _strides3, - ssize_t _offset1, - ssize_t _offset2, - ssize_t _offset3) + ThreeOffsets_FixedDimStridedIndexer( + const std::array &_shape, + const std::array &_strides1, + const std::array &_strides2, + const std::array &_strides3, + ssize_t _offset1, + ssize_t _offset2, + ssize_t _offset3) : _ind(_shape), strides1(_strides1), strides2(_strides2), strides3(_strides3), starting_offset1(_offset1), starting_offset2(_offset2), starting_offset3(_offset3) @@ -738,9 +739,9 @@ template struct ThreeOffsets_FixedDimStridedIndexer private: dpctl::tensor::strides::CIndexer_array _ind; - const std::array strides1; - const std::array strides2; - const std::array strides3; + std::array strides1; + std::array strides2; + std::array strides3; ssize_t starting_offset1; ssize_t starting_offset2; ssize_t starting_offset3;