better solve_gpu: reuse GPU array allocations if possible