             }
         }
 
+        t3 = clock();
+        time_in_sec = (t3 - t2) / (double)CLOCKS_PER_SEC;
+        time_mat_J += time_in_sec;
 
 
 

    std::cout << time_txt;
    std::cout << "Total time used " << time_total << " sec\n";


    //====== the end of program ========


             n_combi, dev_start_contr, dev_end_contr, dev_eri);
    }


    // copy the results back to host
    my_cuda_safe(cudaMemcpy(h_eri, dev_eri, n_ERI_bytes, cudaMemcpyDeviceToHost),"mem_eri"); 

    t0 = clock();
    time_in_sec = (t0 - t1) / (double)CLOCKS_PER_SEC;
    time_txt += "Time_2e_GPU   = " + std::to_string(time_in_sec) + " sec\n";
    time_total += time_in_sec;


