reduce time copying result back to h_memory