CUDA Math Libraries- Possible Underflow Exceptions?

Hello!
We are currently using the CUDA Math Library to experiment with the numerical stability of its Math APIs. To verify correctness, we compare CUDA Math APIs with the corresponding C programming math functions. We have encountered some issues, particularly with underflow errors, where the C versions identify the underflow exception, but the CUDA versions output -inf/0.0 values.

We understand that CUDA lacks floating-point exception detection mechanisms. However, we want to verify if these are actually underflow errors. Below are the functions and the inputs we used to identify the errors:

  1. asin- input: 1.4693679385278594e-39; C result: Underflow exception; CUDA result: -inf
  2. erf - input: -1.0101903176080569e-38; C result: Underflow exception; CUDA result: -inf
  3. erfc- input: 450.4062194824219; C result: Underflow exception; CUDA result: 0.0
  4. exp- input: -1099461492736.0; C result: Underflow exception; CUDA result: 0.0
  5. exp10- input: -63.3827476501; C result: Underflow exception; CUDA result: 0.0
  6. exp2- input: -7316.86279; C result: Underflow exception; CUDA result: 0.0
  7. tgamma- input- -128.25; C result: Underflow exception; CUDA result: 0.0

I suggest providing a simple test case, like I have done here.

Hi! Robert,
I have provided a template for test case we used here:

I’ve provided a response there. CUDA device code doesn’t throw exceptions of any kind.

Thank you for the response. We want to confirm such situations we identified during our investigation.

Is this the same reason for occurence of NaN results that "CUDA device code doesn’t throw exceptions of any kind " in the Math APIs ? in NaN results

I’ve provided an answer there.