emit warnings when using fast math mode

This commit is contained in:
conrad
2025-06-24 11:05:36 +10:00
parent 9318a5df61
commit 78dbddf2e9
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -32,6 +32,12 @@ op_omit::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_omit>& in)
const uword omit_mode = in.aux_uword_a;
if(arma_config::fast_math_warn)
{
if(omit_mode == 1) { arma_warn(1, "omit_nan(): detection of NaN is not reliable in fast math mode"); }
if(omit_mode == 2) { arma_warn(1, "omit_nonfinite(): detection of non-finite values is not reliable in fast math mode"); }
}
auto is_omitted_1 = [](const eT& x) -> bool { return arma_isnan(x); };
auto is_omitted_2 = [](const eT& x) -> bool { return arma_isnonfinite(x); };
@@ -33,6 +33,12 @@ spop_omit::apply(SpMat<typename T1::elem_type>& out, const SpOp<T1, spop_omit>&
const uword omit_mode = in.aux_uword_a;
if(arma_config::fast_math_warn)
{
if(omit_mode == 1) { arma_warn(1, "omit_nan(): detection of NaN is not reliable in fast math mode"); }
if(omit_mode == 2) { arma_warn(1, "omit_nonfinite(): detection of non-finite values is not reliable in fast math mode"); }
}
auto is_omitted_1 = [](const eT& x) -> bool { return arma_isnan(x); };
auto is_omitted_2 = [](const eT& x) -> bool { return arma_isnonfinite(x); };