From 208e44c979bbb5a0ecb4b74b834b93396e48e5dd Mon Sep 17 00:00:00 2001 From: Charles Schlosser Date: Wed, 19 Jul 2023 16:48:07 +0000 Subject: [PATCH] fix warnings in tensorreduction and memory --- Eigen/src/Core/util/Memory.h | 4 ++-- unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index 2bf508440..3aea7df51 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h @@ -297,14 +297,14 @@ template EIGEN_DEVICE_FUNC inline T* default_construct_elements_of_a std::size_t i=0; EIGEN_TRY { - for (i = 0; i < size; ++i) ::new (ptr + i) T; - return ptr; + for (i = 0; i < size; ++i) ::new (ptr + i) T; } EIGEN_CATCH(...) { destruct_elements_of_array(ptr, i); EIGEN_THROW; } + return ptr; } /** \internal Copy-constructs the elements of an array. diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h b/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h index ff7c5a133..f1f4eaab7 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h @@ -594,7 +594,7 @@ static const bool RunningOnGPU = false; m_fastOutputStrides[i] = internal::TensorIntDivisor(m_outputStrides[i]); } } else { - m_outputStrides[NumOutputDims - 1] = 1; + m_outputStrides[static_cast(NumOutputDims - 1)] = 1; for (int i = NumOutputDims - 2; i >= 0; --i) { m_outputStrides[i] = m_outputStrides[i + 1] * m_dimensions[i + 1]; m_fastOutputStrides[i] = internal::TensorIntDivisor(m_outputStrides[i]);