title: Efficient way to copy strided data (to and from a CUDA Device)?
body: <p>Is there a possibility to copy data strided by a constant (or even non-constant) value to and from the CUDA device efficiently?</p>
  
  <p>I want to diagonalize a large symmetric matrix. </p>
  
  <p>Using the jacobi algorithm there is a bunch of operations using two rows and two columns within each iteration. </p>
  
  <p>Since the Matrix itself is too big to be copied to the device entirely i am looking for a way to copy the two rows and columns to the device.</p>
  
  <p>It would be nice to use the triangular matrix form to store the data but additional downsides like</p>
  
  <ul>
  <li>non-constant row-length [not that Kind of a Problem] </li>
  <li>non-constant stride of the column values [the stride increases by 1 for each row.]</li>
  </ul>
  
  <p>arise.
  [edit: Even using triangular form it is still impossible to store the whole Matrix on the GPU.]</p>
  
  <p>I looked at some timings and recognized that copying strided values one by one is very slow (synchronous as well as async.).</p>
  
  <p>// edit: removed solution - added an answer</p>