Fix possible crash when tuning prefetch distance
Brought to you by:
rwhaley,
tonyc040457
This patch fixes a crash (segfault) that can occur in tuning prefetch distance for gemv/ger kernels when no kernel was found to have MFLOPS > 0. This can occur when nreps is too small for the platform. The crash occurs because TuneBestPF finds no "best kernel", so it never sets kpB, but then tries to return CloneMVNode(kpB) without first checking to make sure it is non-null. This patch adds the necessary checks for kpB == null, but also adds an additional level of looping the timing functions to increase nreps and re-time whenever the observed time for the kernel is 0.
Fix for possible crash when tuning prefetch distance
Made similar changes to basefiles.
Thanks!
Clint