Updated cuda checking