From 2520fe54218419f41b64a5f7bc6f9288e31b1207 Mon Sep 17 00:00:00 2001 From: Bimal Gaudel Date: Sun, 17 Dec 2023 16:34:25 -0500 Subject: [PATCH] Use .data() method to access elements by ordinal in tensor_reduce function. --- src/TiledArray/tensor/kernels.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TiledArray/tensor/kernels.h b/src/TiledArray/tensor/kernels.h index 97f7dc1e5b..f1ec6d99c5 100644 --- a/src/TiledArray/tensor/kernels.h +++ b/src/TiledArray/tensor/kernels.h @@ -787,8 +787,8 @@ auto tensor_reduce(ReduceOp&& reduce_op, JoinOp&& join_op, auto result = identity; for (decltype(tensor1.range().volume()) ord = 0ul; ord < volume; ++ord) { auto temp = - tensor_reduce(reduce_op, join_op, identity, tensor1.at_ordinal(ord), - tensors.at_ordinal(ord)...); + tensor_reduce(reduce_op, join_op, identity, tensor1.data()[ord], + tensors.data()[ord]...); join_op(result, temp); }