add energies to global memory