Add synchronize function to varray, add cache for temperary gpuarray