fix bug of smart pointer method[release], should not release the memory
add method[reset]
guard gpu memory by RAII
remove redundancy codes
reorganize codes