dannys4 / FFT-Research-F20

Research into accelerated FFTs
MIT License
2 stars 1 forks source link

Variable initialization #1

Closed mkstoyanov closed 3 years ago

mkstoyanov commented 3 years ago

https://github.com/dannys4/FFT-Research-F20/blob/a6a45f6c761b5d84122a1cb1261231d6df839328/FFTE/include/complex.hpp#L31

You may have double-initialization here, e.g., var gets created and initialized once than it gets overwritten by v. Even if var is not initialized, it will have an uninitilized state when entering the call. It is better to initialize immediately:

Complex(__m128d& v) : var(v) {}
dannys4 commented 3 years ago

Noted. I'll comb back through the code looking for this kind of behavior-- it's likely there are other fragments similar to this. This specific instance is addressed in commit 018d7a92f3ce84094cf0840a397d6b6a151a8578