fix refactoring for CUDA version