create cuda-common.h and move some code
remove missing code