I have a struct which contains some Eigen::Vector3d values. I have a vector of that struct and I want to upload it to the GPU using thrust.
When I did that, I got an error saying that the copy was undefined. I've been trying to understand why it can't use default cudaMemcpy and it looks like Eigen::Vector3d is not trivially_copyable.
I'm trying to understand why its not, but I cant find any reason. AFAIK, Eigen::Vector3d is just 3 continuous double values. Why is that not trivially_copyable? What are the possible errors I can find if I cudaMemcpy that vector by hand directly?
Edit: The question has been marked as a duplicate of thrust device to host undefined cross_system_copy. I don't think its an exact duplicate, although its related. In that question I'm asking if I should do something special to make thrust work with Eigen. In this question I'm asking why a Eigen::Vector3d is not trivially_copyable and asking what can happen if I decide to cudaMemcpy by hand the content of a std::vector. I think they are different enough questions so I decided to ask it as a separate question.