You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fnfma<T: num::Float>(a:T,b:Complex<T>,c:Complex<T>) -> Complex<T>{let re = a.mul_add(b.re, c.re);let im = a.mul_add(b.im, c.im);Complex::new(re, im)}
which does compile using two fused multiply adds which hopefully the compiler could reorder, vectorise or whatever optimisations it believes fruitful.
The code I'm writing (a convolution kernel) is attempting to be generic over real and complex numbers which relies on the num::Complex crate to provide this implementation.
My preferred solution would be for num::Complex to implement T::mul_add(Complex<T>, Complex<T>) -> Complex<T> where T: MulAdd<T, T, Output=T>
The text was updated successfully, but these errors were encountered:
I'm attempting to use:
which doesn't exist.
I think the equivalent would be:
which does compile using two fused multiply adds which hopefully the compiler could reorder, vectorise or whatever optimisations it believes fruitful.
The code I'm writing (a convolution kernel) is attempting to be generic over real and complex numbers which relies on the num::Complex crate to provide this implementation.
My preferred solution would be for num::Complex to implement
T::mul_add(Complex<T>, Complex<T>) -> Complex<T> where T: MulAdd<T, T, Output=T>
The text was updated successfully, but these errors were encountered: