Currently, if the result is not valid, it will still print a result and so the "best gflop/s" which is determined could be incorrect. In particular, if the CUDA kernel launch fails, the "best gflop/s" will be too big since the kernel time was very fast since the kernel didn't run. This will cause the "best flop/s" to be based on an invalid run.
This PR avoids the problem above. If the validation fails, it sets the kernel time to the biggest possible, so that it will not be considered in the computation of "best" gflop/s. There are probably cleaner ways, this is just what I was using to get it working. I'm happy to make changes if requested!
This is to fix the issue mentioned in https://github.com/UoB-HPC/miniBUDE/issues/37.
Currently, if the result is not valid, it will still print a result and so the "best gflop/s" which is determined could be incorrect. In particular, if the CUDA kernel launch fails, the "best gflop/s" will be too big since the kernel time was very fast since the kernel didn't run. This will cause the "best flop/s" to be based on an invalid run.
This PR avoids the problem above. If the validation fails, it sets the kernel time to the biggest possible, so that it will not be considered in the computation of "best" gflop/s. There are probably cleaner ways, this is just what I was using to get it working. I'm happy to make changes if requested!