back to CPU.

An example of this procedure is given in Fig. \[fig:kernel\], where four Householder transformations are applied to a local eigenvector matrix with $N_R=7$ rows and $N_C=6$ columns. The CUDA kernel is launched with six blocks and four threads, as indicated by the block id and thread id (both zero-based) in the figure. Throughout the execution of the kernel, block $i$ is responsible for the $(i+1)^\text{th}$ eigenvector. The four Householder transformations need to be applied in reverse order, i.e. from right to left. In the application of the rightmost transformation, threads 0, 1, 2, 3 in each block are responsible for the 4$^\text{th}$, 5$^\text{th}$, 6$^\text{th}$, and 7$^\text{th}$ elements, respectively, of the eigenvector this block is responsible for. After computing Eq. \[eq:kernel\], thread 3 immediately writes the 7$^\text{th}$ element back to the $\boldsymbol{X}_\text{local}$ array. Threads 1, 2, 3 take the updated 4$^\text{th}$, 5$^\text{th}$, and 6$^\text{th}$ elements from threads 0, 1, 2, respectively. Then thread 0 loads the 3$^\text{rd}$ element of the eigenvector from $\boldsymbol{X}_\text{local}$, and all the threads are ready for the next transformation. It is obvious that all the transformations can be applied in exactly the same way. After the kernel finishes, the final $\boldsymbol{X}_\text{local}$ is copied back 