Skip to content

Commit e3f4160

Browse files
Use const references for read-use-only vectors
1 parent c521e41 commit e3f4160

File tree

1 file changed

+6
-6
lines changed
  • dpctl/tensor/libtensor/source/linalg_functions

1 file changed

+6
-6
lines changed

dpctl/tensor/libtensor/source/linalg_functions/dot.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,14 +296,14 @@ py_dot(const dpctl::tensor::usm_ndarray &x1,
296296
const char *x2_data = x2.get_data();
297297
char *dst_data = dst.get_data();
298298

299-
auto x1_shape_vec = x1.get_shape_vector();
300-
auto x1_strides_vec = x1.get_strides_vector();
299+
const auto &x1_shape_vec = x1.get_shape_vector();
300+
const auto &x1_strides_vec = x1.get_strides_vector();
301301

302-
auto x2_shape_vec = x2.get_shape_vector();
303-
auto x2_strides_vec = x2.get_strides_vector();
302+
const auto &x2_shape_vec = x2.get_shape_vector();
303+
const auto &x2_strides_vec = x2.get_strides_vector();
304304

305-
auto dst_shape_vec = dst.get_shape_vector();
306-
auto dst_strides_vec = dst.get_strides_vector();
305+
const auto &dst_shape_vec = dst.get_shape_vector();
306+
const auto &dst_strides_vec = dst.get_strides_vector();
307307

308308
bool is_x1_c_contig = x1.is_c_contiguous();
309309
bool is_x1_f_contig = x1.is_f_contiguous();

0 commit comments

Comments
 (0)