     CudaSafeCall(cudaMalloc(&d_elements, s_Elements));
     CudaSafeCall(cudaMalloc(&d_nodes, s_Nodes));
     CudaSafeCall(cudaMalloc(&d_V, s_V));
+    CudaSafeCall(cudaMalloc(&d_conv, sizeof(int)));
     // Memcpy
     CudaSafeCall(cudaMemcpy(d_elements, elements, s_Elements, cudaMemcpyHostToDevice));
     CudaSafeCall(cudaMemcpy(d_nodes, nodes, s_Nodes, cudaMemcpyHostToDevice));


    // Iterações
    t = clock();
    convergence = 1;
    while (convergence == 1) {
        convergence = 0;
        R = Rf*(1-expf(-k/T));
        cudaMemcpyToSymbol(d_convergence, &convergence, sizeof(int));
        kernel_iter<<<iterblocks, threads>>>(nn, k, alpha, R, d_elements, d_nodes, d_V);
        cudaDeviceSynchronize();
        cudaMemcpyFromSymbol(&convergence, d_convergence, sizeof(int));
        k++;
    }
    t = clock() - t;

    cudaFree(d_V);
    cudaFree(d_nodes);
    cudaFree(d_elements);
    cudaFree(d_conv);

    return k;
}
