rewrite gpu.cpp update()