mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-27 07:29:52 +08:00
Use array_prod instead of calling TotalSize since TotalSize is only available on DSize.
This commit is contained in:
parent
2556565b4b
commit
34ae80179a
@ -102,7 +102,7 @@ struct TensorEvaluator<const TensorForcedEvalOp<ArgType>, Device>
|
||||
EIGEN_DEVICE_FUNC const Dimensions& dimensions() const { return m_impl.dimensions(); }
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(CoeffReturnType*) {
|
||||
const Index numValues = m_impl.dimensions().TotalSize();
|
||||
const Index numValues = internal::array_prod(m_impl.dimensions());
|
||||
m_buffer = (CoeffReturnType*)m_device.allocate(numValues * sizeof(CoeffReturnType));
|
||||
// Should initialize the memory in case we're dealing with non POD types.
|
||||
if (NumTraits<CoeffReturnType>::RequireInitialization) {
|
||||
|
Loading…
Reference in New Issue
Block a user