cuda implementation done