CPU and GPU implementation of power method to find eigenvalues