From ee404667e2d3ffd60c2b39dfaf9fa5de0413f3bd Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Tue, 5 Nov 2019 17:17:58 -0800 Subject: Rollback or PR-746 and partial rollback of https://bitbucket.org/eigen/eigen/commits/668ab3fc474e54c7919eda4fbaf11f3a99246494 . std::array is still not supported in CUDA device code on Windows. --- Eigen/src/SparseCore/CompressedStorage.h | 20 ++++++++++---------- Eigen/src/SparseCore/SparseBlock.h | 16 ++++++++-------- Eigen/src/SparseCore/SparseMatrix.h | 10 +++++----- 3 files changed, 23 insertions(+), 23 deletions(-) (limited to 'Eigen/src/SparseCore') diff --git a/Eigen/src/SparseCore/CompressedStorage.h b/Eigen/src/SparseCore/CompressedStorage.h index 5c69b4b6a..acd986fab 100644 --- a/Eigen/src/SparseCore/CompressedStorage.h +++ b/Eigen/src/SparseCore/CompressedStorage.h @@ -53,8 +53,8 @@ class CompressedStorage resize(other.size()); if(other.size()>0) { - std::copy(other.m_values, other.m_values + m_size, m_values); - std::copy(other.m_indices, other.m_indices + m_size, m_indices); + internal::smart_copy(other.m_values, other.m_values + m_size, m_values); + internal::smart_copy(other.m_indices, other.m_indices + m_size, m_indices); } return *this; } @@ -183,14 +183,14 @@ class CompressedStorage internal::scoped_array newIndices(m_allocatedSize); // copy first chunk - std::copy(m_values, m_values +id, newValues.ptr()); - std::copy(m_indices, m_indices+id, newIndices.ptr()); + internal::smart_copy(m_values, m_values +id, newValues.ptr()); + internal::smart_copy(m_indices, m_indices+id, newIndices.ptr()); // copy the rest if(m_size>id) { - std::copy(m_values +id, m_values +m_size, newValues.ptr() +id+1); - std::copy(m_indices+id, m_indices+m_size, newIndices.ptr()+id+1); + internal::smart_copy(m_values +id, m_values +m_size, newValues.ptr() +id+1); + internal::smart_copy(m_indices+id, m_indices+m_size, newIndices.ptr()+id+1); } std::swap(m_values,newValues.ptr()); std::swap(m_indices,newIndices.ptr()); @@ -218,8 +218,8 @@ class CompressedStorage } else { - std::copy(m_values+from, m_values+from+chunkSize, m_values+to); - std::copy(m_indices+from, m_indices+from+chunkSize, m_indices+to); + internal::smart_copy(m_values+from, m_values+from+chunkSize, m_values+to); + internal::smart_copy(m_indices+from, m_indices+from+chunkSize, m_indices+to); } } @@ -251,8 +251,8 @@ class CompressedStorage internal::scoped_array newIndices(size); Index copySize = (std::min)(size, m_size); if (copySize>0) { - std::copy(m_values, m_values+copySize, newValues.ptr()); - std::copy(m_indices, m_indices+copySize, newIndices.ptr()); + internal::smart_copy(m_values, m_values+copySize, newValues.ptr()); + internal::smart_copy(m_indices, m_indices+copySize, newIndices.ptr()); } std::swap(m_values,newValues.ptr()); std::swap(m_indices,newIndices.ptr()); diff --git a/Eigen/src/SparseCore/SparseBlock.h b/Eigen/src/SparseCore/SparseBlock.h index e2ea5494f..d4535d866 100644 --- a/Eigen/src/SparseCore/SparseBlock.h +++ b/Eigen/src/SparseCore/SparseBlock.h @@ -147,14 +147,14 @@ public: // realloc manually to reduce copies typename SparseMatrixType::Storage newdata(m_matrix.data().allocatedSize() - block_size + nnz); - std::copy(m_matrix.valuePtr(), m_matrix.valuePtr() + start, newdata.valuePtr()); - std::copy(m_matrix.innerIndexPtr(), m_matrix.innerIndexPtr() + start, newdata.indexPtr()); + internal::smart_copy(m_matrix.valuePtr(), m_matrix.valuePtr() + start, newdata.valuePtr()); + internal::smart_copy(m_matrix.innerIndexPtr(), m_matrix.innerIndexPtr() + start, newdata.indexPtr()); - std::copy(tmp.valuePtr() + tmp_start, tmp.valuePtr() + tmp_start + nnz, newdata.valuePtr() + start); - std::copy(tmp.innerIndexPtr() + tmp_start, tmp.innerIndexPtr() + tmp_start + nnz, newdata.indexPtr() + start); + internal::smart_copy(tmp.valuePtr() + tmp_start, tmp.valuePtr() + tmp_start + nnz, newdata.valuePtr() + start); + internal::smart_copy(tmp.innerIndexPtr() + tmp_start, tmp.innerIndexPtr() + tmp_start + nnz, newdata.indexPtr() + start); - std::copy(matrix.valuePtr()+end, matrix.valuePtr()+end + tail_size, newdata.valuePtr()+start+nnz); - std::copy(matrix.innerIndexPtr()+end, matrix.innerIndexPtr()+end + tail_size, newdata.indexPtr()+start+nnz); + internal::smart_copy(matrix.valuePtr()+end, matrix.valuePtr()+end + tail_size, newdata.valuePtr()+start+nnz); + internal::smart_copy(matrix.innerIndexPtr()+end, matrix.innerIndexPtr()+end + tail_size, newdata.indexPtr()+start+nnz); newdata.resize(m_matrix.outerIndexPtr()[m_matrix.outerSize()] - block_size + nnz); @@ -175,8 +175,8 @@ public: update_trailing_pointers = true; } - std::copy(tmp.valuePtr() + tmp_start, tmp.valuePtr() + tmp_start + nnz, matrix.valuePtr() + start); - std::copy(tmp.innerIndexPtr() + tmp_start, tmp.innerIndexPtr() + tmp_start + nnz, matrix.innerIndexPtr() + start); + internal::smart_copy(tmp.valuePtr() + tmp_start, tmp.valuePtr() + tmp_start + nnz, matrix.valuePtr() + start); + internal::smart_copy(tmp.innerIndexPtr() + tmp_start, tmp.innerIndexPtr() + tmp_start + nnz, matrix.innerIndexPtr() + start); } // update outer index pointers and innerNonZeros diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 2bd4cee84..e0910a2cb 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -767,7 +767,7 @@ class SparseMatrix initAssignment(other); if(other.isCompressed()) { - std::copy(other.m_outerIndex, other.m_outerIndex + m_outerSize + 1, m_outerIndex); + internal::smart_copy(other.m_outerIndex, other.m_outerIndex + m_outerSize + 1, m_outerIndex); m_data = other.m_data; } else @@ -982,8 +982,8 @@ protected: { Index i = newEntries[k].i; Index p = newEntries[k].p; - std::copy(m_data.valuePtr()+prev_p, m_data.valuePtr()+p, newData.valuePtr()+prev_p+k); - std::copy(m_data.indexPtr()+prev_p, m_data.indexPtr()+p, newData.indexPtr()+prev_p+k); + internal::smart_copy(m_data.valuePtr()+prev_p, m_data.valuePtr()+p, newData.valuePtr()+prev_p+k); + internal::smart_copy(m_data.indexPtr()+prev_p, m_data.indexPtr()+p, newData.indexPtr()+prev_p+k); for(Index j=prev_i;j