Porting model to CUDA