after each kernel call and checking the value of error. If its value is cudaSucess( or 0) than your kernel is executed sucessfully other wise there is some problem in your kernel(Depende on type of error.).
So thanks to CUDAkk I know that my crashes are accompanied by “the launch timed out and was terminated” error. Is there any general reason for this error? (except timing-out which is obviously bogus because the kernel terminates after ridiculously short time)
error “the launch timed out and was terminated” means your kernel takes large time to execute.
actually each kernel execution time must be less than 5 sec( please check the time value ) . If execution time exceeds this then you get “the launch timed out and was terminated”.