2300 make: *** [res/dR1SUMM] Segmentation fault
make: Leaving directory
Cause of segfault is that if r1time() calls time00() (implementation is
ATL_cputime, on gentoo x86) for the start and end times within the
resolution of the getrusage() clock, it is possible for it to return
different values (presumably due to binary/decimal rounding errors) and
thus the time delta can be calculated as a very small negative number,
and the mflops a very large negative number.
If this happens enough that the median mflops calculated are negative,
so TimeR1Kernel returns negative, then TimeAllKernelsForContext will
return NULL as no kernel will be found that has mflops greater than the
initial value of 0.
The tuning code unconditionally dereferences the return of
TimeAllKernelsForContext, and segfaults.
My proposed solution is to coerce the time delta calculated in r1time()
to be nonnegative. Will attach proposed patch.