A Framework of Hierarchy Algorithm with Memory Optimization for Collaborative System Between GPU and CPU