4 ms·
So it depends on how you want to detect overflow. Trapping on math exceptions or otherwise pulling an emergency break doesn't really fit with modern hardware d
by owlbite 5y ago
So it depends on how you want to detect overflow.
Trapping on math exceptions or otherwise pulling an emergency break doesn't really fit with modern hardware design if you want performance (for one thing, what do you do with the rest of your vector? do you just live with a pipeline flush?).
Adding targeted checks used sparingly can work, but probably requires a deeper understanding of the underlying numerical analysis of your problem. Generally just checking for NaN or Inf at the end is a better solution as these are in most cases absorbing states.