refactoring CUDA interaction
merge