Skip to content

Sacado: Add specializations so pow() only uses if_then_else for simd types

James Willenbring requested to merge etphipp:sacado_simd_fpe into develop

Created by: etphipp

Related to issue #2008. Recently Sacado's overloads of std::pow() were changed to use if_then_else() to support use of Sacado with STK's SIMD type, instead of the ternary operator to check when the base is equal to 0. However when using if_then_else(), both branches are always evaluated, and so a FPE can be generated even though the value isn't used. This changes the implementation by adding two specializations of the PowerOp expression template, one for SIMD and one for everything else, where only the SIMD one uses if_then_else(). This requires any SIMD type that wants to pick up that implementation specialize Sacado::IsSimdType<>.

@bartgol @vbrunini

Merge request reports

Loading