         }
     }
     Vi = diag_sum == 0 ? 0.0 : right_sum/diag_sum;
-    R[Node.i] = fabs(V[Node.i] - Vi);
+    c = fabs(V[Node.i] - Vi) < alpha;
+    atomicAnd(&d_convergence, c);
     V[Node.i] = Vi;
 
     return;

    cudaDeviceSynchronize();

    cudaFree(d_V);
    cudaFree(d_R);
    cudaFree(d_nodes);
    cudaFree(d_elements);


                    }
                }
                Vi = diag_sum == 0 ? 0.0 : right_sum/diag_sum;
                diff = fabs(V[Node.i] - Vi);
                r = (diff > r) ? diff : r;
                V[Node.i] = Vi;
            }
        }
