integer :: istat, nDevices,ierrSync,ierrAsync ,ierr istat = cudaGetDeviceCount(nDevices) if (istat /= cudaSuccess) write(*,*) cudaGetErrorString(ierr) ierrSync = cudaGetLastError() ierrAsync = cudaDeviceSynchronize() if (ierrSync /= cudaSuccess) write(*,*) 'Sync kernel error:', cudaGetErrorString(ierrSync) if (ierrAsync /= cudaSuccess) write(*,*) 'Async kernel error:', cudaGetErrorString(ierrAsync)