Cudamemcpy error invalid argument. I overlooked the parameter order by .